:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --text: #1f2330;
  --text-soft: #5b6172;
  --line: #e6e8f0;
  --brand: #6c5ce7;
  --brand-soft: #efeafd;
  --accent: #ff7675;
  --ok: #00b894;
  --warn: #fdcb6e;
  --shadow: 0 8px 30px rgba(31, 35, 48, 0.08);
  --radius: 16px;
  --A: #4b7bec;
  --B: #e84393;
  --C: #00b894;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 64px; }

/* Header */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 8px; }
.logo { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.logo span { color: var(--brand); }
.nav a { font-size: 13px; color: var(--text-soft); margin-left: 14px; }
.nav a:hover { color: var(--brand); }

.hero { text-align: center; padding: 18px 0 6px; }
.hero h1 { font-size: 26px; margin: 0 0 6px; }
.hero p { color: var(--text-soft); margin: 0 auto; max-width: 520px; font-size: 14px; }

/* Type sections */
.section-title { display: flex; align-items: center; gap: 8px; margin: 26px 0 12px; font-size: 15px; font-weight: 700; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; color: #fff; font-weight: 700; }
.tag.A { background: var(--A); }
.tag.B { background: var(--B); }
.tag.C { background: var(--C); }
.section-sub { color: var(--text-soft); font-size: 12px; font-weight: 400; }

/* Cards grid */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--line);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(31,35,48,.12); }
.card .cover { font-size: 30px; }
.card .ct { font-weight: 700; font-size: 15px; }
.card .cd { color: var(--text-soft); font-size: 12px; }
.card .meta { margin-top: auto; font-size: 11px; color: var(--text-soft); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: none; border-radius: 999px;
  padding: 12px 20px; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: filter .15s ease; width: 100%;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; }

/* Test wizard */
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 14px 0 18px; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .25s ease; }
.q-count { font-size: 13px; color: var(--text-soft); }
.question { font-size: 19px; font-weight: 700; margin: 6px 0 18px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-size: 15px; cursor: pointer; transition: all .15s ease;
}
.option:hover { border-color: var(--brand); background: var(--brand-soft); }
.option.sel { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }

/* Result report (A) */
.report-card { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.report-card .rt { font-size: 13px; color: var(--brand); font-weight: 700; letter-spacing: 1px; }
.report-card h2 { margin: 6px 0 0; font-size: 24px; }
.report-card .headline { font-size: 17px; font-weight: 600; margin: 6px 0 14px; }
.report-card .body { color: var(--text-soft); font-size: 15px; }
.dim-row { margin: 10px 0; }
.dim-row .dl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.dim-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.dim-bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* Result card (B/C) */
.share-card {
  border-radius: 22px; padding: 30px 24px; color: #fff; text-align: center;
  background: linear-gradient(135deg, #6c5ce7, #e84393); box-shadow: var(--shadow);
}
.share-card .ct { font-size: 13px; opacity: .85; letter-spacing: 2px; }
.share-card h2 { font-size: 30px; margin: 8px 0 4px; }
.share-card .headline { font-size: 16px; opacity: .95; }
.share-card .body { margin-top: 14px; font-size: 14px; opacity: .92; }
.share-card.C { background: linear-gradient(135deg, #00b894, #0984e3); }

/* Distribution */
.dist { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); margin-top: 16px; }
.dist h3 { margin: 0 0 12px; font-size: 15px; }
.dist .q { font-size: 13px; font-weight: 600; margin: 14px 0 8px; }
.opt-line { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.opt-line .lab { width: 46%; color: var(--text-soft); }
.opt-line.mine .lab { color: var(--brand); font-weight: 700; }
.bar { flex: 1; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--line); border-radius: 999px; }
.opt-line.mine .bar > i { background: var(--brand); }
.opt-line .pct { width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.like-you { color: var(--ok); font-weight: 700; font-size: 14px; margin-top: 4px; }
.insufficient { color: var(--text-soft); font-size: 13px; padding: 10px; background: var(--surface-2); border-radius: 10px; }

/* Ad overlay (placeholder for real rewarded-video SDK) */
.ad-mask {
  position: fixed; inset: 0; background: rgba(10,10,16,.96); color: #fff; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px;
}
.ad-mask .badge { position: absolute; top: 16px; left: 16px; font-size: 12px; background: #333; padding: 4px 10px; border-radius: 6px; letter-spacing: 1px; }
.ad-mask .close-x { position: absolute; top: 14px; right: 16px; font-size: 22px; opacity: .5; }
.ad-mask .ph { width: 120px; height: 120px; border-radius: 20px; background: linear-gradient(135deg,#6c5ce7,#e84393); display: flex; align-items: center; justify-content: center; font-size: 46px; }
.ad-mask .t { font-size: 16px; }
.ad-mask .sub { font-size: 12px; opacity: .7; max-width: 320px; text-align: center; }
.ad-progress { width: 220px; height: 6px; background: #333; border-radius: 999px; overflow: hidden; }
.ad-progress > i { display: block; height: 100%; width: 0; background: #fff; }
.ad-mask .claim { background: #fff; color: #111; border: none; border-radius: 999px; padding: 12px 28px; font-weight: 800; cursor: pointer; display: none; }
.ad-note { position: fixed; bottom: 10px; width: 100%; text-align: center; font-size: 11px; color: #888; }

/* misc */
.muted { color: var(--text-soft); font-size: 13px; }
.center { text-align: center; }
.locked { text-align: center; padding: 40px 20px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1f2330; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; opacity: 0; transition: opacity .2s; z-index: 9998; }
.toast.show { opacity: 1; }
.row { display: flex; gap: 10px; align-items: center; }
.admin-item { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; }
.switch { width: 44px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
.switch.on { background: var(--ok); }
.switch > i { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: left .15s; }
.switch.on > i { left: 22px; }

/* 账号表单（登录 / 注册） */
.panel { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.panel h2 { margin: 0 0 4px; font-size: 20px; }
.panel > .muted { margin: 0 0 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 15px; background: var(--surface); color: var(--text); outline: none;
  font-family: inherit;
}
.field input:focus { border-color: var(--brand); }
.hint { font-size: 12px; color: var(--text-soft); margin-top: 6px; min-height: 16px; }
.hint.err { color: #d63031; }
.hint.ok { color: var(--ok); }
.divider { text-align: center; color: var(--text-soft); font-size: 13px; margin: 16px 0 10px; }

/* Resume modal */
.modal-mask { position: fixed; inset: 0; background: rgba(10,10,16,.5); display: flex; align-items: center; justify-content: center; z-index: 9990; padding: 20px; }
.modal { background: #fff; border-radius: 16px; padding: 24px; max-width: 340px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); text-align: center; }
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal p { color: var(--text-soft); font-size: 14px; margin: 0 0 18px; }
.modal .row { display: flex; gap: 10px; }
.modal .btn { margin: 0; }
