/* ============ 西藏特色产品调研问卷 · 藏地手作暖纸风 ============ */
:root {
  --blue: #ae4a35;        /* 主色：藏地绛红（变量名沿用，值已暖化） */
  --blue-deep: #8f3d2c;   /* 提交按钮深绛 */
  --blue-soft: #f6e7dd;   /* 选中态浅赭底 */
  --blue-line: #ddd0c2;   /* 未选中暖灰边框 */
  --ink: #3a3028;         /* 主文字：暖炭 */
  --muted: #5c5047;       /* 次要文字（白底实测 7.8:1） */
  --bg-top: #f3ece1;
  --bg-bottom: #faf6ee;
  --card: #fffdf9;
  --radius: 14px;
  --shadow: 0 3px 12px rgba(122, 88, 60, 0.09);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  line-height: 1.55;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 45%, #fbf8f1 100%);
  min-height: 100vh;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.hidden { display: none !important; }

.page { max-width: 520px; margin: 0 auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: url("assets/hero-poster.jpg") center / cover no-repeat;
  padding: 52px 22px 66px;
  overflow: hidden;
}
/* 实拍图上、下压暗渐变，保证白色文字可读（暖黑基调） */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(40, 32, 24, 0.40) 0%,
    rgba(40, 32, 24, 0.10) 22%,
    rgba(40, 32, 24, 0) 38%,
    rgba(36, 28, 20, 0.08) 58%,
    rgba(36, 28, 20, 0.48) 100%);
  pointer-events: none;
}
.hero-slogan {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  text-align: right;
  font-size: 11px;
  line-height: 1.7;
  color: #ffffff;
  opacity: 0.92;
  letter-spacing: 1px;
}
.hero-slogan span {
  display: block;
  white-space: nowrap;
  text-shadow: 0 1px 5px rgba(30, 24, 16, 0.8);
}
.hero-logo-wrap {
  position: relative;
  z-index: 1;
  width: 74px;
  height: 74px;
  margin: 2px auto 12px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 253, 249, 0.92);
  box-shadow: 0 3px 14px rgba(30, 24, 16, 0.35);
}
.hero-logo { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-title {
  position: relative;
  z-index: 1;
  margin: 0;
  text-align: center;
  color: #ffffff;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(30, 24, 16, 0.55);
}
.hero-title span { display: block; }
.hero-sub {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  text-align: center;
  color: #faf5ee;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-line;
  text-shadow: 0 1px 6px rgba(30, 24, 16, 0.75);
}

/* ---------- 内容区 ---------- */
.content { padding: 6px 14px 8px; }
.section-title {
  font-size: 16.5px;
  margin: 18px 6px 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.section-title small { font-size: 12px; color: var(--muted); font-weight: 400; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

/* 卡片头：标题 (+ 进度) */
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-head h2 { font-size: 16px; margin: 0; flex: 1; }

/* 进度条 */
.prog { display: flex; align-items: center; gap: 8px; width: 46%; }
.prog-track { flex: 1; height: 8px; border-radius: 999px; background: #e8ddd0; overflow: hidden; }
.prog-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--blue);
  transition: width 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}
.prog-num { font-size: 12px; color: var(--muted); white-space: nowrap; }

.intro-text { font-size: 13.5px; color: #6a5d52; margin: 0; }

/* ---------- 选项胶囊 ---------- */
.pill-group { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  border: 1.5px solid var(--blue-line);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.pill:active { transform: scale(0.96); }
.pill.selected {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}
.pill.nobuy { border-style: dashed; }
.pill.nobuy.selected {
  border-style: solid;
  background: #efe8df;
  color: #63564c;
  border-color: #c9bba9;
}

/* 基本信息 / 通用问题卡 */
.q-label { font-size: 14.5px; font-weight: 600; margin: 0 0 10px; }

/* ---------- 产品卡片：大图在上、题目在下 ---------- */
.product-card { display: block; padding: 0; overflow: hidden; scroll-margin-top: 16px; border: 2px solid transparent; }
.product-card.flash { border-color: var(--blue); }

.product-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--blue-soft);
}
/* 图片底部渐变 scrim，保证箭头可读 */
.product-media::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 76px;
  background: linear-gradient(180deg, rgba(58, 44, 34, 0) 0%, rgba(58, 44, 34, 0.42) 100%);
  pointer-events: none;
  z-index: 1;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}
.product-none {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a3937f;
  font-size: 15px;
  letter-spacing: 2px;
}
.product-media.flipping img {
  animation: img-flip 0.34s cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes img-flip {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}
.product-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  bottom: auto;
  z-index: 2;
  font-size: 11.5px;
  color: #fff;
  background: rgba(58, 44, 34, 0.62);
  padding: 2px 9px;
  border-radius: 7px;
}
.img-count {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 11.5px;
  color: #fff;
  background: rgba(58, 44, 34, 0.62);
  padding: 2px 9px;
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
}

/* 底部左右小箭头 */
.img-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  padding: 0 10px 10px;
  pointer-events: none;
}
.img-arrow {
  pointer-events: auto;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(58, 44, 34, 0.66);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.img-arrow:active { transform: scale(0.9); background: rgba(58, 44, 34, 0.85); }

/* 提示气泡：指向箭头，切换一次后消失 */
.img-hint {
  position: absolute;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  color: #fff;
  background: rgba(58, 44, 34, 0.88);
  padding: 5px 11px;
  border-radius: 9px;
  pointer-events: none;
  animation: hint-float 1.6s ease-in-out infinite;
  z-index: 2;
}
.img-hint::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: rgba(58, 44, 34, 0.88);
}
@keyframes hint-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .img-hint { animation: none; }
}

.product-body { padding: 12px 16px 16px; }
.product-name { font-size: 16.5px; font-weight: 700; margin: 0 0 2px; }
.product-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.q-block { margin-bottom: 10px; }
.q-block:last-child { margin-bottom: 0; }
.q-block-head { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.q-block-title { font-size: 12.5px; font-weight: 600; color: #6a5d52; }

/* ---------- 意见区 ---------- */
.opinion-card textarea {
  width: 100%;
  min-height: 88px;
  border: 1.5px solid var(--blue-line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.opinion-card textarea::placeholder { color: #857767; }
.opinion-card textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(174, 74, 53, 0.14);
}
.char-count { text-align: right; font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------- 提交按钮 ---------- */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 62%;
  margin: 18px auto 0;
  border: none;
  border-radius: 999px;
  padding: 12px 0;
  font-size: 16.5px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 2px;
  color: #fff;
  background: var(--blue-deep);
  box-shadow: 0 4px 12px rgba(143, 61, 44, 0.28);
  cursor: pointer;
}
.btn-submit svg { width: 17px; height: 17px; }
.btn-submit:active { transform: scale(0.97); }
.submit-foot { text-align: center; font-size: 11.5px; color: var(--muted); margin: 10px 0 0; }

/* ---------- 底部装饰 ---------- */
.footer-deco {
  height: 110px;
  margin-top: 20px;
  background: url("assets/footer.svg") center bottom / contain no-repeat;
}

/* ---------- 完成页 ---------- */
.screen-done { max-width: 520px; margin: 0 auto; padding-top: 14vh; }
.done-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 24px;
  text-align: center;
  margin: 0 14px;
}
.done-logo {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--blue-soft);
  box-shadow: 0 3px 14px rgba(122, 88, 60, 0.18);
}
.done-card h1 { font-size: 20px; margin: 12px 0 8px; }
.done-text { font-size: 13.5px; color: #55677a; margin: 0; }
.done-badge {
  margin-top: 16px;
  font-size: 12px;
  background: #faf1de;
  color: #8a5f00;
  border-radius: 10px;
  padding: 9px 12px;
}

/* ---------- 优惠码（完成页） ---------- */
.offer-box {
  margin: 18px 0 4px;
  border: 1.5px dashed var(--blue);
  border-radius: 12px;
  background: var(--blue-soft);
  padding: 14px 12px 12px;
}
.offer-title { margin: 0 0 10px; font-size: 13.5px; color: var(--ink); }
.offer-title b { color: var(--accent-deep); font-size: 15px; }
.offer-ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card);
  border-radius: 9px;
  padding: 9px 9px 9px 14px;
}
.offer-code {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  font-family: "SF Mono", Consolas, monospace;
}
.offer-copy {
  border: none;
  border-radius: 999px;
  background: var(--accent-deep);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 15px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.15s ease;
}
.offer-copy:active { transform: scale(0.94); }
.offer-usage { margin: 10px 2px 0; font-size: 12px; color: var(--muted); text-align: left; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(52, 42, 34, 0.94);
  color: #fff;
  font-size: 13px;
  border-radius: 999px;
  padding: 10px 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 99;
  max-width: 82vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 桌面端：居中手机宽度 ---------- */
@media (min-width: 640px) {
  .hero { padding-top: 64px; }
  .screen-done { padding-top: 18vh; }
}
