/* ==========================================================================
   MBTI 人格测试 · 视觉语言 = The Pudding 编辑型数据叙事
   暖纸底 + 朱红强调 + Fraunces 衬线 × Space Mono 等宽，扁平实色数据条，无渐变
   ========================================================================== */
:root{
  --paper:#f4efe6;        /* 暖纸张底 */
  --ink:#1a1714;          /* 墨色 */
  --ink-soft:#6b6258;     /* 次级文字 */
  --rule:#cdc3b3;         /* 发丝线 */
  --vermilion:#e8503a;    /* The Pudding 朱红强调 */
  --vermilion-deep:#c33b27;
  --blue:#2b4a6f;         /* 第二数据色：墨蓝 */
  --gold:#c98a1e;         /* 第三数据色：芥末金 */
  --gold-deep:#a8740f;
  --teal:#3f7a6d;         /* 第四数据色：墨绿 */
  --track:#e3dccd;        /* 数据条底槽 */
}

*{ box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
html,body{ height:100%; }

body{
  background:var(--paper);
  color:var(--ink);
  font-family:"Noto Serif SC", serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

#app{
  max-width:460px;
  margin:0 auto;
  min-height:100dvh;
  position:relative;
  /* 桌面端两侧给纸面一点边界感 */
  box-shadow:0 0 0 1px rgba(26,23,20,.06);
}

/* ---------- 屏幕切换 ---------- */
.screen{ display:none; min-height:100dvh; flex-direction:column; }
.screen.active{ display:flex; animation:fade .45s ease; }
@keyframes fade{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }

.scribble{ display:inline-block; position:relative; }
.scribble::after{
  content:""; position:absolute; left:-2%; right:-2%; bottom:-.06em; height:.34em;
  background:var(--vermilion); opacity:.85; z-index:-1;
  border-radius:60% 40% 55% 45% / 60% 55% 45% 40%; transform:rotate(-.6deg);
}

/* ============================================================
   屏 1 · 首页
   ============================================================ */
.home{
  flex:1; display:flex; flex-direction:column;
  padding:calc(env(safe-area-inset-top) + 22px) 30px calc(env(safe-area-inset-bottom) + 26px);
}
.home__brand{
  display:flex; align-items:center; justify-content:space-between;
  padding-bottom:14px; border-bottom:1.5px solid var(--ink);
}
.home__brand-mark{ font-family:"Space Mono",monospace; font-weight:700; font-size:13px; letter-spacing:.06em; }
.home__brand-mark b{ color:var(--vermilion-deep); }
.home__issue{ font-family:"Space Mono",monospace; font-size:11px; color:var(--ink-soft); letter-spacing:.05em; }

.home__hero{ flex:1; display:flex; flex-direction:column; justify-content:center; padding:8px 0; }
.home__kicker{
  margin:0 0 22px; font-family:"Space Mono",monospace; font-size:11px;
  letter-spacing:.2em; text-transform:uppercase; color:var(--ink-soft);
  display:flex; align-items:center; gap:10px;
}
.home__kicker::before{ content:""; width:34px; height:1.5px; background:var(--ink); }
.home__h1{
  font-family:"Fraunces",serif; font-weight:600; font-size:clamp(54px,17vw,66px);
  line-height:.98; letter-spacing:-.025em; margin:0 0 26px; text-wrap:pretty;
}
.home__h1 .ln2{ display:block; }
.home__sub{
  font-family:"Noto Serif SC",serif; font-weight:400; font-size:17px; line-height:1.7;
  color:var(--ink-soft); margin:0; max-width:300px; text-wrap:pretty;
}
.home__sub em{ font-style:normal; color:var(--ink); font-weight:500; box-shadow:inset 0 -10px 0 rgba(232,80,58,.18); }

.home__preview{ margin:34px 0 0; display:flex; flex-direction:column; gap:9px; }
.home__preview-label{
  font-family:"Space Mono",monospace; font-size:10px; letter-spacing:.1em;
  text-transform:uppercase; color:var(--ink-soft); margin-bottom:2px;
}
.preview-bar{ display:flex; align-items:center; gap:12px; font-family:"Space Mono",monospace; font-size:11px; color:var(--ink-soft); }
.preview-bar__track{ flex:1; height:7px; background:#e0d8c9; position:relative; }
.preview-bar__fill{ position:absolute; top:0; left:0; bottom:0; }

.home__cta-wrap{ margin-top:34px; }
.btn-primary{
  width:100%; border:none; background:var(--vermilion); color:#fff;
  font-family:"Noto Serif SC",serif; font-weight:600; font-size:18px; letter-spacing:.04em;
  padding:18px 24px; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:12px;
  box-shadow:4px 4px 0 var(--ink); transition:transform .08s, box-shadow .08s;
}
.btn-primary:hover{ transform:translate(2px,2px); box-shadow:2px 2px 0 var(--ink); }
.btn-primary:active{ transform:translate(4px,4px); box-shadow:0 0 0 var(--ink); }
.btn-primary svg{ display:block; }
.home__foot{
  margin-top:18px; text-align:center; font-family:"Space Mono",monospace;
  font-size:11px; letter-spacing:.04em; color:var(--ink-soft);
}
.home__foot span{ white-space:nowrap; }
.home__foot .dot{ color:var(--vermilion); margin:0 6px; }

/* ============================================================
   屏 2 · 答题页
   ============================================================ */
.quiz{
  flex:1; display:flex; flex-direction:column;
  padding:calc(env(safe-area-inset-top) + 18px) 30px calc(env(safe-area-inset-bottom) + 34px);
}
.quiz__back{
  align-self:flex-start; border:none; background:none; cursor:pointer;
  font-family:"Space Mono",monospace; font-size:12px; letter-spacing:.04em;
  color:var(--ink-soft); padding:2px 0; margin-bottom:12px; transition:color .15s, opacity .15s;
}
.quiz__back:hover{ color:var(--vermilion-deep); }
.quiz__back[disabled]{ opacity:0; pointer-events:none; }

.quiz__top{ flex:0 0 auto; }
.quiz__progress-row{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:11px; }
.quiz__count{ font-family:"Space Mono",monospace; font-size:13px; font-weight:700; letter-spacing:.04em; }
.quiz__count .cur{ color:var(--vermilion-deep); font-size:20px; }
.quiz__count .tot{ color:var(--ink-soft); }
.quiz__pct{ font-family:"Space Mono",monospace; font-size:11px; letter-spacing:.1em; color:var(--ink-soft); text-transform:uppercase; }
.quiz__bar{ height:6px; background:#e0d8c9; position:relative; overflow:hidden; }
.quiz__bar-fill{ position:absolute; inset:0 auto 0 0; width:0; background:var(--ink); transition:width .35s ease; }
.quiz__bar-fill::after{ content:""; position:absolute; right:0; top:0; bottom:0; width:3px; background:var(--vermilion); }
.quiz__ticks{
  display:flex; justify-content:space-between; margin-top:7px;
  font-family:"Space Mono",monospace; font-size:9px; letter-spacing:.05em; color:#a89e8e;
}

.quiz__mid{ flex:1; display:flex; flex-direction:column; justify-content:center; padding:10px 0; }
.quiz__q-index{
  font-family:"Fraunces",serif; font-style:italic; font-weight:400; font-size:46px;
  color:var(--rule); line-height:1; margin-bottom:18px;
}
.quiz__q-index b{ color:var(--vermilion); font-style:normal; font-weight:600; }
.quiz__question{
  font-family:"Fraunces",serif; font-weight:500; font-size:clamp(27px,7.5vw,31px);
  line-height:1.28; letter-spacing:-.01em; margin:0; text-wrap:pretty;
}
.quiz__question.swap{ animation:qswap .35s ease; }
@keyframes qswap{ from{ opacity:0; transform:translateX(16px); } to{ opacity:1; transform:none; } }
.quiz__hint{
  margin-top:18px; font-family:"Space Mono",monospace; font-size:11px; letter-spacing:.06em;
  color:var(--ink-soft); display:flex; align-items:center; gap:8px;
}
.quiz__hint::before{ content:""; width:18px; height:1.5px; background:var(--rule); }

/* 7 级量表 */
.scale{ flex:0 0 auto; }
.scale__labels{
  display:flex; justify-content:space-between; margin-bottom:18px;
  font-family:"Noto Serif SC",serif; font-size:15px; font-weight:500;
}
.scale__labels .agree{ color:var(--teal); }
.scale__labels .disagree{ color:var(--blue); text-align:right; }
.scale__labels small{
  display:block; font-family:"Space Mono",monospace; font-size:9px; letter-spacing:.12em;
  text-transform:uppercase; font-weight:400; color:#a89e8e; margin-top:2px;
}
.scale__dots{ display:flex; align-items:center; justify-content:space-between; position:relative; padding:0 2px; }
.scale__line{ position:absolute; left:18px; right:18px; top:50%; height:1.5px; background:var(--rule); transform:translateY(-50%); z-index:0; }
.dot{
  position:relative; z-index:1; border-radius:50%; background:var(--paper);
  cursor:pointer; transition:transform .12s; flex:none;
}
.dot:hover{ transform:scale(1.08); }
.dot:active{ transform:scale(.92); }
/* 两端大、中间小 */
.dot.s1,.dot.s7{ width:52px; height:52px; }
.dot.s2,.dot.s6{ width:42px; height:42px; }
.dot.s3,.dot.s5{ width:32px; height:32px; }
.dot.s4{ width:24px; height:24px; }
.dot.s1{ border:2.5px solid var(--teal); }
.dot.s2{ border:2.5px solid #8fa39c; }
.dot.s3{ border:2px solid #b7b0a3; }
.dot.s4{ border:2px solid #c3bcae; }
.dot.s5{ border:2px solid #a8aab4; }
.dot.s6{ border:2.5px solid #7d8aa0; }
.dot.s7{ border:2.5px solid var(--blue); }

.dot.is-selected{ box-shadow:0 0 0 5px rgba(26,23,20,.08), 3px 3px 0 var(--ink); }
.dot.is-selected.agree{ background:var(--teal); border-color:var(--teal); }
.dot.is-selected.neutral{ background:var(--ink-soft); border-color:var(--ink-soft); }
.dot.is-selected.disagree{ background:var(--blue); border-color:var(--blue); }
.dot.is-selected::after{
  content:""; position:absolute; inset:0; margin:auto; width:13px; height:9px;
  border-left:2.6px solid #fff; border-bottom:2.6px solid #fff;
  transform:translateY(-1px) rotate(-45deg);
}
.dot.is-selected.s3::after,.dot.is-selected.s4::after,.dot.is-selected.s5::after{
  width:10px; height:7px; border-width:2.2px;
}

@media (max-width:380px){
  .dot.s1,.dot.s7{ width:46px; height:46px; }
  .dot.s2,.dot.s6{ width:38px; height:38px; }
  .dot.s3,.dot.s5{ width:29px; height:29px; }
  .dot.s4{ width:22px; height:22px; }
  .home,.quiz{ padding-left:24px; padding-right:24px; }
}

/* ============================================================
   屏 3 · 结果页
   ============================================================ */
.result{
  flex:1; display:flex; flex-direction:column;
  padding:calc(env(safe-area-inset-top) + 20px) 30px calc(env(safe-area-inset-bottom) + 26px);
}
.result__eyebrow{
  font-family:"Space Mono",monospace; font-size:11px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--ink-soft); margin:0 0 4px; display:flex; justify-content:space-between;
}
.result__type{
  font-family:"Fraunces",serif; font-weight:600; font-size:clamp(66px,21vw,80px);
  letter-spacing:.04em; line-height:.92; margin:2px 0; color:var(--ink);
}
.result__name{ font-family:"Noto Serif SC",serif; font-weight:600; font-size:22px; margin:6px 0 12px; display:inline-block; }
.result__tagline{
  font-family:"Fraunces",serif; font-style:italic; font-weight:400; font-size:16px; line-height:1.5;
  color:var(--ink-soft); margin:0 0 16px; padding-left:14px; border-left:2.5px solid var(--vermilion); text-wrap:pretty;
}
.result__divider{ height:1.5px; background:var(--ink); margin:2px 0 16px; }

/* 四维度数据条 */
.dims{ display:flex; flex-direction:column; gap:14px; margin-bottom:18px; }
.dim__head{
  display:flex; justify-content:space-between; align-items:baseline;
  font-family:"Space Mono",monospace; font-size:11px; letter-spacing:.04em; margin-bottom:5px;
}
.dim__poles{ color:var(--ink-soft); }
.dim__poles b{ color:var(--ink); }
.dim__val{ font-weight:700; }
.dim__bar{ height:13px; background:var(--track); position:relative; }
.dim__fill{ position:absolute; top:0; bottom:0; right:0; }
.dim__fill::before{ content:""; position:absolute; left:0; top:-3px; bottom:-3px; width:2.5px; background:var(--ink); }
.dim__fill.from-left{ left:0; right:auto; }
.dim__fill.from-left::before{ left:auto; right:0; }
.dim--ei .dim__fill{ background:var(--vermilion); } .dim--ei .dim__val{ color:var(--vermilion-deep); }
.dim--sn .dim__fill{ background:var(--blue); }      .dim--sn .dim__val{ color:var(--blue); }
.dim--tf .dim__fill{ background:var(--gold); }      .dim--tf .dim__val{ color:var(--gold-deep); }
.dim--jp .dim__fill{ background:var(--teal); }      .dim--jp .dim__val{ color:var(--teal); }

/* 解读 */
.result__read{
  font-family:"Noto Serif SC",serif; font-size:14.5px; line-height:1.72; color:var(--ink);
  margin:0 0 16px; padding-top:2px; text-wrap:pretty;
}

/* 优势 / 短板两栏 */
.traits{ display:grid; grid-template-columns:1fr 1fr; border:1.5px solid var(--ink); margin-bottom:18px; }
.traits__col{ padding:12px 13px; }
.traits__col + .traits__col{ border-left:1.5px solid var(--ink); }
.traits__title{
  font-family:"Space Mono",monospace; font-size:10px; letter-spacing:.12em; text-transform:uppercase;
  margin:0 0 9px; display:flex; align-items:center; gap:6px;
}
.traits__title.plus{ color:var(--teal); }
.traits__title.minus{ color:var(--vermilion-deep); }
.traits__title .sym{ font-family:"Fraunces",serif; font-weight:700; font-size:15px; }
.traits__list{ margin:0; padding:0; list-style:none; }
.traits__list li{
  font-family:"Noto Serif SC",serif; font-size:13.5px; line-height:1.45; color:var(--ink);
  padding:5px 0 5px 14px; position:relative; text-wrap:pretty;
}
.traits__list li::before{ content:""; position:absolute; left:0; top:.78em; width:5px; height:5px; }
.traits__col.plus-col li::before{ background:var(--teal); }
.traits__col.minus-col li::before{ background:var(--vermilion); transform:rotate(45deg); }

.result__actions{ margin-top:auto; display:flex; gap:12px; padding-top:8px; }
.btn-ghost,.btn-solid{
  flex:1; font-family:"Noto Serif SC",serif; font-weight:600; font-size:15px; padding:14px 10px;
  cursor:pointer; text-align:center; border:1.5px solid var(--ink); background:transparent; color:var(--ink);
  transition:transform .08s, box-shadow .08s, background .15s, color .15s;
}
.btn-solid{ background:var(--ink); color:var(--paper); box-shadow:3px 3px 0 var(--vermilion); }
.btn-ghost:hover{ background:var(--ink); color:var(--paper); }
.btn-solid:hover{ transform:translate(1.5px,1.5px); box-shadow:1.5px 1.5px 0 var(--vermilion); }

.result__foot{
  margin-top:16px; text-align:center; font-family:"Space Mono",monospace;
  font-size:10px; line-height:1.6; letter-spacing:.03em; color:#a89e8e; text-transform:none;
}

/* ============================================================
   桌面端专属布局（≥900px）
   首页左右分栏 · 答题聚焦居中放大 · 结果宽屏两列
   ============================================================ */
@media (min-width:900px){
  #app{ max-width:1080px; }

  /* —— 首页：左标题 hero + 右数据条预告 —— */
  .home{ padding:52px 72px 44px; }
  .home__hero{
    display:grid; grid-template-columns:1.05fr .95fr; gap:64px; align-items:center; padding:20px 0;
  }
  .home__lede{ display:flex; flex-direction:column; }
  .home__kicker{ margin-bottom:26px; }
  .home__h1{ font-size:clamp(72px,7.4vw,100px); margin-bottom:30px; }
  .home__sub{ font-size:19px; max-width:380px; }
  .home__preview{
    margin:0; align-self:center; width:100%;
    border-left:1.5px solid var(--rule); padding-left:32px;
  }
  .home__preview .preview-bar{ font-size:12px; gap:14px; }
  .home__preview-label{ font-size:11px; margin-bottom:6px; }
  .home__cta-wrap{ margin-top:38px; max-width:380px; margin-right:auto; }
  .home__foot{ text-align:left; }

  /* —— 答题页：居中聚焦、字号放大 —— */
  .quiz{ max-width:760px; margin:0 auto; width:100%; padding:36px 0 56px; }
  .quiz__question{ font-size:clamp(34px,3.4vw,42px); }
  .quiz__q-index{ font-size:58px; }
  .quiz__hint{ font-size:12px; }
  .scale__labels{ font-size:17px; max-width:560px; margin:0 auto 18px; width:100%; }
  .scale__dots{ max-width:560px; margin:0 auto; }
  .scale__line{ left:24px; right:24px; }
  .dot.s1,.dot.s7{ width:60px; height:60px; }
  .dot.s2,.dot.s6{ width:48px; height:48px; }
  .dot.s3,.dot.s5{ width:38px; height:38px; }
  .dot.s4{ width:28px; height:28px; }

  /* —— 结果页：宽屏两列 —— */
  .result{ padding:48px 72px 40px; max-width:980px; margin:0 auto; width:100%; }
  .result__type{ font-size:clamp(88px,9vw,108px); }
  .result__name{ font-size:26px; }
  .result__tagline{ font-size:18px; max-width:680px; }
  .result__grid{ display:grid; grid-template-columns:1.25fr 1fr; gap:46px; align-items:start; }
  .result__main{ display:flex; flex-direction:column; }
  .dims{ gap:16px; }
  .dim__bar{ height:15px; }
  .traits{ margin-bottom:0; }
  .result__read{ margin-bottom:0; margin-top:18px; font-size:15px; }
  .result__actions{ max-width:440px; margin-top:36px; }
}
