/* ============================================================
   The Old Oak · 16 Personality Test
   style.css — 苔纸浅色为主，深色跟随系统。

   设计约束（来自 docs/14_TheOldOak_界面设计方向.md）：
   · 全站零圆角、零卡片、零阴影、零渐变。只有直线和弧线。
   · 唯一强调色是苔绿。不引入第二色，粗细承担编码。
   · 字体只用系统无衬线，不引 web font。性格由图形承担。
   ============================================================ */

:root {
  --paper:    #F3F5F0;   /* 苔纸：极浅灰绿白，亮度 0.907。不是白，也不发灰 */
  --paper-2:  #EBEFE3;   /* 浮层 / 按下态 */
  --ink:      #1E231B;   /* 主文字 */
  --ink-2:    #4C5447;   /* 次级文字、选项 */
  --ink-3:    #68715F;   /* 说明、元信息（对 paper 约 4.5:1） */
  --line:     #DCE2D4;   /* 1px 分隔线与空轨道 */
  --moss:     #5A7444;   /* 唯一强调色（对 paper 5.05:1） */
  --moss-hi:  #3F5530;   /* 当前段 / 强调 */
  --ring-gap: #A3B094;   /* 未解锁的段（约 2.1:1，看得见但不抢） */
  --btn-bg:   #3F5530;
  --btn-fg:   #F6F7F2;
  --shade:    rgba(30, 35, 27, .05);
}

[data-theme="dark"] {
  --paper:    #191C17;
  --paper-2:  #222620;
  --ink:      #E9E5D9;
  --ink-2:    #B7BEAE;
  --ink-3:    #8B937F;
  --line:     #2C322A;
  --moss:     #9CB287;
  --moss-hi:  #C7D8B4;
  --ring-gap: #4C5445;
  --btn-bg:   #C7D8B4;
  --btn-fg:   #191C17;
  --shade:    rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

#app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.screen.on { display: flex; }

/* ============================================================
   1. 入口页
   ============================================================ */
.intro {
  height: 100%;
  padding: calc(18px + env(safe-area-inset-top)) 26px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.brand {
  font-size: 10px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex: 0 0 auto;
}

.intro-mid {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 46px;
}

.hero {
  width: 176px;
  height: 176px;
  display: block;
  margin: 0 auto 26px;
  object-fit: contain;
}

.intro h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.26;
  letter-spacing: -.022em;
  font-weight: 650;
}

.intro .sub {
  margin: 11px 0 0;
  font-size: 12.5px;
  letter-spacing: .01em;
  color: var(--ink-3);
}

.intro .why {
  margin: 17px 0 0;
  font-size: 13px;
  line-height: 1.62;
  color: var(--ink-2);
}

.btn {
  display: block;
  width: 100%;
  padding: 17px 0;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  text-align: center;
}

.btn:active { opacity: .86; }
.btn[disabled] { opacity: .5; }

.intro .foot { flex: 0 0 auto; }

.intro .note {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-3);
  text-align: center;
}

/* 续答 / 历史：行内一条，不用卡片 */
.strip {
  display: none;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  margin: 0 0 14px;
  background: var(--paper-2);
  font-size: 13px;
  color: var(--ink-2);
}

.strip.on { display: block; }
.strip b { color: var(--ink); font-weight: 600; }

/* ============================================================
   2. 答题
   ============================================================ */
.quiz {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
}

.qz-top {
  flex: 0 0 auto;
  padding: 10px 22px 0;
}

.qz-back {
  font-size: 21px;
  line-height: 1;
  color: var(--ink-3);
  padding: 6px 14px 6px 0;
  opacity: .75;
}

.qz-back[disabled] { opacity: 0; pointer-events: none; }

.qz-line {
  position: relative;
  height: 2px;
  background: var(--line);
  margin: 10px 0 0;
}

.qz-line i {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  width: 0;
  background: var(--moss);
  transition: width .28s cubic-bezier(.4, 0, .2, 1);
}

.qz-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  padding: 0 26px;
  overflow: hidden;
}

.qz-q {
  margin: 0;
  font-size: 25px;
  line-height: 1.42;
  letter-spacing: -.008em;
  font-weight: 500;
  color: var(--ink);
}

.qz-q.m { font-size: 22px; }
.qz-q.s { font-size: 19.5px; }

.qz-opts {
  flex: 0 0 auto;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.opt {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 19px 26px;
  font-size: 16.5px;
  line-height: 1.48;
  color: var(--ink-2);
  border-top: 1px solid var(--line);
  transition: color .12s linear;
}

.opt:last-child { border-bottom: 1px solid var(--line); }

.opt.sel {
  color: var(--ink);
  background: var(--paper-2);
}

.opt.sel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--moss);
}

/* ============================================================
   3. 付费墙
   ============================================================ */
.pay {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
}

.pay-in {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 26px 8px;
}

.pay-type {
  text-align: center;
  margin: 2px 0 0;
}

.pay-letters {
  font-size: 13px;
  letter-spacing: .34em;
  color: var(--ink-3);
  text-indent: .34em;
}

.pay-name {
  margin: 6px 0 0;
  font-size: 27px;
  line-height: 1.22;
  letter-spacing: -.02em;
  font-weight: 650;
}

.pay-line {
  margin: 9px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  text-align: center;
}

.dial-wrap { margin: 12px auto 0; }

.pay-h {
  margin: 16px 0 0;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -.014em;
  font-weight: 600;
}

.pay-sub {
  margin: 9px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.pay-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.pay-list li {
  position: relative;
  padding: 9px 0 9px 17px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
  border-top: 1px solid var(--line);
}

.pay-list li:last-child { border-bottom: 1px solid var(--line); }

.pay-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  width: 6px;
  height: 1px;
  background: var(--moss);
}

.pay-foot {
  flex: 0 0 auto;
  padding: 12px 26px calc(12px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.pay-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--ink-3);
}

.pay-price b { font-size: 15px; color: var(--ink); font-weight: 600; }

.msg {
  min-height: 15px;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-3);
  text-align: center;
}

/* ============================================================
   4. 报告
   ============================================================ */
.result {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(14px + env(safe-area-inset-top)) 0 calc(34px + env(safe-area-inset-bottom));
}

.res-pad { padding: 0 26px; }

.res-head { text-align: left; }

.res-letters {
  font-size: 12.5px;
  letter-spacing: .34em;
  color: var(--ink-3);
}

.res-name {
  margin: 7px 0 0;
  font-size: 31px;
  line-height: 1.16;
  letter-spacing: -.024em;
  font-weight: 650;
}

.res-line {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.58;
  color: var(--ink-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0 0;
}

.chip {
  padding: 5px 10px;
  background: var(--paper-2);
  font-size: 11.5px;
  letter-spacing: .01em;
  color: var(--ink-2);
  white-space: nowrap;
}

.sec {
  margin: 30px 0 0;
  padding: 0 26px;
}

.sec-t {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.sec-x {
  margin: 12px 0 0;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink-2);
}

/* ---------- 四维条 ---------- */
.bar-row { padding: 15px 0 13px; border-bottom: 1px solid var(--line); }

.bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink-2);
}

.bar-head b { font-weight: 600; color: var(--ink); }

.bar-track {
  position: relative;
  height: 2px;
  background: var(--line);
  margin: 10px 0 8px;
}

.bar-fill {
  position: absolute;
  top: 0;
  height: 2px;
  background: var(--moss);
}

.bar-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-3);
}

.bar-foot .on { color: var(--ink); }

/* ---------- 24 子面 ---------- */
.facet {
  padding: 14px 0 13px;
  border-bottom: 1px solid var(--line);
}

.facet-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.facet-n {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.005em;
}

.facet-t {
  font-size: 10.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  flex: 0 0 auto;
}

.facet-t.hi,
.facet-t.lo { color: var(--moss); }

.facet-x {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}

.dim-h {
  margin: 24px 0 0;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- 刻度盘 ---------- */
.dial {
  display: block;
  width: 268px;
  height: 268px;
  margin: 0 auto;
  touch-action: manipulation;
}

.dial.sm { width: 208px; height: 208px; }

.dial .hit { cursor: pointer; }

.dial-center {
  text-align: center;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: .04em;
}

/* 点中某段后展开的面 */
.facet-open {
  display: none;
  margin: 16px 0 0;
  padding: 15px 0 0;
  border-top: 1px solid var(--line);
}

.facet-open.on { display: block; }

.fo-t {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.fo-n { font-size: 15.5px; font-weight: 600; letter-spacing: -.005em; }

.fo-meta {
  font-size: 10.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.fo-x {
  margin: 9px 0 0;
  font-size: 14px;
  line-height: 1.62;
  color: var(--ink-2);
}

.fo-ask {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  font-style: italic;
}

/* ---------- 提示条 ---------- */
.alert {
  display: none;
  margin: 22px 0 0;
  padding: 12px 14px;
  background: var(--paper-2);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.alert.on { display: block; }

/* ---------- 列表 ---------- */
.olist {
  margin: 12px 0 0;
  padding: 0 0 0 20px;
  font-size: 14px;
  line-height: 1.62;
  color: var(--ink-2);
}

.olist li { margin: 7px 0 0; }

.blk { margin: 22px 0 0; }

.blk-t {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.blk-x {
  margin: 8px 0 0;
  font-size: 14.5px;
  line-height: 1.64;
  color: var(--ink-2);
}

.pull {
  margin: 26px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--moss);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -.01em;
  color: var(--ink);
}

.share-row {
  display: flex;
  gap: 10px;
  margin: 30px 0 0;
}

.share-row .btn { flex: 1 1 0; }

.btn.ghost {
  background: none;
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.res-note {
  margin: 18px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-3);
  text-align: center;
}

/* 隐藏但保留给屏幕阅读器 */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
