/* style.css — HTML V0.2
   视觉（V-01）：整体白色感 90% + 暖感 10%，低饱和暖橘仅用于 CTA/进度/当前选择/极少量强调。
   布局（F-01）：移动端三区（顶部状态 / 核心阅读 / 底部操作），核心居中偏上。
   外壳（F-02）：宽屏手机/小程序 Demo 框，移动端无框。
   分享（F-06）：结果页分享卡 Overlay。 */

:root {
  --bg: #fefdfb;              /* 主背景：白，极轻微暖 */
  --page-bg: #f1eee9;         /* 桌面外壳外侧背景（极浅暖灰） */
  --fg: #2b2a28;              /* 深灰文字 */
  --muted: #8b837a;           /* 灰 */
  --line: #eae4da;            /* 浅灰辅助线（轻微暖） */
  --accent: #b0642e;          /* 低饱和暖橘（CTA / 进度 / 当前选择） */
  --accent-strong: #975426;
  --accent-soft: #f8f0e7;
  --danger: #a33c2e;
  --warn-bg: #faf6ec;
  --warn-line: #d9b45f;
  --ok: #4f7a4f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ================= 设备外壳（F-02） ================= */
/* 移动端（默认）：小程序交互视觉框（顶部胶囊栏 + 内容区） */
.device {
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.device-top {
  display: flex;
  flex: 0 0 auto;
  height: 34px;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.device-capsule { width: 74px; height: 24px; border: 1px solid var(--line); border-radius: 12px; }
.device-screen { flex: 1 1 auto; }

/* 宽屏：手机/小程序 Demo 框 */
@media (min-width: 880px) {
  body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
  .device {
    width: 400px;
    height: min(88vh, 860px);
    min-height: 0;
    position: relative;
    border: 1px solid #e3ddd3;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(40, 35, 28, 0.08);
  }
  .device-top {
    display: flex;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 36px;
    align-items: center;
    justify-content: flex-end;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
  }
  .device-capsule { width: 74px; height: 24px; border: 1px solid var(--line); border-radius: 12px; }
  .device-screen {
    position: absolute;
    top: 36px; left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 内容容器：移动/平板居中限宽，桌面占满外壳 */
#app {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 880px) {
  #app { max-width: none; margin: 0; }
}

/* ================= 通用 ================= */
h1 { font-size: 26px; margin: 0 0 10px; line-height: 1.35; }
h2 { font-size: 18px; margin: 26px 0 10px; font-weight: 700; }
h3 { font-size: 15px; margin: 0 0 6px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--fg);
  border-radius: 9px;
  padding: 12px 18px;
  min-height: 46px;
  -webkit-tap-highlight-color: transparent;
}
button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: 0.35; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--accent-strong); color: #fff; }
button.secondary { background: #fff; border-color: var(--accent); color: var(--accent-strong); }
button.secondary:hover:not(:disabled) { background: var(--accent-soft); }
button.ghost { border: none; background: none; color: var(--muted); padding: 8px 6px; min-height: 40px; }

/* ================= 开始页 ================= */
.start-card { margin-top: 48px; }
.start-card .eyebrow { color: var(--accent); font-size: 13px; letter-spacing: 2px; margin-bottom: 8px; }
.start-card h1 { margin-bottom: 6px; }
.start-card .sub { color: var(--muted); font-size: 15px; margin: 0 0 22px; }
.formation {
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 14px;
  margin: 18px 0;
  color: #55504a;
  font-size: 14px;
}
.meta-line { color: var(--muted); font-size: 14px; margin: 6px 0; }
.boundary { color: var(--muted); font-size: 12px; margin-top: 22px; }

/* ================= V1.4.2 首页（完整封面 + 可见 CTA） ================= */
.home { padding-top: 0; }
.home-cover { position: relative; }
.home-cover img { width: 100%; height: auto; display: block; }
.home-cta { width: 100%; margin-top: 18px; font-size: 18px; font-weight: 700; padding: 18px 24px; min-height: 58px; }

/* ================= 用户承接页（6 场景选择，2列×3行） ================= */
.scene-select { padding-top: 12px; }
.scene-head { font-size: 24px; font-weight: 800; margin: 0 0 14px; line-height: 1.25; letter-spacing: 0.5px; }
.scene-head-brand { color: #c87878; }
.scene-head-hl { color: var(--accent); }
.scene-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scene-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  text-align: left;
  padding: 0;
  min-height: 0;
  -webkit-tap-highlight-color: transparent;
}
.scene-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.scene-img { position: relative; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; }
.scene-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-img .scene-ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.92); font-size: 12px; letter-spacing: 1px; font-weight: 600;
}
.scene-info {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
}
.scene-ic {
  display: inline-block;
  width: 22px; height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}

/* ================= 测试页（F-01 三区布局） ================= */
.test-screen { display: flex; flex-direction: column; min-height: 100dvh; }
@media (min-width: 880px) { .test-screen { min-height: 100%; } }

/* A 顶部状态区（约 10–15%） */
.test-top { flex: 0 0 auto; padding-top: 16px; }
.progress-num { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-track { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--accent); transition: width 0.2s ease; }

/* B 核心阅读与选择区（约 60–65%，居中偏上） */
.test-core { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; }
.test-core-inner { margin-bottom: 16vh; }
.q-zone { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.question-stem { font-size: 20px; font-weight: 650; line-height: 1.5; margin: 0 0 22px; }

.stances { margin: 0 0 22px; }
.stance { padding: 12px 14px; border-radius: 9px; font-size: 15px; line-height: 1.55; background: #fff; border: 1px solid var(--line); }
.stance-b { margin-top: 10px; }
.stance .stance-tag { display: block; font-size: 12px; color: var(--muted); letter-spacing: 1px; margin-bottom: 4px; }
@media (min-width: 560px) {
  .stances { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .stance-b { margin-top: 0; }
}

/* 5 档：手机横向保持 5 档，独立一行 */
.scale { display: flex; gap: 6px; }
.scale button {
  flex: 1;
  min-height: 54px;
  padding: 6px 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.scale button .k { font-weight: 700; color: var(--fg); font-size: 13px; }
.scale button.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.scale button.selected .k { color: var(--accent-strong); }
.scale-hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* C 底部操作区（约 20–25%） */
.test-bottom { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 14px 0 20px; }
.test-brand { font-size: 14px; font-weight: 800; letter-spacing: 3px; color: var(--fg); }
.test-brand-sub { font-weight: 400; font-size: 12px; letter-spacing: 1px; color: var(--muted); margin-left: 6px; }
.nav-arrow {
  flex: 0 0 auto;
  width: 48px; height: 48px; min-height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  color: var(--fg);
}
.nav-arrow:disabled { opacity: 0.3; }
.nav-arrow#btn-next:not(:disabled) { border-color: var(--accent); background: var(--accent); color: #fff; }
.countdown { flex: 1 1 auto; text-align: center; font-size: 13px; color: var(--muted); }

/* 自动跳转期间的锁定（防误触） */
.scale.locked { pointer-events: none; }
.scale.locked .scale-btn { opacity: 0.75; }

/* ================= 结果页 ================= */
.result-head { text-align: center; margin: 16px 0 6px; }
.type-code { font-size: 56px; font-weight: 800; letter-spacing: 3px; line-height: 1; margin: 0; }
.type-name { font-size: 26px; font-weight: 800; margin: 10px 0 4px; }
.type-core { color: #55504a; font-size: 16px; max-width: 520px; margin: 8px auto 0; line-height: 1.6; }

.keywords { margin: 14px 0 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.keyword { border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 13px; color: #55504a; background: #fff; }

.profile-block p { color: #4a463f; }

/* 结果页底部两个动作（F-06） */
.cta-row { display: flex; flex-direction: column; gap: 12px; margin: 22px 0 0; }
.cta-row button { width: 100%; }

.notice {
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 13px;
  color: #7c5a10;
  margin: 18px 0;
}

/* ================= 分享卡 Overlay（F-06） ================= */
.overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay-mask { position: absolute; inset: 0; background: rgba(32, 29, 25, 0.45); }
.overlay-panel { position: relative; width: 100%; max-width: 360px; max-height: 94vh; overflow-y: auto; padding: 8px; }
.overlay-close {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  min-height: 40px; padding: 6px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 13px;
}
.share-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 20px;
  text-align: center;
  margin-top: 40px;
}
.share-code { font-size: 44px; font-weight: 800; letter-spacing: 3px; line-height: 1; }
.share-name { font-size: 20px; font-weight: 800; margin-top: 6px; }
.share-visual {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  margin: 0 0 14px;
  background: #faf8f5;
  display: block;
}
.share-core { font-size: 14px; color: #55504a; line-height: 1.6; margin: 0 0 14px; }
.share-keywords { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.share-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.share-cta-text { font-size: 15px; font-weight: 700; text-align: left; }
.share-qr {
  flex: 0 0 auto; width: 64px; height: 64px;
  border: 1px dashed var(--line); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--muted); text-align: center;
}
.overlay-actions { display: flex; gap: 10px; margin-top: 14px; }
.overlay-actions button { flex: 1; }
.demo-note { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0 0; }

/* ================= 反馈 ================= */
.feedback .likert { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 16px; }
.feedback .likert label {
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
  cursor: pointer; font-size: 13px; background: #fff;
  display: inline-flex; align-items: center; gap: 6px;
}
.feedback .likert input { margin: 0; }
.feedback textarea, .feedback select { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.feedback textarea { min-height: 80px; }
.saved-hint { color: var(--ok); font-size: 14px; }

.footer { margin-top: 34px; text-align: center; color: var(--muted); font-size: 12px; }
.footer button { margin: 0 4px; }

/* ================= 4 档选项（A/B/C/D） ================= */
.options-list { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px 14px;
  background: #fff;
  min-height: 46px;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.option:hover { border-color: var(--accent); }
.option .opt-letter {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--muted);
  margin-top: 1px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.option .opt-text { font-size: 15px; line-height: 1.55; }
.option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.option.selected .opt-letter { background: var(--accent); border-color: var(--accent); color: #fff; }
.option.selected .opt-text { font-weight: 600; }

.options-list.locked { pointer-events: none; }
.options-list.locked .option { opacity: 0.8; }

/* 结果页文案 */
.one-line { font-weight: 700; color: #4a463f; }
.profile-block .os { color: var(--accent-strong); font-weight: 600; }

/* ================= V1.3 结果页（消费者体验） ================= */
.result-hero {
  border-radius: 16px;
  padding: 0;
  text-align: center;
  border: 1px solid var(--line);
  overflow: hidden;
}
.result-visual {
  width: 100%;
  aspect-ratio: 1 / 0.87;
  object-fit: cover;
  object-position: 50% 58%;
  display: block;
}
.result-hero-body {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 12px 14px 16px;
}
.result-code-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
  word-break: break-word;
}
.rc-sep { opacity: 0.45; font-weight: 400; margin: 0 3px; }
.rc-name { font-size: 17px; }
.result-oneline {
  font-size: 14px; color: #55504a; margin: 6px 0 0; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 四维：4 条纵向横轴，左文案 — 轴+得分点 — 右文案 */
.dim-list {
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dim-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.dim-side {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  min-width: 0;
}
.dim-side-left {
  flex: 0 0 90px;
  justify-content: flex-start;
}
.dim-side-right {
  flex: 0 0 112px;
  justify-content: flex-end;
}
.dim-side-letter {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: var(--dim-color);
}
.dim-side-text {
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  color: #6b6257;
}
.dim-side.active .dim-side-text {
  color: var(--dim-color);
}
.dim-axis {
  position: relative;
  flex: 1 1 auto;
  height: 3px;
  min-width: 36px;
  background: var(--line);
  border-radius: 2px;
}
.dim-axis-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--dim-color);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--dim-color);
  transform: translate(-50%, -50%);
}
.share-cta { width: 100%; margin-top: 12px; font-size: 16px; font-weight: 600; }

.expand-more {
  width: 100%; margin: 14px 0 0; padding: 10px;
  background: none; border: none; color: var(--muted);
  font-size: 15px; text-align: center;
}
.expand-more::after { content: " ↓"; }
.expand-more.open::after { content: " ↑"; }
.expand-content { margin-top: 6px; text-align: left; }
.detail-block { margin: 0 0 20px; }
.detail-block h3 { font-size: 15px; margin: 0 0 5px; }
.detail-block p { color: #4a463f; margin: 6px 0; }
.detail-block .os { color: var(--accent-strong); font-weight: 600; }

.feedback-binary { text-align: center; margin: 26px 0 6px; }
.feedback-binary .fb-q { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.feedback-binary .fb-btns { display: flex; gap: 10px; justify-content: center; }
.feedback-binary .fb-btns button { flex: 1; max-width: 170px; min-height: 46px; }
.fb-done { color: var(--ok); font-size: 13px; margin-top: 8px; }

/* 320px 仍可完成：不依赖 hover，触控热区足够 */
@media (max-width: 360px) {
  .option .opt-text { font-size: 14px; }
  .question-stem { font-size: 18px; }
  .type-code { font-size: 48px; }
}
