/* 选琴问卷 —— 只写问卷特有的部件。
   颜色、字体、圆角全部用 core-pages.css / theme.css 已有的变量，
   所以官网改版时这一页自动跟着变，不会变成需要单独维护的孤岛。 */

/* ── 页面上的「开始」区块 ───────────────────────────────
   问卷本身不再嵌在页面里。页面负责讲清楚，问卷点开后独占一屏。 */
.quiz-invite { max-width: 640px; margin-top: 34px; }
.quiz-ask { display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; list-style: none; }
.quiz-ask li {
  position: relative;
  padding-left: 22px;
  color: var(--text-secondary);
  font-size: .97rem;
  line-height: 1.7;
}
.quiz-ask li::before {
  content: "";
  position: absolute;
  top: .78em;
  left: 0;
  width: 10px;
  height: 1px;
  background: var(--accent);
}
.quiz-open { min-width: 190px; }

/* ── 问卷全屏层 ─────────────────────────────────────── */
.quiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 82% 12%, var(--accent-dim), transparent 26rem),
    var(--bg);
  animation: quizFade .22s ease both;
}
.quiz-overlay[hidden] { display: none; }
@keyframes quizFade { from { opacity: 0; } to { opacity: 1; } }

.quiz-bar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.quiz-bar-name {
  color: var(--accent);
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.quiz-close {
  display: inline-flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--accent-light);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color .25s ease, background-color .25s ease, border-color .25s ease;
}
.quiz-close:hover { color: var(--accent); background: var(--accent-dim); border-color: rgba(212, 160, 84, .35); }

.quiz-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 44px 20px 64px;
}

/* 窄一点，短选项不至于被拉成一条横杠 */
.quiz-shell { max-width: 560px; margin: 0 auto; }

/* 进度 = 琴弦，答一题亮一根 */
.q-strings { display: flex; flex-direction: column; gap: 6px; padding: 0 0 34px; }
.q-strings i {
  display: block;
  background: var(--border);
  border-radius: 2px;
  transition: background .5s ease, box-shadow .5s ease;
}
.q-strings i.on { background: var(--accent); box-shadow: 0 0 12px var(--accent-dim); }

.q-step { animation: qIn .34s ease both; }
@keyframes qIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

.q-title {
  max-width: 30ch;
  margin-bottom: 12px;
  font-size: clamp(1.6rem, 4.4vw, 2.2rem);
  line-height: 1.22;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.q-sub { max-width: 46ch; margin-bottom: 30px; color: var(--text-secondary); font-size: .95rem; }
.q-kicker {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.q-kicker.q-alts { margin-top: 38px; }

/* 选项 */
.q-opts { display: flex; flex-direction: column; gap: 11px; }
.q-opt {
  display: block;
  width: 100%;
  padding: 17px 19px;
  color: var(--text);
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color .22s ease, background-color .22s ease, transform .22s ease;
}
.q-opt:hover { background: var(--accent-dim); border-color: rgba(212, 160, 84, .45); transform: translateY(-2px); }
.q-opt span { display: block; margin-top: 4px; color: var(--text-secondary); font-size: .84rem; line-height: 1.55; }

.q-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.q-checks p { margin-bottom: 2px; color: var(--text-secondary); font-size: .83rem; }
.q-chk { display: flex; align-items: center; gap: 10px; font-size: .95rem; cursor: pointer; }
.q-chk input { flex: none; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }

.q-nav { display: flex; gap: 14px; align-items: center; margin-top: 30px; }
.q-ghost {
  padding: 6px 0;
  color: var(--text-secondary);
  background: none;
  border: 0;
  font-size: .87rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.q-ghost:hover { color: var(--accent); }

/* 多选题：点了留痕，另配一个「继续」按钮 */
.q-opt.q-multi { padding-left: 50px; position: relative; }
.q-opt.q-multi::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 19px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: background-color .18s ease, border-color .18s ease;
}
.q-opt.q-multi.on { border-color: rgba(212, 160, 84, .5); background: var(--accent-dim); }
.q-opt.q-multi.on::before { background: var(--accent); border-color: var(--accent); }
.q-opt.q-multi.on::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 24px;
  width: 8px;
  height: 4px;
  margin-top: -4px;
  border-left: 2px solid var(--bg);
  border-bottom: 2px solid var(--bg);
  transform: rotate(-45deg);
}
.q-go {
  min-height: 46px;
  padding: 12px 30px;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: .97rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .22s ease, opacity .22s ease;
}
.q-go:hover:not(:disabled) { background: var(--accent-light); border-color: var(--accent-light); }
.q-go:disabled { opacity: .38; cursor: default; }

/* 结果卡 */
.q-card {
  overflow: hidden;
  margin-bottom: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.q-plate { display: flex; justify-content: center; padding: 30px 16px 18px; background: #efeae1; }
.q-plate img { width: 100%; max-width: 180px; height: auto; }
.q-body { padding: 24px 24px 26px; }
.q-model {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 9px;
  font-family: 'Playfair Display', 'Noto Serif SC', serif;
  font-size: 1.3rem;
  letter-spacing: -.01em;
}
.q-model em { color: var(--text-secondary); font-size: .8rem; font-style: normal; letter-spacing: 0; }
.q-code { font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace; letter-spacing: .04em; }
.q-cw { margin-top: 7px; font-size: .95rem; }
.q-pu { color: var(--text-secondary); font-size: .85rem; }
.q-price {
  margin-top: 12px;
  color: var(--accent-light);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.q-price small { margin-left: 10px; color: var(--text-secondary); font-size: .72rem; letter-spacing: .02em; }
.q-why {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  padding-top: 19px;
  border-top: 1px solid var(--border);
}
.q-why p { font-size: .95rem; line-height: 1.72; }
.q-why p::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 1px;
  margin-right: 10px;
  background: var(--accent);
  vertical-align: middle;
}
.q-spec { margin-top: 19px; color: var(--text-secondary); font-size: .79rem; line-height: 1.65; }
.q-disc { margin-top: 9px; color: var(--text-secondary); font-size: .73rem; opacity: .8; }

.q-alt .q-plate { padding: 20px 16px 13px; }
.q-alt .q-plate img { max-width: 118px; }
.q-alt .q-body { padding: 19px 20px 21px; }
.q-alt .q-model { font-size: 1.08rem; }
.q-alt .q-price { font-size: 1.18rem; }

/* 备选区的引子：说明同档几把配置接近，差别在下面 */
.q-altsub { max-width: 44ch; margin-top: -6px; margin-bottom: 22px; }

/* ── 可点的结果卡 ─────────────────────────────────────
   卡是 div 加 role="button"，浏览器不会自己给它焦点样式，所以这里补齐。 */
.q-card[role="button"] { cursor: pointer; transition: border-color .22s ease, box-shadow .22s ease; }
.q-card[role="button"]:hover { border-color: rgba(212, 160, 84, .45); }
.q-card[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.q-more {
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--accent);
  font-size: .86rem;
  font-weight: 600;
}
.q-card[role="button"]:hover .q-more { color: var(--accent-light); }

/* ── 结果卡详情层：盖在问卷（600）之上 ─────────────────── */
.detail-overlay { z-index: 700; }
.detail-overlay .quiz-bar { justify-content: flex-start; }
.detail-back { font-family: inherit; font-size: 1.15rem; }

/* 详情页头部就是那张卡本身（同一个函数、同一批参数渲染），
   规格在下面已经拆成一颗颗了，卡上那条挤在一起的长句这里收起来，不然同一段话连着出现两遍。 */
.detail-overlay .q-card .q-spec { display: none; }

.qd-h { margin: 42px 0 12px; font-size: 1.12rem; line-height: 1.35; }
.qd-lead { margin-bottom: 15px; color: var(--text-secondary); font-size: .87rem; }
.qd-self { margin-bottom: 14px; font-size: .96rem; line-height: 1.75; }

/* 规格拆成一颗颗，比卡上那条挤在一起的长句好读 */
.qd-spec { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; list-style: none; }
.qd-spec li {
  padding: 7px 13px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .8rem;
  line-height: 1.5;
}

/* 每条理由挂一个标签，说明它是从哪道题来的 */
.qd-why { display: flex; flex-direction: column; gap: 14px; }
.qd-row {
  padding: 15px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
}
.qd-row p { font-size: .94rem; line-height: 1.72; }
.qd-row b { color: var(--accent-light); }
.qd-tag {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.qd-vs {
  margin-bottom: 12px;
  padding: 14px 17px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.qd-vs-n { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-size: .95rem; }
.qd-vs-n b { color: var(--accent-light); font-variant-numeric: tabular-nums; }
.qd-vs-d { margin-top: 5px; color: var(--text-secondary); font-size: .87rem; line-height: 1.7; }

/* 全部配色。每一格自带价钱——同一款琴的配色不一定同价。 */
.qd-cws { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 12px; }
.qd-cw {
  padding: 10px 11px 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.qd-cw.on { background: var(--accent-dim); border-color: rgba(212, 160, 84, .5); }
.qd-cw-img {
  display: flex;
  justify-content: center;
  padding: 9px 6px;
  background: #efeae1;
  border-radius: 7px;
}
.qd-cw-img img { width: 100%; max-width: 84px; height: auto; }
.qd-cw-n { margin-top: 10px; font-size: .82rem; line-height: 1.5; }
.qd-cw-p { margin-top: 3px; color: var(--accent-light); font-size: .83rem; font-variant-numeric: tabular-nums; }
.qd-cw-x { margin-top: 2px; color: var(--text-secondary); font-size: .73rem; }
.qd-cw-tag { margin-top: 7px; color: var(--accent); font-size: .69rem; font-weight: 700; line-height: 1.45; }
.qd-cw-over { margin-top: 4px; color: var(--text-secondary); font-size: .69rem; line-height: 1.45; }

/* 提示块 */
.q-flag {
  margin-bottom: 18px;
  padding: 16px 19px;
  background: var(--accent-dim);
  border: 1px solid rgba(212, 160, 84, .22);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  line-height: 1.72;
}
.q-flag b { color: var(--accent-light); }
.q-loan { display: inline-block; margin-top: 9px; }

/* 出口卡 */
.q-exit {
  margin-bottom: 18px;
  padding: 26px 26px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
.q-exit h2 { margin-bottom: 13px; font-size: 1.25rem; line-height: 1.3; }
.q-exit p { margin-bottom: 13px; font-size: .96rem; }
.q-exit p:last-child { margin-bottom: 0; }

/* 随琴还包含 */
.q-incl {
  margin-bottom: 18px;
  padding: 24px 24px 26px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.q-incl ul { display: flex; flex-direction: column; gap: 12px; list-style: none; }
.q-incl li { position: relative; padding-left: 18px; font-size: .93rem; line-height: 1.7; }
.q-incl li::before {
  content: "";
  position: absolute;
  top: .72em;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}
.q-incl li b { color: var(--accent-light); }

/* 微信 CTA */
.q-cta {
  margin-top: 8px;
  padding: 28px 24px;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.q-cta strong { display: block; margin-bottom: 4px; font-size: 1.04rem; font-weight: 600; }
.q-cta p { color: var(--text-secondary); font-size: .85rem; }
.q-wx {
  margin: 13px 0 9px;
  color: var(--accent);
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.quiz-foot {
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: .75rem;
  line-height: 1.8;
  opacity: .85;
}

@media (prefers-reduced-motion: reduce) {
  .q-step { animation: none; }
  .q-strings i, .q-opt, .q-card[role="button"] { transition: none; }
  .q-opt:hover { transform: none; }
}

@media (max-width: 600px) {
  .q-body { padding: 20px 18px 22px; }
  .q-exit, .q-incl { padding: 20px 18px 22px; }
  .qd-h { margin-top: 34px; }
  .qd-row, .qd-vs { padding: 14px 15px; }
}
