:root {
  --bg: #FCFBF9;
  --surface: #FFFFFF;
  --surface-soft: #F4F3EF;
  --surface-deep: #E9E7E1;
  --ink: #3D3C38;
  --ink-2: #6E6C65;
  --ink-3: #A5A39B;
  --accent: #8E7C99;
  --accent-deep: #6B5A78;
  --accent-soft: #F1EEF4;
  --line: rgba(61, 60, 56, 0.09);
  --line-strong: rgba(142, 124, 153, 0.42);
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", Georgia, serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(52% 32% at 16% 6%, rgba(160, 148, 172, 0.13), transparent 70%),
    radial-gradient(46% 28% at 90% 20%, rgba(190, 178, 160, 0.11), transparent 70%),
    radial-gradient(64% 38% at 50% 102%, rgba(150, 140, 165, 0.12), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 26px 72px;
  min-height: 100vh;
}

.screen { display: none; }
.screen.active { display: block; animation: rise 0.6s cubic-bezier(0.22, 0.68, 0.32, 1) both; }

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

/* ---------- 通用元件 ---------- */

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 16px 20px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 3px;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.16s ease;
}
.btn:active { transform: scale(0.99); }

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
  font-size: 14px;
  letter-spacing: 2px;
}

/* ---------- 授权页 ---------- */

.gate { padding-top: 108px; text-align: center; }

.gate .mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 30px;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate .mark svg { width: 100%; height: 100%; }

.gate h1 {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 9px;
  margin: 0 0 16px;
  color: var(--ink);
}

.gate .sub {
  font-size: 13.5px;
  color: var(--ink-3);
  letter-spacing: 2px;
  margin: 0 0 46px;
}

.field { margin-bottom: 26px; }
.field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  padding: 13px 4px;
  font-family: var(--font-sans);
  font-size: 17px;
  color: var(--ink);
  text-align: center;
  letter-spacing: 3px;
  outline: none;
  transition: border-color 0.22s ease;
}
.field input::placeholder { color: var(--ink-3); letter-spacing: 2px; font-size: 14px; }
.field input:focus { border-bottom-color: var(--accent); }

.err {
  font-size: 13px;
  color: #A8605F;
  margin: 0 0 18px;
  min-height: 20px;
  letter-spacing: 0.5px;
}

.gate .note {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 2.1;
}
.gate .note a { color: var(--accent-deep); text-decoration: none; border-bottom: 1px solid var(--line-strong); }

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

.hero { padding-top: 92px; text-align: center; }
.hero h1 {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 400;
  letter-spacing: 7px;
  margin: 0 0 18px;
  color: var(--ink);
}
.hero .sub {
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 5px;
  margin: 0 0 40px;
}
.hero .desc {
  font-size: 14.5px;
  line-height: 2.1;
  color: var(--ink-2);
  margin: 0 0 48px;
}
.hero .meta {
  margin-top: 26px;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 1px;
}
.hero .types-hint {
  margin-top: 58px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 2.3;
}
.hero .types-hint b { font-weight: 400; color: var(--ink-2); }

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

.quiz-head {
  padding-top: 36px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.back {
  width: 30px;
  height: 30px;
  flex: none;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  position: relative;
}
.back.show { opacity: 1; pointer-events: auto; }
.back::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 10px;
  width: 9px;
  height: 9px;
  border-left: 1.2px solid var(--ink-3);
  border-bottom: 1.2px solid var(--ink-3);
  transform: rotate(45deg);
}

.bar { flex: 1; height: 2px; background: var(--surface-deep); overflow: hidden; }
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.45s cubic-bezier(0.3, 0.7, 0.3, 1);
}

.count {
  font-size: 12px;
  color: var(--ink-3);
  flex: none;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.q-num {
  font-size: 11.5px;
  color: var(--accent);
  letter-spacing: 4px;
  margin: 0 0 16px;
}

.q-text {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.85;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 38px;
  letter-spacing: 1px;
}

.opts { display: flex; flex-direction: column; gap: 12px; }

.opt {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.14s ease;
}
.opt:hover { border-color: var(--line-strong); }
.opt:active { transform: scale(0.995); }
.opt.picked { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }

/* ---------- 计算中 ---------- */

.loading { padding-top: 168px; text-align: center; }
.loading .ring {
  width: 42px;
  height: 42px;
  margin: 0 auto 28px;
  border-radius: 50%;
  border: 1.5px solid var(--surface-deep);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { font-size: 13.5px; color: var(--ink-3); letter-spacing: 3px; margin: 0; }

/* ---------- 结果页 ---------- */

.result { padding-top: 44px; }

.res-label {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 6px;
  margin: 0 0 22px;
}

.res-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 44px 26px 34px;
  text-align: center;
}

.res-name {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: 6px;
  color: var(--ink);
  margin: 0 0 20px;
}

.res-tagline {
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--ink-2);
  margin: 0 0 26px;
  letter-spacing: 0.5px;
}

.res-tags { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.res-tags span {
  font-size: 12px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 14px;
  letter-spacing: 1px;
}

.axes { text-align: left; border-top: 1px solid var(--line); padding-top: 28px; }
.axis-row { margin-bottom: 22px; }
.axis-row:last-child { margin-bottom: 0; }
.axis-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 9px;
  letter-spacing: 1px;
}
.axis-top b { font-weight: 400; color: var(--accent-deep); }
.axis-bar { height: 3px; background: var(--surface-deep); overflow: hidden; }
.axis-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.9s cubic-bezier(0.25, 0.8, 0.3, 1);
}

.section { margin-top: 40px; }
.section h3 {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 400;
  letter-spacing: 5px;
  color: var(--ink);
  margin: 0 0 18px;
}
.section p {
  font-size: 14.5px;
  line-height: 2.15;
  color: var(--ink-2);
  margin: 0 0 16px;
  letter-spacing: 0.3px;
}

/* 细节命中句 */
.hits { display: flex; flex-direction: column; gap: 2px; }
.hits li {
  list-style: none;
  position: relative;
  padding: 15px 18px 15px 26px;
  font-size: 14.5px;
  line-height: 2;
  color: var(--ink-2);
  background: var(--surface-soft);
  letter-spacing: 0.3px;
}
.hits li:first-child { border-radius: 8px 8px 0 0; }
.hits li:last-child { border-radius: 0 0 8px 8px; }
.hits li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 26px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.quote {
  background: var(--surface-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 18px 22px;
}
.quote p { font-size: 14.5px; line-height: 2.05; color: var(--ink-2); margin: 0 0 14px; letter-spacing: 0.3px; }
.quote p:last-child { margin-bottom: 0; }
.quote b { font-weight: 400; color: var(--ink); }

.keywords { display: flex; gap: 14px; flex-wrap: wrap; }
.keywords span {
  font-family: var(--font-serif);
  font-size: 25px;
  letter-spacing: 5px;
  color: var(--accent-deep);
  padding: 6px 0;
  border-bottom: 1px solid var(--line-strong);
}

.actions { margin-top: 42px; display: flex; flex-direction: column; gap: 12px; }

.shot { display: none; margin-top: 34px; text-align: center; }
.shot img { width: 100%; max-width: 320px; border-radius: 10px; display: block; margin: 0 auto 14px; }
.shot .tip { font-size: 12px; color: var(--ink-3); letter-spacing: 1px; }

/* 分享文案 */
.share { margin-top: 40px; }
.share-text {
  background: var(--surface-soft);
  border-radius: 10px;
  padding: 20px 22px;
  font-size: 13.5px;
  line-height: 2;
  color: var(--ink-2);
  white-space: pre-wrap;
  letter-spacing: 0.3px;
}
.btn-copy {
  margin-top: 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  width: 100%;
  font-size: 13.5px;
  color: var(--ink-2);
  letter-spacing: 2px;
  cursor: pointer;
  font-family: var(--font-sans);
}

.foot {
  margin-top: 48px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 2.1;
  letter-spacing: 0.5px;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  letter-spacing: 1.5px;
  padding: 11px 22px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  z-index: 99;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
