/* =========================================================================
 *  theme.css —— 主题样式（在 Pico CSS 2.1.1 之上覆盖）
 *
 *  想换风格时跟我说一句话就行，比如「换成暖色」「更活泼一点」，
 *  我只需要改下面这一段 :root 里的颜色变量。
 * ========================================================================= */

:root {
  /* ---------- 主题色：安静 / 克制 / 暖米白（按《网页制作任务指令》视觉规范） ---------- */
  --bg:            #FAF8F4;   /* 页面背景：暖米白 */
  --card:          #FFFFFF;   /* 卡片背景：纯白 */
  --ink:           #2C2C2A;   /* 正文：深色 */
  --ink-soft:      #6B6A65;   /* 次要文字 */
  --ink-faint:     #A09E97;   /* 弱化文字 */
  --line:          #ECE8E0;   /* 分隔线 / 描边 */

  --brand:         #2F5D50;   /* 主按钮：深墨绿 */
  --brand-dark:    #254A40;   /* 按钮按下 */
  --brand-soft:    #EDF2EF;   /* 浅墨绿底 */
  --brand-ring:    rgba(47, 93, 80, .22);
  --warn:          #D97742;   /* 卡点/断点高亮：暖橘 */

  --radius:        16px;
  --radius-sm:     12px;
  --shadow:        0 1px 2px rgba(44, 44, 42, .04), 0 8px 28px rgba(44, 44, 42, .06);

  /* ---------- 覆盖 Pico 变量 ---------- */
  --pico-font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
                      "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
                      "Noto Sans CJK SC", sans-serif;
  --pico-font-size: 17px;
  --pico-line-height: 1.75;
  --pico-background-color: var(--bg);
  --pico-color: var(--ink);
  --pico-text-color: var(--ink);
  --pico-muted-color: var(--ink-soft);
  --pico-muted-border-color: var(--line);
  --pico-border-radius: var(--radius-sm);
  --pico-card-background-color: var(--card);
  --pico-card-border-color: var(--line);
  --pico-card-box-shadow: none;
  --pico-primary: var(--brand);
  --pico-primary-hover: var(--brand-dark);
  --pico-primary-focus: var(--brand-ring);
  --pico-primary-inverse: #FFFFFF;
  --pico-block-spacing-vertical: 1.1rem;
  --pico-typography-spacing-vertical: .9rem;
  --pico-form-element-background-color: #FFFFFF;
  --pico-form-element-border-color: var(--line);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.75;
  overflow-wrap: break-word;
  word-break: normal;
}

.hidden { display: none !important; }

.shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------------- 顶栏 / 页脚 ---------------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
}
.header-logo { width: 28px; height: 28px; display: block; border-radius: 7px; }
.header-brand { font-size: 15px; font-weight: 600; letter-spacing: .2px; }

.site-footer {
  margin-top: 32px;
  padding: 22px 0 34px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}
.site-footer p { margin: 0; }

/* ---------------- 示例提醒条 ---------------- */
.sample-banner {
  margin: 14px 0 0;
  padding: 10px 14px;
  background: #FFF8E6;
  border: 1px solid #F2E3B8;
  border-radius: var(--radius-sm);
  color: #8A6A16;
  font-size: 13.5px;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.sample-dot {
  flex: 0 0 auto;
  width: 7px; height: 7px;
  margin-top: 8px;
  border-radius: 50%;
  background: #E0A300;
}

/* ---------------- 卡片 ---------------- */
.screen { padding-top: 18px; padding-bottom: 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px 24px;
  margin-top: 16px;
}

/* ---------------- 开场屏 ---------------- */
.intro-top { text-align: center; }
.eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
}
.intro-title {
  margin: 14px 0 8px;
  font-size: 26px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: -.2px;
}
.intro-subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15.5px;
}
.intro-text {
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.85;
  text-align: left;
  white-space: pre-line;   /* 让内容里的换行原样显示 */
}
.meta-list {
  list-style: none;
  margin: 20px 0 24px;
  padding: 14px 16px;
  background: #FBFAF6;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 22px;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.meta-list li { display: flex; align-items: center; gap: 7px; }
.meta-list { flex-wrap: wrap; }
.meta-ico { color: var(--brand); font-size: 15px; }

/* 适合谁来测 */
.audience {
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px dashed #DDD7CA;
  border-radius: var(--radius-sm);
  background: #FBFAF6;
}
.audience-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: .6px;
  margin-bottom: 6px;
}
.audience-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* ---------------- 按钮 ---------------- */
.btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 13px 20px;
  font-size: 16.5px;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .06s ease, box-shadow .15s ease;
  text-align: center;
  min-height: 50px;
}
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 2px; }

.btn-block { display: block; width: 100%; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  background: #C8CCC5;
  border-color: #C8CCC5;
  color: #fff;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: #D6D0C2; background: #FBFAF6; }

.btn-ghost {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-color: transparent;
  margin-top: 10px;
}
.btn-ghost:hover { background: #E2EAE5; }

.link-btn {
  background: none;
  border: none;
  padding: 4px 2px;
  color: var(--ink-faint);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
}
.link-btn:hover { color: var(--brand); }

/* ---------------- 答题屏 ---------------- */
.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}
.progress-label { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }

.progress-track {
  height: 6px;
  background: #F0EDE5;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--brand);
  border-radius: 999px;
  transition: width .28s ease;
}

.q-title {
  margin: 22px 0 18px;
  font-size: 20px;
  line-height: 1.6;
  font-weight: 700;
}

.options { display: flex; flex-direction: column; gap: 11px; }

.opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 15px 16px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  transition: border-color .15s ease, background-color .15s ease;
}
.opt:hover { border-color: #CFC8B9; background: #FBFAF6; }
.opt[aria-checked="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.opt-mark {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  margin-top: 4px;
  border-radius: 50%;
  border: 1.5px solid #CFC9BC;
  background: #fff;
  position: relative;
  transition: border-color .15s ease;
}
.opt[aria-checked="true"] .opt-mark { border-color: var(--brand); }
.opt[aria-checked="true"] .opt-mark::after {
  content: "";
  position: absolute;
  inset: 3.5px;
  border-radius: 50%;
  background: var(--brand);
}
.opt-body { flex: 1 1 auto; min-width: 0; }
.opt-desc {
  display: block;
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.quiz-nav {
  display: flex;
  gap: 11px;
  margin-top: 24px;
}
.quiz-nav .btn { flex: 1 1 0; }
.quiz-nav .btn-secondary { flex: 0 0 108px; }

.hint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-faint);
  min-height: 20px;
}

/* ---------------- 结果屏 ---------------- */
.result-card { padding: 30px 22px 24px; text-align: center; }

.result-badge {
  display: inline-block;
  padding: 4px 13px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 1px;
}
.result-name {
  margin: 14px 0 8px;
  font-size: 27px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -.3px;
}
.result-tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.score-strip {
  margin: 22px 0 6px;
  padding: 14px 16px;
  background: #FBFAF6;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.score-strip b { color: var(--brand-dark); font-size: 18px; font-weight: 700; }

/* ---------------- 消化管道图 ---------------- */
.pipe-wrap {
  margin: 24px 0 0;
  padding: 20px 12px 14px;
  background: #FBFAF6;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.pipe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 2px;
}
.pipe-seg,
.pipe-gap { position: relative; line-height: 1; }

.pipe-seg {
  padding: 5px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pipe-gap { color: #C6C0B2; font-size: 11px; padding: 0 1px; }

.pipe-seg.pipe-done {
  background: #E3EDE7;
  border-color: #C2D4C9;
  color: var(--brand-dark);
}
.pipe-seg.pipe-todo {
  color: var(--ink-faint);
  border-style: dashed;
}
.pipe-seg.pipe-stuck,
.pipe-gap.pipe-stuck {
  color: var(--warn);
  border-color: var(--warn);
  background: #FDF3EA;
}
.pipe-gap.pipe-stuck {
  border: none;
  font-weight: 700;
  font-size: 13px;
  background: none;
}
.pipe-stuck::after {
  content: "▼";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  font-size: 9px;
  line-height: 1;
  color: var(--warn);
}
.pipe-note {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--warn);
  letter-spacing: .5px;
}

/* ---------------- 你卡在 ---------------- */
.stuck-box {
  margin-top: 22px;
  padding: 16px 18px;
  background: #FFFBF3;
  border: 1px solid #F3E2C4;
  border-radius: var(--radius-sm);
  text-align: left;
}
.stuck-head {
  font-size: 12.5px;
  font-weight: 700;
  color: #9A7326;
  letter-spacing: .8px;
  margin-bottom: 6px;
}
.stuck-label {
  font-size: 19px;
  font-weight: 700;
  color: #6F5316;
  line-height: 1.5;
}
.stuck-desc {
  margin: 8px 0 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: #7A6529;
}

/* ---------------- 带走一句 ---------------- */
.takeaway {
  margin-top: 26px;
  padding: 18px 18px 16px;
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  text-align: left;
}
.takeaway-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: .8px;
  margin-bottom: 8px;
}
.takeaway-text {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.8;
  font-weight: 600;
  color: var(--ink);
}

/* ---------------- 影子类型 ---------------- */
.shadow-box {
  margin-top: 18px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: left;
}
.shadow-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-faint);
  letter-spacing: .8px;
  margin-bottom: 6px;
}
.shadow-text { margin: 0; font-size: 15px; line-height: 1.8; color: var(--ink-soft); }

.result-section { text-align: left; margin-top: 26px; }
.sec-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sec-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--brand);
  display: block;
}
.result-section p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
}
.result-section p:last-child { margin-bottom: 0; }

.action-list { list-style: none; margin: 0; padding: 0; }
.action-list li {
  list-style: none;
  position: relative;
  padding: 0 0 0 26px;
  margin-bottom: 11px;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ink);
}
.action-list li::marker { content: none; }
.action-list li:last-child { margin-bottom: 0; }
.action-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand);
}
.result-card #btnPoster { margin-top: 30px; }

.result-foot { margin: 16px 0 0; }
.result-foot .hint { margin-top: 12px; }

/* ---------------- 后续引导 ---------------- */
.followup {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
  text-align: left;
}
.fu-desc { font-size: 15px; color: var(--ink-soft); margin: 0 0 14px; white-space: pre-line; }

.fu-secondary {
  width: 100%;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.fu-sec-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.fu-sec-item { margin-bottom: 14px; }
.fu-sec-label { margin: 0 0 9px; font-size: 14.5px; line-height: 1.7; color: var(--ink-soft); }
.btn-sm { display: inline-block; padding: 8px 16px; min-height: 40px; font-size: 14.5px; }
.fu-body { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.fu-row { font-size: 15px; }
.fu-row b { color: var(--brand-dark); }
.fu-qr { width: 132px; height: 132px; border-radius: 10px; background: #fff; padding: 6px; border: 1px solid var(--line); }
.fu-qr-cap { font-size: 13px; color: var(--ink-faint); text-align: center; }
.fu-wechat {
  margin: 4px 0 0;
  font-size: 16px;
  color: var(--ink);
  text-align: center;
  letter-spacing: .3px;
}
.fu-wechat b { color: var(--brand-dark); font-size: 18px; letter-spacing: .5px; }
.fu-wechat-note { display: block; margin-top: 3px; font-size: 13px; color: var(--ink-faint); }

/* 可点击复制的微信号整块 */
.fu-wechat-btn {
  width: 100%;
  background: #FFFDF8;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.fu-wechat-btn:hover { border-color: #E0DACB; background: #FFFCF4; }
.fu-wechat-btn:active { background: #FBF6EA; }
.fu-copy-tip {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--brand);
  opacity: .8;
}

/* 引导区补充说明（如「微信号 xxx，备注 yyy」） */
.fu-sec-note {
  margin: 0 0 10px;
  padding: 9px 12px;
  background: #FFFDF8;
  border: 1px dashed #E4DCC8;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

/* ---------------- 弹层 ---------------- */
.modal { position: fixed; inset: 0; z-index: 50; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(44, 44, 42, .48);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 92vh;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(44, 44, 42, .18);
  display: flex;
  flex-direction: column;
  animation: slideUp .24s cubic-bezier(.2, .8, .3, 1);
}
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

.modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  font-weight: 600;
}
.modal-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0 6px;
  font-family: inherit;
}
.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
}

.poster-loading { padding: 46px 0; text-align: center; }
.spinner {
  width: 34px; height: 34px;
  margin: 0 auto 16px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin: 0; color: var(--ink-soft); font-size: 15px; }

.poster-error { padding: 34px 0; text-align: center; }
.err-text { color: #B4543F; font-size: 15px; margin: 0 0 18px; }

.poster-preview-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 14px rgba(44, 44, 42, .12);
  line-height: 0;
}
.poster-img { width: 100%; height: auto; display: block; }
.save-tip {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-faint);
}
.poster-actions { display: flex; gap: 11px; margin-top: 16px; }
.poster-actions .btn { flex: 1 1 0; }

.copy-block {
  margin-top: 20px;
  padding: 15px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.copy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14.5px;
  font-weight: 600;
}
.copy-btn {
  background: var(--brand-soft);
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.copy-btn:hover { background: #E2EAE5; }
.copy-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
  background: #FBFAF6;
  resize: none;
}
.copy-tip { margin: 9px 0 0; font-size: 13px; color: #B4543F; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  z-index: 90;
  max-width: 86vw;
  padding: 11px 20px;
  background: rgba(44, 44, 42, .93);
  color: #fff;
  font-size: 14.5px;
  line-height: 1.6;
  white-space: pre-line;
  text-align: center;
  border-radius: 20px;
  box-shadow: 0 6px 22px rgba(44, 44, 42, .24);
  animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 二维码生成容器：藏在屏幕外但不 display:none，保证能渲染 */
.qr-holder {
  position: fixed;
  left: -10000px;
  top: -10000px;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ---------------- 手机适配 ---------------- */
@media (max-width: 400px) {
  .card { padding: 22px 17px 20px; }
  .intro-title { font-size: 23px; }
  .result-name { font-size: 24px; }
  .q-title { font-size: 18.5px; }
  .quiz-nav .btn-secondary { flex: 0 0 92px; }
  .meta-list { gap: 14px; font-size: 14px; }
}

@media (min-width: 640px) {
  .modal-panel {
    left: 50%;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 460px;
    max-height: 88vh;
    border-radius: 20px;
    animation: popIn .2s ease;
  }
  @keyframes popIn { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
  .modal-body { padding-bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------- 计算中过渡屏 ---------------- */
.calc-card { text-align: center; padding: 58px 22px; }
.calc-card .spinner { margin-bottom: 18px; }
.calc-text { margin: 0; color: var(--ink-soft); font-size: 16px; }
