/* ============================================================
   pyramid.hengshiou.com — editorial / warm / calm
   mobile-first：375 / 390 / 430 為主要視口
   ============================================================ */

:root {
  --paper: #f6f1e7;
  --paper-deep: #efe7d8;
  --ink: #2a241b;
  --ink-soft: #5c5344;
  --ink-faint: #6f6656;
  --hairline: #d8cdb8;
  --card: #fffdf8;
  --accent: #b0512a;          /* terracotta */
  --accent-ink: #8f3f1f;

  /* 五層各自的情緒色（沉穩、不螢光） */
  --c-l1: #a8742c;   /* 懷疑・赭黃 */
  --c-l2: #b0512a;   /* 荒謬・陶紅 */
  --c-l3: #5d6b74;   /* 迷霧與煩躁・霧藍灰 */
  --c-l4: #8c3a34;   /* 失控・深磚紅 */
  --c-l5: #4a5d4b;   /* 克制與承擔・墨綠 */

  --serif: "Songti TC", "Noto Serif TC", "Source Han Serif TC", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 32px 22px 56px;
}

/* ---------- 通用文字 ---------- */
.kicker {
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.q-title {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.35;
  font-weight: 700;
  margin-bottom: 12px;
}

.q-help { color: var(--ink-soft); margin-bottom: 24px; }

.fine {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 14px;
  line-height: 1.6;
}

/* ---------- 按鈕 ---------- */
.btn {
  font-family: var(--sans);
  font-size: 17px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-block { width: 100%; }
.btn-small { font-size: 15px; padding: 10px 20px; }
.btn:disabled { opacity: .38; cursor: not-allowed; }

.cta-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 26px 0 6px;
}

/* ---------- HOME ---------- */
#screen-home .wrap { padding-top: 28px; text-align: center; }
#screen-home .cta-stack { margin-top: 16px; }

.hero-title {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero-sub {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--accent-ink);
  margin-top: 8px;
}

.hero-copy { color: var(--ink-soft); margin-top: 6px; }

.hero-note {
  font-size: 13.5px;
  color: var(--ink-faint);
  border-top: 1px solid var(--hairline);
  margin-top: 26px;
  padding-top: 14px;
  line-height: 1.7;
}
.hero-note strong { color: var(--ink-soft); }

/* 首頁 hero 插畫 */
.hero-art {
  display: block;
  width: min(60vw, 272px);
  height: auto;
  margin: 6px auto 2px;
}

.resume-card {
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 18px;
  text-align: left;
}
.resume-card p { font-size: 15px; color: var(--ink-soft); margin-bottom: 12px; }

/* ---------- WORK INPUT ---------- */
.work-input {
  width: 100%;
  font-family: var(--sans);
  font-size: 19px;
  padding: 15px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  margin-bottom: 14px;
}
.work-input:focus { outline: 2.5px solid var(--accent); outline-offset: 1px; }
.work-input:disabled { border-color: var(--hairline); background: var(--paper-deep); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  font-size: 14.5px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
}
.chip:active { background: var(--paper-deep); }

/* ---------- JOURNEY BAR ---------- */
.journey-bar[hidden] { display: none; }
.journey-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(246, 241, 231, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hairline);
}
.jb-back {
  border: none;
  background: none;
  font-size: 20px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 10px 14px;
}
.jb-mid { flex: 1; min-width: 0; }
.jb-work {
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jb-step { font-size: 14.5px; font-weight: 600; }
.jb-dots { display: flex; gap: 5px; align-items: flex-end; }
.jb-dot {
  width: 9px; height: 9px;
  border-radius: 2px;
  background: var(--hairline);
}
.jb-dot.done { background: var(--ink-faint); }
.jb-dot.now { background: var(--accent); transform: scale(1.25); }

/* ---------- LAYER SCREEN ---------- */
.layer-head { margin-bottom: 22px; }
.emotion-tag {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--lv-accent, var(--accent));
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 14px;
}
.layer-no {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.layer-name {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.3;
  font-weight: 700;
}
.layer-story-title {
  font-size: 16px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.hook {
  border-left: 3px solid var(--lv-accent, var(--accent));
  padding: 4px 0 4px 16px;
  margin: 24px 0;
}
.hook-lead { color: var(--ink-soft); }
.hook-punch {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.55;
  font-weight: 700;
  margin-top: 8px;
}
.hook-after { margin-top: 14px; color: var(--ink-soft); font-size: 15.5px; }

/* 證據圖：像證物，不像裝飾 */
.evidence {
  margin: 26px 0;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 1px 0 rgba(42,36,27,.06), 0 6px 18px -12px rgba(42,36,27,.35);
}
.evidence img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
  border-radius: 2px;
  background: #fff;
}
.evidence figcaption {
  padding: 10px 4px 4px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.ev-tag {
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--ink-faint);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 1px 7px;
  margin-right: 8px;
  vertical-align: 1px;
}

.thesis {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.6;
  font-weight: 700;
  text-align: center;
  padding: 26px 8px;
  margin: 28px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.sec-label {
  font-size: 13px;
  letter-spacing: .16em;
  color: var(--ink-faint);
  margin: 26px 0 12px;
}

.methods { display: flex; flex-direction: column; gap: 10px; }
.method {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.method-no {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--lv-accent, var(--accent));
  flex-shrink: 0;
}
.method-name { font-weight: 700; margin-right: 6px; }
.method-desc { font-size: 15px; color: var(--ink-soft); display: block; margin-top: 2px; }

/* 診斷 */
.diag {
  margin-top: 30px;
  background: var(--paper-deep);
  border-radius: 14px;
  padding: 20px 18px;
}
.diag-q {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  font-weight: 700;
  margin-bottom: 6px;
}
.diag-hint { font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; }
.diag-opts { display: flex; flex-direction: column; gap: 9px; }
.diag-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1.5px solid var(--hairline);
  border-radius: 11px;
  padding: 13px 16px;
  font-size: 16.5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.diag-opt .ring {
  width: 18px; height: 18px;
  border: 2px solid var(--ink-faint);
  border-radius: 50%;
  flex-shrink: 0;
}
.diag-opt.sel {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.diag-opt.sel .ring { border-color: var(--paper); background: var(--paper); }

.layer-next { margin-top: 22px; }

/* 單頁問卷 */
.quiz-change { margin-left: 8px; font-size: 14px; color: var(--ink-soft); }
.q-block { margin-top: 36px; }
.q-layer-name {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.35;
  font-weight: 700;
}
.q-block .diag { margin-top: 12px; }
.q-block .readings { margin-top: 12px; }
.quiz-submit { margin-top: 36px; }

.cliff {
  font-size: 15px;
  color: var(--ink-soft);
  font-style: normal;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--hairline);
}
.cliff::before { content: "下一層的懸念　"; font-size: 12px; letter-spacing: .12em; color: var(--ink-faint); display: block; margin-bottom: 4px; }

/* 延伸閱讀 */
.readings { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.reading {
  font-size: 13.5px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--ink-soft);
  text-decoration: none;
  background: var(--card);
}
.reading.stub { color: var(--ink-faint); }
.reading.stub em { font-style: normal; font-size: 11.5px; margin-left: 5px; color: var(--ink-faint); }

/* ---------- RESULT ---------- */
.result-lede { color: var(--ink-soft); margin-bottom: 8px; }
.result-work {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 22px;
}
.result-level {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  text-align: center;
  padding: 30px 20px 26px;
  margin-bottom: 10px;
}
.result-level .rl-no {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.result-level .rl-name {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.35;
}
.result-note { font-size: 13.5px; color: var(--ink-faint); text-align: center; margin-bottom: 26px; line-height: 1.7; }

.rp-art {
  position: relative;
  width: min(82vw, 330px);
  margin: 26px auto;
}
.rp-art img { width: 100%; height: auto; display: block; }

.next-step {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 24px 6px;
  margin: 26px 0;
}
.next-step .ns-label { font-size: 13px; letter-spacing: .16em; color: var(--ink-faint); margin-bottom: 10px; }
.next-step .ns-sentence {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.65;
  font-weight: 700;
}

/* ---------- 30-DAY ACTION ---------- */
.action-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 26px 20px;
  box-shadow: 0 1px 0 rgba(42,36,27,.06), 0 8px 22px -14px rgba(42,36,27,.4);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 2.15;
}
.inline-input {
  font-family: var(--serif);
  font-size: 19px;
  border: none;
  border-bottom: 1.5px solid var(--ink);
  background: transparent;
  color: var(--accent-ink);
  width: 9em;
  padding: 0 4px 2px;
  text-align: center;
}
.inline-input-wide { width: 13em; max-width: 100%; }
.inline-input:focus { outline: none; border-bottom-color: var(--accent); }
.inline-select {
  font-family: var(--serif);
  font-size: 19px;
  border: none;
  border-bottom: 1.5px solid var(--ink);
  background: transparent;
  color: var(--accent-ink);
  padding: 0 2px 2px;
  appearance: none;
  text-align: center;
  width: 2.4em;
}

/* ---------- RESOURCES ---------- */
.res-list { list-style: none; margin: 18px 0 24px; }
.res-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--hairline);
  font-size: 17px;
}
.res-icon { color: var(--accent); font-size: 15px; }

.signup-box {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 20px 18px;
  background: var(--card);
  position: relative;
}
.signup-done {
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 24px 20px;
  background: var(--card);
  text-align: center;
}
.done-title { font-family: var(--serif); font-size: 21px; font-weight: 700; margin-bottom: 8px; }
.done-copy { font-size: 15px; color: var(--ink-soft); line-height: 1.8; }
.done-copy a { color: var(--accent-ink); }

/* ---------- ABOUT ---------- */
.about-p { margin-bottom: 16px; color: var(--ink-soft); }
.about-p:first-of-type { color: var(--ink); }

.about-links { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.about-links a {
  font-size: 13.5px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--ink-soft);
  text-decoration: none;
  background: var(--card);
}

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 26px 22px calc(30px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.9;
}
.foot-nav { margin-bottom: 6px; }
.foot-nav a { color: var(--ink-soft); text-decoration: none; margin: 0 8px; display: inline-block; padding: 8px 6px; }
.foot-nav span { color: var(--hairline); }
.foot-link { margin-bottom: 4px; }
.foot-link a { color: var(--ink-soft); }
.foot-note { margin-top: 2px; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-size: 14.5px;
  padding: 10px 20px;
  border-radius: 999px;
  z-index: 50;
  max-width: 86vw;
  text-align: center;
}

/* ---------- screen 切換 ---------- */
.screen[hidden] { display: none; }
.screen { animation: fadeUp .28s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
}

/* ---------- Desktop ---------- */
@media (min-width: 700px) {
  body { font-size: 18px; }
  .wrap { padding-top: 48px; }
  .hero-title { font-size: 52px; }
  .layer-name { font-size: 38px; }
  .cta-stack { flex-direction: row; justify-content: center; }
  #screen-work .cta-stack, .layer-next.cta-stack { flex-direction: column; }
}
