:root {
  --bg: #0b1220;
  --card: #121c2f;
  --muted: #94a3b8;
  --text: #e2e8f0;
  --accent: #38bdf8;
  --accent-2: #a78bfa;
  --ok: #34d399;
  --danger: #fb7185;
  --radius: 14px;
  --font: "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 10% -10%, #1e293b 0%, transparent 55%),
    radial-gradient(900px 500px at 110% 0%, #312e81 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 16px;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 18px;
}

.tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid #334155;
  padding: 4px 10px;
  border-radius: 999px;
}

.view {
  flex: 1;
}

.card {
  background: linear-gradient(160deg, rgba(56, 189, 248, 0.08), transparent 40%),
    var(--card);
  border: 1px solid #1f2a3d;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

h1 {
  font-size: 26px;
  margin: 0 0 12px;
  line-height: 1.25;
}

.lead {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 20px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  color: #0f172a;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.25);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.secondary {
  background: #1e293b;
  color: var(--text);
  border: 1px solid #334155;
  box-shadow: none;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-row .btn {
  flex: 1;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.progress {
  height: 6px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  transition: width 0.25s ease;
}

.q-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.45;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opt {
  text-align: left;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid #273449;
  background: #0f172a;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.opt:hover, .opt:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.opt.selected {
  border-color: var(--accent-2);
  background: rgba(167, 139, 250, 0.12);
}

.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 8px 0 16px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.share-hint {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px dashed #334155;
  font-size: 13px;
  color: var(--muted);
}

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 32px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #273449;
  backdrop-filter: blur(10px);
  z-index: 20;
}

.tab {
  border: none;
  border-radius: 12px;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.tab.active {
  color: #0f172a;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

.tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.err {
  color: var(--danger);
  font-size: 14px;
  margin-top: 10px;
}
