/* White Crane · 16 Personality Test
 * style.css — 温暖纸感 + 陶土色，移动优先。
 * 浅色沿用 v12 的暖白纸；深色另配一套暖调，跟随 Telegram colorScheme。
 */

:root{
  --paper:#FDFCFA;
  --paper-2:#F8F4EC;
  --surface:#FFFFFF;
  --surface-2:#FFFDFB;
  --ink:#3D3833;
  --ink-2:#6E6357;
  --ink-3:#A2968A;
  --line:#E7DCCC;
  --line-2:#D3C5B2;
  --accent:#B95F3C;
  --accent-deep:#8E4526;
  --accent-soft:#FBEBE0;
  --accent-mid:#F3D3BF;
  --sage-soft:#EDF1E9;
  --sage-ink:#4C5C49;
  --sage-title:#5F7A5C;
  --warn-bg:#FFF7EE;
  --warn-line:#F0DFC9;
  --warn-ink:#7A5A3E;
  --serif:Georgia,"Times New Roman",serif;
  --sans:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

/* 深色：暖炭底，避免纯黑发冷 */
html[data-theme="dark"]{
  --paper:#14110E;
  --paper-2:#1B1713;
  --surface:#1E1A15;
  --surface-2:#221D18;
  --ink:#EFE7DC;
  --ink-2:#BCB0A1;
  --ink-3:#8B8175;
  --line:#322B23;
  --line-2:#463C31;
  --accent:#E0805A;
  --accent-deep:#F0A98A;
  --accent-soft:#2B1E16;
  --accent-mid:#4A3227;
  --sage-soft:#1B241A;
  --sage-ink:#B9C9B3;
  --sage-title:#93A98D;
  --warn-bg:#241C14;
  --warn-line:#43331F;
  --warn-ink:#DCC0A0;
}

.deco{
  position:fixed; width:20px; height:20px;
  bottom:calc(14px + env(safe-area-inset-bottom));
  color:var(--ink-3); pointer-events:none; opacity:.7; z-index:5;
}
.deco.l{ left:5px; }
.deco.r{ right:5px; }

/* 插画线稿统一跟随主题：表现属性优先级最低，这里直接用 CSS 覆盖 */
.art svg [stroke="#3D3833"]{ stroke:var(--ink); }
.art svg [stroke="#C9BCA9"]{ stroke:var(--ink-3); }
.art svg [stroke="#E7DCCC"]{ stroke:var(--line); }
.art svg [fill="#3D3833"]{ fill:var(--ink); }
.art svg [fill="#F6DAC6"]{ fill:var(--accent-mid); }
.art svg [fill="#F0B79A"]{ fill:var(--accent); }
.art svg [fill="#FDF1E4"]{ fill:var(--accent-soft); }
.art svg [fill="#FBEBE0"]{ fill:var(--accent-soft); }
.art svg [fill="#EDF1E9"]{ fill:var(--sage-soft); }
.art svg [fill="#F7F1E4"]{ fill:var(--paper-2); }

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

html, body{
  margin:0; padding:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--sans);
  -webkit-font-smoothing:antialiased;
  line-height:1.6;
}
body{ min-height:100vh; }

#app{
  max-width:460px;
  margin:0 auto;
  padding:0 22px calc(34px + env(safe-area-inset-bottom));
  min-height:100vh;
}

.screen{ display:none; position:relative; }
.screen.on{ display:block; animation:fade .22s ease both; }
@keyframes fade{ from{ opacity:0; transform:translateY(4px); } to{ opacity:1; transform:none; } }

.art{ text-align:center; }
.art-intro{ margin:4px 0 2px; }
.art-result{ margin:22px 0 2px; }

/* ---------- 品牌 ---------- */
.brand{
  display:flex; align-items:center; gap:7px;
  padding:22px 0 4px;
  font-size:11px; color:var(--ink-3);
}
.brand-line{ width:18px; height:1.5px; background:var(--accent); border-radius:2px; flex:0 0 auto; }
.brand-name{ letter-spacing:1.6px; color:var(--ink-2); font-weight:500; }
.brand-sep{ font-size:11px; color:var(--accent); opacity:.55; }
.brand-sub{ font-size:10px; letter-spacing:1.1px; color:var(--ink-3); opacity:.85; }

h1{
  font-size:30px; line-height:1.34; margin:14px 0 10px;
  font-weight:500; letter-spacing:-.2px; color:var(--ink);
}
h2{ font-weight:500; margin:0 0 8px; }
.sub{ font-size:13.5px; color:var(--ink-2); line-height:1.8; margin:0 0 20px; }

/* ---------- 按钮 ---------- */
.btn{
  display:block; width:100%;
  padding:16px;
  border:1.5px solid var(--accent);
  border-radius:16px;
  background:var(--accent-soft);
  color:var(--accent-deep);
  font-family:inherit; font-size:15.5px; font-weight:500; letter-spacing:.4px;
  cursor:pointer;
  transition:transform .12s ease, background .12s ease, opacity .12s ease;
}
.btn:active{ transform:translateY(1px); background:var(--accent-mid); }
.btn[disabled]{ opacity:.6; cursor:default; transform:none; }
.btn.ghost{ border-color:var(--line-2); background:var(--surface); color:var(--ink-2); }
.btn.ghost:active{ background:var(--paper-2); }
.btn.small{ padding:13px; font-size:14px; }

.link-btn{
  display:block; margin:10px auto 0; padding:6px 10px;
  background:none; border:0; font-family:inherit;
  font-size:12px; color:var(--ink-3); text-decoration:underline;
  cursor:pointer;
}

.disclaimer{
  font-size:11px; color:var(--ink-3); text-align:center;
  line-height:1.8; margin:26px 0 0;
}
.sign{ text-align:center; margin:36px 0 0; opacity:.6; }
.sign-txt{ font-size:10px; letter-spacing:1.8px; color:var(--ink-3); margin:0; }
.foot-hint{
  font-size:11.5px; color:var(--ink-3); text-align:center;
  margin:13px 0 0; line-height:1.7;
}

/* ---------- 入口页 ---------- */
.tags{ display:flex; flex-wrap:wrap; gap:8px; margin:0 0 24px; }
.tag{
  font-size:11px; color:var(--ink-2);
  border:1.5px solid var(--line-2); border-radius:999px;
  padding:6px 11px; line-height:1.25; background:transparent;
}
.tag b{ font-weight:600; color:var(--ink); margin-right:6px; letter-spacing:.3px; }

.hist{
  display:none; align-items:center; gap:12px;
  background:var(--surface); border:1.5px solid var(--line);
  border-radius:18px; padding:13px 16px; margin:0 0 16px;
  cursor:pointer;
}
.hist.on{ display:flex; }
.hist-letters{
  font-size:20px; letter-spacing:2px; color:var(--ink);
  font-family:var(--serif); line-height:1;
}
.hist-meta{ flex:1; min-width:0; }
.hist-name{ font-size:12.5px; color:var(--ink-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hist-time{ font-size:11px; color:var(--ink-3); margin-top:3px; }
.hist-view{ font-size:11.5px; color:var(--accent-deep); white-space:nowrap; }

.resume{
  display:none; align-items:center; justify-content:space-between; gap:12px;
  border:1.5px dashed var(--line-2);
  border-radius:14px; padding:12px 14px; margin:0 0 14px;
  font-size:12.5px; color:var(--ink-2); cursor:pointer;
}
.resume.on{ display:flex; }
.resume span:last-child{ color:var(--accent); white-space:nowrap; }

/* ---------- 答题页 ---------- */
.qtop{ padding:22px 0 10px; }
.q-index{ font-size:12px; color:var(--ink-3); letter-spacing:1.5px; font-variant-numeric:tabular-nums; }
.q-bar-wrap{ height:3px; background:var(--line); border-radius:2px; overflow:hidden; margin-bottom:30px; opacity:.85; }
.q-bar{ height:100%; width:0; background:var(--accent); border-radius:2px; transition:width .3s ease; }

.q-text{
  font-size:21px; line-height:1.55; font-weight:500;
  color:var(--ink); margin:0 0 22px; letter-spacing:-.1px;
  text-wrap:pretty;
}

.opt{
  display:flex; gap:12px; align-items:flex-start; width:100%;
  text-align:left;
  background:var(--surface-2); border:1.5px solid var(--line);
  border-radius:18px; padding:15px 16px; margin:0 0 11px;
  color:var(--ink);
}
.opt-mark{
  flex:0 0 24px; width:24px; height:24px; border-radius:50%;
  border:1.5px solid var(--line-2); color:var(--ink-2);
  font-size:11px; display:flex; align-items:center; justify-content:center;
  margin-top:2px;
}
.opt-text{ font-size:14.5px; line-height:1.65; color:var(--ink); opacity:.92; }

/* ---------- 五级梯度（竖排） ---------- */
.lv-hint{ font-size:12px; color:var(--ink-3); text-align:center; margin:22px 0 14px; }

.lv-col{ display:flex; flex-direction:column; gap:7px; }
.lv{
  position:relative; width:100%; height:48px; padding:0 34px;
  border-radius:12px; border:1.5px solid var(--line-2);
  background:var(--surface); color:var(--ink-2);
  font-family:inherit; font-size:14px; letter-spacing:.2px;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition:all .14s ease;
}
.lv span{ white-space:nowrap; }
.lv-dot{
  position:absolute; top:50%; transform:translateY(-50%);
  background:var(--accent); border-radius:2px; opacity:.9;
}
.lv[data-lv="A2"] .lv-dot{ left:12px; width:4px; height:22px; opacity:1; }
.lv[data-lv="A1"] .lv-dot{ left:12px; width:3px; height:15px; opacity:.5; }
.lv[data-lv="B1"] .lv-dot{ right:12px; width:3px; height:15px; opacity:.5; }
.lv[data-lv="B2"] .lv-dot{ right:12px; width:4px; height:22px; opacity:1; }
.lv[data-lv="N"] .lv-dot{
  left:12px; width:6px; height:6px;
  border-radius:50%; background:transparent;
  border:1.5px solid var(--ink-3); opacity:.55;
}
.lv[data-lv="N"]{ color:var(--ink-3); border-color:var(--line); }
.lv:active{ border-color:var(--accent); background:var(--accent-soft); color:var(--accent-deep); transform:translateY(-1px); }
.lv.sel{
  border-color:var(--accent); background:var(--accent-soft);
  color:var(--accent-deep); font-weight:500; transform:translateY(-1px);
}
.lv.sel .lv-dot{ background:var(--accent); opacity:1; border-color:var(--accent); }

.qnav{ display:flex; align-items:center; justify-content:space-between; margin-top:24px; }
.back{
  font-size:13px; color:var(--ink-3); background:none; border:0;
  font-family:inherit; padding:10px 0; cursor:pointer;
}
.back.off{ opacity:0; pointer-events:none; }
.auto-tip{ font-size:11.5px; color:var(--ink-3); }

/* ---------- 补充情境题 ---------- */
.extra-lead{
  font-size:12.5px; color:var(--ink-3); line-height:1.85;
  margin:-14px 0 22px; text-align:center;
}
.extra-row{ display:flex; gap:10px; }
.extra-btn{
  flex:1; height:48px; padding:0 6px;
  border-radius:12px; border:1.5px solid var(--line-2);
  background:var(--surface); color:var(--ink-2);
  font-family:inherit; font-size:13.5px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:all .14s ease;
}
.extra-btn:active{ border-color:var(--accent); background:var(--accent-soft); color:var(--accent-deep); transform:translateY(-1px); }

/* ---------- 付费墙 ---------- */
.pay-head{ text-align:center; padding:30px 0 4px; }
.pay-eyebrow{
  font-size:10.5px; letter-spacing:2.2px; color:var(--ink-3);
  text-transform:uppercase; margin-bottom:10px;
}
.pay-letters{
  font-size:62px; font-family:var(--serif); letter-spacing:8px;
  line-height:1; color:var(--ink); text-indent:8px;
}
.pay-name{
  margin-top:12px; font-size:19px; letter-spacing:1px;
  color:var(--accent-deep); filter:blur(5px); opacity:.8;
  user-select:none; pointer-events:none;
}
.pay-title{
  font-size:19px; font-weight:500; text-align:center;
  margin:18px 0 16px; color:var(--ink); letter-spacing:-.1px;
}
.pay-list{
  list-style:none; padding:0; margin:0 0 22px;
  border:1px solid var(--line); border-radius:16px;
  background:var(--surface); overflow:hidden;
}
.pay-list li{
  position:relative; padding:13px 16px 13px 40px;
  font-size:13.5px; color:var(--ink-2); line-height:1.55;
  border-bottom:1px solid var(--line);
}
.pay-list li:last-child{ border-bottom:0; }
.pay-list li::before{
  content:'✓'; position:absolute; left:15px; top:12px;
  width:16px; height:16px; line-height:16px; text-align:center;
  font-size:10px; color:var(--accent);
  border:1px solid var(--accent-mid); border-radius:50%;
  background:var(--accent-soft);
}

.pay-card{
  border:1.5px solid var(--accent-mid); border-radius:20px;
  background:var(--accent-soft); padding:20px 18px 16px; text-align:center;
}
.pay-price{
  font-size:30px; font-family:var(--serif); color:var(--accent-deep);
  line-height:1.1; letter-spacing:.5px;
}
.pay-price-note{ font-size:11.5px; color:var(--ink-3); margin:5px 0 16px; }
.pay-btn{ background:var(--accent); color:#FFF8F3; border-color:var(--accent); font-weight:600; }
.pay-btn:active{ background:var(--accent-deep); }
html[data-theme="dark"] .pay-btn{ color:#1A1310; }
.pay-sub{ font-size:11px; color:var(--ink-3); line-height:1.7; margin:11px 0 0; }
.pay-msg{
  font-size:12px; color:var(--accent-deep); line-height:1.7;
  margin:10px 0 0; min-height:0;
}
.pay-msg:empty{ display:none; }

/* ---------- 结果页 ---------- */
.res-head{ text-align:center; padding:18px 0 0; }
.res-letters{
  font-size:56px; font-weight:400; letter-spacing:8px; text-indent:8px;
  color:var(--ink); font-family:var(--serif); line-height:1;
}
.res-name{ font-size:17.5px; color:var(--accent-deep); margin-top:13px; letter-spacing:1.6px; }
.res-line{
  font-size:14px; color:var(--ink-2); line-height:1.85;
  margin:18px auto 22px; max-width:320px; text-align:center;
}

.traits{ display:flex; flex-wrap:wrap; gap:7px; justify-content:center; margin:0 0 28px; }
.trait{
  font-size:11.5px; color:var(--accent-deep);
  background:var(--accent-soft); border:1px solid var(--accent-mid);
  border-radius:999px; padding:6px 11px; line-height:1.2;
}

.bar-row{ margin-bottom:18px; }
.bar-head{
  display:flex; justify-content:space-between; align-items:baseline; gap:10px;
  font-size:12px; color:var(--ink-3); margin-bottom:8px;
}
.bar-pct{ font-size:13px; color:var(--ink); font-weight:500; white-space:nowrap; }
.bar-pct b{ color:var(--accent); font-weight:600; margin-right:6px; letter-spacing:1px; }
.bar-track{ position:relative; height:3px; background:var(--line); border-radius:2px; }
.bar-fill{ position:absolute; top:0; height:3px; background:var(--accent); border-radius:2px; }
.bar-foot{
  display:flex; justify-content:space-between; gap:10px;
  font-size:10.5px; color:var(--ink-3); margin-top:6px; opacity:.85;
}
.bar-foot .on{ color:var(--ink-2); font-weight:600; opacity:1; }

.flat{
  display:none; font-size:11.5px; color:var(--ink-3);
  line-height:1.8; margin:4px 0 0; text-align:center;
}
.flat.on{ display:block; }

.notes{ margin:26px 0 0; }
.note{
  font-size:13.5px; color:var(--ink-2); line-height:1.85;
  margin:0 0 14px; padding-left:14px;
  border-left:2px solid var(--accent-mid);
}
.note-t{
  display:block; font-size:10.5px; color:var(--ink-3);
  letter-spacing:1.6px; text-transform:uppercase; margin-bottom:4px;
}

.watch{
  margin-top:26px; background:var(--sage-soft);
  border-radius:16px; padding:15px 16px;
}
.watch-t{ font-size:10.5px; letter-spacing:1.6px; text-transform:uppercase; color:var(--sage-title); margin-bottom:9px; }
.watch-x{
  font-size:13px; color:var(--sage-ink); line-height:1.85;
  padding-left:12px; position:relative; margin-bottom:6px;
}
.watch-x:last-child{ margin-bottom:0; }
.watch-x::before{
  content:''; position:absolute; left:0; top:11px;
  width:4px; height:4px; border-radius:50%; background:var(--sage-title);
}

.blk{ display:none; margin-top:30px; }
.blk.on{ display:block; }
.blk-t{
  position:relative; padding-left:11px;
  font-size:10.5px; letter-spacing:1.6px; text-transform:uppercase;
  color:var(--ink-3); margin-bottom:9px;
}
.blk-t::before{
  content:''; position:absolute; left:0; top:50%;
  width:3px; height:3px; border-radius:50%;
  background:var(--accent); transform:translateY(-50%);
}
.blk-x{ font-size:13.5px; color:var(--ink); line-height:1.9; opacity:.9; }
.blk-list{ list-style:none; padding:0; margin:0; counter-reset:b; }
.blk-list li{
  counter-increment:b; position:relative;
  padding-left:27px; margin-bottom:11px;
  font-size:13.5px; color:var(--ink); line-height:1.85; opacity:.9;
}
.blk-list li:last-child{ margin-bottom:0; }
.blk-list li::before{
  content:counter(b); position:absolute; left:0; top:2px;
  width:18px; height:18px; border-radius:50%;
  border:1px solid var(--line-2); color:var(--ink-3);
  font-size:10px; line-height:16px; text-align:center;
}

.heart{
  display:none; margin-top:26px; padding:20px 18px;
  border-radius:16px; border:1px solid var(--line);
  background:var(--surface);
  font-size:13.5px; color:var(--accent-deep);
  line-height:1.95; letter-spacing:.1px;
}
.heart.on{ display:block; }

.alert{
  display:none; margin:0 0 20px; padding:13px 15px;
  border-radius:14px; background:var(--warn-bg);
  border:1px solid var(--warn-line);
  font-size:12.5px; color:var(--warn-ink); line-height:1.8;
}
.alert.on{ display:block; }
.alert b{ color:var(--accent-deep); font-weight:600; }

.card-wrap{ display:none; margin-top:26px; }
.card-wrap.on{ display:block; }
.card-wrap img{
  width:100%; display:block; border-radius:16px;
  border:1px solid var(--line);
  max-height:430px; object-fit:cover; object-position:top;
  background:var(--surface);
}
.card-wrap img.full{ max-height:none; object-fit:fill; }
.card-tip{ font-size:11.5px; color:var(--ink-3); text-align:center; margin:10px 0 0; }

.res-actions{ margin-top:28px; display:flex; flex-direction:column; gap:10px; }

/* ---------- 四维形状 ---------- */
.radar{ margin:26px 0 2px; text-align:center; }
.radar-t{
  font-size:10.5px; color:var(--ink-3); letter-spacing:1.8px;
  text-transform:uppercase; margin:0 0 6px;
}
.radar-svg{ width:196px; height:196px; display:block; margin:0 auto; }
.radar-svg text{ font-family:inherit; }
.radar-note{
  font-size:11.5px; color:var(--ink-3);
  line-height:1.75; margin:10px 0 0; text-align:left;
}

@media (max-width:359px){
  #app{ padding:0 18px calc(30px + env(safe-area-inset-bottom)); }
  h1{ font-size:26px; }
  .q-text{ font-size:19px; }
  .lv{ height:46px; font-size:13px; }
  .res-letters{ font-size:46px; letter-spacing:6px; }
  .pay-letters{ font-size:52px; letter-spacing:6px; }
}

@media (prefers-reduced-motion:reduce){
  .screen.on{ animation:none; }
  *{ transition:none !important; }
}
