/* 清净趣味测试 · 看见数字里的自己 —— 全站样式（移动优先） */

:root {
  --bg-0: #0e0b24;
  --bg-1: #171136;
  --ink: #f2effc;
  --ink-dim: rgba(242, 239, 252, 0.62);
  --ink-faint: rgba(242, 239, 252, 0.38);
  --violet: #8b7cf6;
  --teal: #4fd8c6;
  --pink: #e77fb3;
  --gold: #f2cd8b;
  --card: rgba(255, 255, 255, 0.055);
  --card-line: rgba(255, 255, 255, 0.12);
  --grad-main: linear-gradient(135deg, #8b7cf6 0%, #5f8bf5 55%, #4fd8c6 100%);
  --grad-gold: linear-gradient(135deg, #f5dfa8, #e9b96b);
  --radius: 18px;
  --shadow: 0 18px 50px rgba(5, 3, 22, 0.55);
}

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

html { height: 100%; }

body {
  min-height: 100%;
  background: radial-gradient(120% 90% at 80% -10%, #241a4e 0%, var(--bg-1) 45%, var(--bg-0) 100%) fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0.2px;
  overflow-x: hidden;
}

/* ---------- 极光背景 ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i {
  position: absolute; display: block; border-radius: 50%;
  filter: blur(70px); opacity: 0.5; will-change: transform;
}
.aurora i:nth-child(1) { width: 46vmax; height: 46vmax; left: -14vmax; top: -12vmax;
  background: radial-gradient(circle, rgba(139,124,246,0.5), transparent 65%);
  animation: drift1 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 40vmax; height: 40vmax; right: -12vmax; top: 22vh;
  background: radial-gradient(circle, rgba(79,216,198,0.34), transparent 65%);
  animation: drift2 32s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 36vmax; height: 36vmax; left: 8vmax; bottom: -16vmax;
  background: radial-gradient(circle, rgba(231,127,179,0.28), transparent 65%);
  animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(9vw, 7vh) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-7vw, -5vh) scale(0.92); } }
@keyframes drift3 { to { transform: translate(5vw, -8vh) scale(1.08); } }

/* ---------- 布局 ---------- */
main {
  position: relative; z-index: 1;
  max-width: 460px; margin: 0 auto;
  padding: 26px 20px calc(34px + env(safe-area-inset-bottom));
  min-height: 100vh; display: flex; flex-direction: column;
}

.view { display: none; animation: fadeUp 0.45s ease both; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

/* ---------- 主页 ---------- */
.brand { text-align: center; padding: 30px 0 8px; }
.brand-logo {
  width: 74px; height: 74px; margin: 0 auto 14px; display: block;
  filter: drop-shadow(0 6px 18px rgba(139, 124, 246, 0.45));
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.brand h1 {
  font-size: 30px; font-weight: 700; letter-spacing: 3px;
  background: var(--grad-main);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .slogan { margin-top: 6px; color: var(--ink-dim); font-size: 14px; letter-spacing: 5px; }

.test-cards { display: flex; flex-direction: column; gap: 16px; margin-top: 26px; }
.test-card {
  display: flex; align-items: center; gap: 16px; width: 100%;
  padding: 18px 18px; text-align: left; color: var(--ink);
  background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius); cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  font-family: inherit; font-size: inherit;
}
.test-card:active { transform: scale(0.975); }
.test-card .icon {
  flex: 0 0 52px; width: 52px; height: 52px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-main); box-shadow: 0 8px 20px rgba(95, 139, 245, 0.35);
}
.test-card .icon svg { width: 28px; height: 28px; }
.test-card:nth-child(2) .icon { background: linear-gradient(135deg, #e77fb3, #8b7cf6); box-shadow: 0 8px 20px rgba(231, 127, 179, 0.3); }
.test-card:nth-child(3) .icon { background: linear-gradient(135deg, #f2cd8b, #e77fb3); box-shadow: 0 8px 20px rgba(242, 205, 139, 0.28); }
.test-card h2 { font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.test-card p { margin-top: 3px; font-size: 13px; color: var(--ink-dim); }
.test-card .arrow { margin-left: auto; color: var(--ink-faint); font-size: 20px; flex: 0 0 auto; }

.disclaimer {
  margin-top: auto; padding-top: 34px; text-align: center;
  font-size: 12px; color: var(--ink-faint); line-height: 1.8;
}

/* ---------- 测试页 ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.back-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--card-line);
  background: var(--card); color: var(--ink); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-family: inherit;
  transition: background 0.2s ease;
}
.page-title { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.page-sub { color: var(--ink-dim); font-size: 14px; margin-top: 4px; }

.test-panel { padding: 24px 20px; margin-top: 14px; }
.field-label { font-size: 14px; color: var(--ink-dim); margin-bottom: 10px; display: block; }
.input-wrap {
  display: flex; align-items: center; gap: 8px;
  background: rgba(10, 8, 32, 0.55); border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px; padding: 4px 6px 4px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-wrap:focus-within { border-color: rgba(139, 124, 246, 0.8); box-shadow: 0 0 0 4px rgba(139, 124, 246, 0.15); }
.input-wrap input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--ink); font-size: 20px; letter-spacing: 2px; padding: 12px 0;
  font-family: inherit;
}
.input-wrap input::placeholder { color: rgba(242, 239, 252, 0.28); letter-spacing: 1px; }
.clear-btn { border: none; background: none; color: var(--ink-faint); font-size: 18px; padding: 10px 12px; cursor: pointer; display: none; }
.clear-btn.show { display: block; }

.hint { margin-top: 12px; font-size: 13px; color: var(--ink-faint); }
.recognized { margin-top: 8px; font-size: 13px; color: var(--teal); min-height: 20px; }
.recognized.error { color: #f38ba8; }

.btn {
  display: block; width: 100%; border: none; cursor: pointer;
  border-radius: 16px; padding: 16px; font-size: 17px; font-weight: 600; letter-spacing: 2px;
  color: #fff; background: var(--grad-main); font-family: inherit;
  box-shadow: 0 12px 28px rgba(95, 139, 245, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { filter: grayscale(0.4) brightness(0.75); cursor: not-allowed; }
.btn.ghost {
  background: var(--card); border: 1px solid var(--card-line); color: var(--ink-dim);
  box-shadow: none; margin-top: 12px;
}
.btn.gold { background: var(--grad-gold); color: #43301a; box-shadow: 0 12px 28px rgba(233, 185, 107, 0.3); }
.btn .price { font-size: 15px; }

/* ---------- 读条 ---------- */
.loading { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(14, 11, 36, 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 1; transition: opacity 0.4s ease; }
.loading.hidden { opacity: 0; pointer-events: none; }
.loading-box { width: min(78vw, 300px); text-align: center; }
.orb {
  width: 86px; height: 86px; margin: 0 auto 26px; border-radius: 50%;
  background: conic-gradient(from 0deg, #8b7cf6, #4fd8c6, #e77fb3, #8b7cf6);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  animation: spin 1.15s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-status { font-size: 15px; color: var(--ink-dim); letter-spacing: 1px; min-height: 24px; transition: opacity 0.3s; }
.bar { margin-top: 18px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar i {
  display: block; height: 100%; width: 0%; border-radius: 99px;
  background: var(--grad-main); transition: width 0.25s linear;
}

/* ---------- 揭晓页 ---------- */
.reveal-wrap { text-align: center; padding-top: 10px; }
.reveal-kicker { color: var(--ink-dim); font-size: 14px; letter-spacing: 3px; }
.number-badge {
  width: 112px; height: 112px; margin: 22px auto 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; font-weight: 700; color: #fff;
  background: var(--grad-main);
  box-shadow: 0 0 0 8px rgba(139, 124, 246, 0.12), 0 0 0 18px rgba(139, 124, 246, 0.06), 0 16px 40px rgba(95, 139, 245, 0.45);
  animation: pop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.reveal-name { font-size: 26px; font-weight: 700; letter-spacing: 2px; }
.reveal-teaser { margin: 12px auto 0; max-width: 300px; color: var(--ink-dim); font-size: 14px; }

.preview-card { position: relative; margin-top: 26px; padding: 22px 20px 20px; overflow: hidden; text-align: left; }
.preview-card .lines { display: flex; flex-direction: column; gap: 12px; filter: blur(5px); opacity: 0.5; }
.preview-card .lines i { display: block; height: 13px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.16), rgba(255,255,255,0.34), rgba(255,255,255,0.16));
  background-size: 200% 100%; animation: shimmer 2.2s linear infinite; }
.preview-card .lines i:nth-child(1) { width: 42%; height: 18px; }
.preview-card .lines i:nth-child(2) { width: 96%; }
.preview-card .lines i:nth-child(3) { width: 88%; }
.preview-card .lines i:nth-child(4) { width: 93%; }
.preview-card .lines i:nth-child(5) { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.lock-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: rgba(14, 11, 36, 0.35); border-radius: inherit;
  color: var(--ink-dim); font-size: 13px; letter-spacing: 2px;
}
.lock-overlay svg { width: 30px; height: 30px; opacity: 0.9; }

/* ---------- 付费页 ---------- */
.pay-panel { padding: 26px 22px; margin-top: 14px; text-align: center; }
.pay-name-chip {
  display: inline-block; padding: 7px 18px; border-radius: 99px; font-size: 14px; letter-spacing: 1px;
  background: rgba(139, 124, 246, 0.16); border: 1px solid rgba(139, 124, 246, 0.4); color: #cfc7ff;
}
.pay-price { margin: 18px 0 4px; font-size: 15px; color: var(--ink-dim); }
.pay-price b { font-size: 44px; font-weight: 700; color: var(--gold); font-family: Georgia, serif; margin: 0 4px; }
.pay-desc { font-size: 13px; color: var(--ink-faint); margin-bottom: 20px; }

.pay-methods { text-align: left; margin-bottom: 20px; }
.pay-methods .method { padding: 14px 4px; border-top: 1px dashed rgba(255, 255, 255, 0.1); }
.pay-methods .method:first-child { border-top: none; }
.method h3 { font-size: 13px; color: var(--ink-dim); font-weight: 500; letter-spacing: 2px; margin-bottom: 8px; }
.bank-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 15px; }
.bank-row .k { flex: 0 0 64px; color: var(--ink-faint); font-size: 13px; }
.bank-row .v { flex: 1; word-break: break-all; }
.copy-btn {
  flex: 0 0 auto; border: 1px solid var(--card-line); background: rgba(255,255,255,0.07);
  color: var(--ink-dim); border-radius: 8px; font-size: 12px; padding: 4px 10px; cursor: pointer; font-family: inherit;
}
.qr-imgs { display: flex; gap: 16px; }
.qr-item { flex: 1; text-align: center; }
.qr-item img { width: 100%; max-width: 170px; border-radius: 12px; border: 1px solid var(--card-line); display: block; margin: 0 auto; }
.qr-item span { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-faint); }

.pay-note { margin-top: 14px; font-size: 12px; color: var(--ink-faint); line-height: 1.8; }

/* ---------- 答案页 ---------- */
.answer-head { text-align: center; padding: 6px 0 18px; }
.answer-head .number-badge { width: 84px; height: 84px; font-size: 34px; margin-bottom: 14px; }
.answer-body { display: flex; flex-direction: column; gap: 14px; }
.block { padding: 18px 18px 16px; }
.block h3 {
  font-size: 13px; font-weight: 600; letter-spacing: 3px; color: var(--teal);
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.block h3::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--teal); }
.block p { font-size: 15px; color: rgba(242, 239, 252, 0.88); text-align: justify; }
.block.deep h3 { color: var(--violet); }
.block.deep h3::before { background: var(--violet); }
.block.deep p { white-space: pre-wrap; }
.block.highlight { background: linear-gradient(135deg, rgba(242, 205, 139, 0.12), rgba(231, 127, 179, 0.08)); border-color: rgba(242, 205, 139, 0.35); }
.block.highlight h3 { color: var(--gold); }
.block.highlight h3::before { background: var(--gold); }

.answer-actions { margin-top: 22px; }

/* ---------- 管理后台 ---------- */
.admin-wrap { max-width: 560px; }
.admin-panel { padding: 22px 20px; margin-top: 14px; }
.admin-panel h3 { font-size: 15px; letter-spacing: 2px; margin-bottom: 14px; color: var(--ink); }
.admin-panel .field { margin-bottom: 14px; }
.admin-panel label { display: block; font-size: 13px; color: var(--ink-dim); margin-bottom: 6px; }
.admin-panel input[type="text"], .admin-panel input[type="password"], .admin-panel input[type="number"] {
  width: 100%; background: rgba(10, 8, 32, 0.55); border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 10px; padding: 11px 12px; color: var(--ink); font-size: 15px; outline: none; font-family: inherit;
}
.admin-panel input:focus { border-color: rgba(139,124,246,0.8); }
.admin-panel .row2 { display: flex; gap: 12px; }
.admin-panel .row2 .field { flex: 1; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 14px; }
.switch-row .lab { font-size: 14px; }
.switch-row .sub { font-size: 12px; color: var(--ink-faint); }
.switch { position: relative; width: 52px; height: 30px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: rgba(255,255,255,0.14); transition: 0.25s; cursor: pointer; }
.switch i::before { content: ""; position: absolute; width: 24px; height: 24px; border-radius: 50%; left: 3px; top: 3px; background: #fff; transition: 0.25s; }
.switch input:checked + i { background: var(--teal); }
.switch input:checked + i::before { transform: translateX(22px); }
.admin-msg { min-height: 20px; font-size: 13px; margin-top: 8px; color: var(--teal); }
.admin-msg.error { color: #f38ba8; }
.admin-qr { display: flex; gap: 16px; }
.admin-qr .qr-item img { max-width: 140px; }
.admin-actions-row { display: flex; gap: 12px; margin-top: 6px; }
.admin-actions-row .btn { padding: 12px; font-size: 15px; }
.admin-actions-row .btn.ghost { margin-top: 0; }

/* ---------- 通用 ---------- */
.hidden { display: none !important; }
.toast {
  position: fixed; left: 50%; bottom: 12vh; transform: translateX(-50%) translateY(16px);
  background: rgba(20, 16, 52, 0.95); border: 1px solid var(--card-line); color: var(--ink);
  padding: 10px 22px; border-radius: 99px; font-size: 14px; z-index: 99;
  opacity: 0; transition: all 0.3s ease; pointer-events: none; max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- PC 悬停交互（仅支持 hover 的设备） ---------- */
@media (hover: hover) and (pointer: fine) {
  .test-card:hover { transform: translateY(-4px); border-color: rgba(139, 124, 246, 0.55);
    box-shadow: 0 22px 50px rgba(95, 139, 245, 0.28); }
  .test-card:hover .arrow { color: var(--teal); transform: translateX(4px); }
  .arrow { transition: all 0.25s ease; }
  .btn:hover:not([disabled]) { filter: brightness(1.1); box-shadow: 0 16px 36px rgba(95, 139, 245, 0.45); }
  .back-btn:hover { background: rgba(255, 255, 255, 0.12); }
  .copy-btn:hover { background: rgba(255, 255, 255, 0.16); color: var(--ink); }
}

/* ---------- 大屏适配 ---------- */
@media (min-width: 700px) {
  main { max-width: 480px; padding-top: 46px; }
  .brand h1 { font-size: 34px; }
}
