﻿:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #19212f;
  --muted: #667085;
  --brand: #0f766e;
  --brand-2: #0ea5a4;
  --border: #dbe2ea;
  --ok: #2f80ed;
  --bad: #ef4444;
  --cur: #14b8a6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at top left, #def7ff 0%, var(--bg) 38%, #eef2ff 100%);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.hidden { display: none !important; }

.app-shell {
  width: min(1120px, 95vw);
  margin: 14px auto 88px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(130deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, .2);
}

.brand { font-weight: 800; letter-spacing: .5px; }
.top-actions { display: flex; gap: 8px; }
.page { margin-top: 12px; }
.view { display: grid; gap: 12px; }

.card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  animation: fade-in .3s ease both;
}

.title-sm {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.label {
  font-size: 13px;
  color: var(--muted);
}

.meta {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

#home-subtitle {
  margin-bottom: 8px;
}

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

.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.mt { margin-top: 10px; }

.btn {
  border: 0;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn.primary {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(15, 118, 110, .2);
}

.btn.ghost {
  color: #0f172a;
  background: #edf2f7;
}

.btn.danger {
  color: #9f1239;
  background: #fff1f2;
}

.btn.active {
  color: #0f766e;
  background: #fff;
}

.input {
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}

.input.compact { width: 90px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
}

.captcha-wrap {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-top: 10px;
  padding: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
}

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

.stat {
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafcff;
}

.stat .k {
  font-size: 12px;
  color: var(--muted);
}

.stat .v {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
}

.manage-list {
  display: grid;
  gap: 8px;
}

.manage-item {
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafcff;
}

.manage-item .name {
  font-size: 13px;
  font-weight: 700;
}

.manage-item .line {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.timer {
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fafcff;
  font-size: 12px;
  color: var(--muted);
}

.progress {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf2f7;
}

.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #60a5fa, #14b8a6);
  transition: width .2s ease;
}

.result-box {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 14px;
  line-height: 1.7;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
}

.main-col { min-width: 0; }

.question-card .tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eaf7f6;
  color: #3730a3;
  font-size: 12px;
}

.question-card .q-title {
  margin: 8px 0 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.opts {
  display: grid;
  gap: 8px;
}

.opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  transition: all .12s ease;
}

.opt:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
}

.opt.active {
  border-color: #14b8a6;
  background: #f0fdfa;
}

.opt input {
  margin-top: 2px;
  transform: scale(1.12);
  accent-color: #0f766e;
}

.opt label {
  flex: 1;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
}

.feedback {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #d1d5db;
  font-size: 13px;
  line-height: 1.65;
}

.feedback .ok {
  color: var(--brand);
  font-weight: 700;
}

.feedback .bad {
  color: #b91c1c;
  font-weight: 700;
}

.nav-panel {
  position: sticky;
  top: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-radius: 999px;
}

.dot.cur { background: var(--cur); }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.empty { background: #d1d5db; }

.num-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.num-cell {
  min-height: 30px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  font-size: 12px;
}

.num-cell.answered {
  color: #1e40af;
  border-color: #60a5fa;
  background: #dbeafe;
}

.num-cell.wrong {
  color: #991b1b;
  border-color: #f87171;
  background: #fee2e2;
}

.num-cell.current {
  color: #0f766e;
  border-color: #14b8a6;
  background: #ccfbf1;
  font-weight: 700;
  animation: pulse .85s ease;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, .25);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 82vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-left: 1px solid var(--border);
  background: #fff;
  animation: slide-in .22s ease both;
}

.desktop-only { display: inline-flex; }
.mobile-only { display: none; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes slide-in {
  from { opacity: .7; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .nav-panel { position: static; }
}

@media (max-width: 720px) {
  .app-shell {
    width: 100vw;
    margin: 0 0 76px;
    padding: 0 8px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    border-radius: 0 0 14px 14px;
  }

  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex; }
  .input.compact { width: 84px; }
  .num-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
