/* ==========================================================================
   玄熠数字视觉 · 视觉报价估算器（quote.html 专用）
   依赖 style.css 中的 :root 设计令牌
   ========================================================================== */

/* ---------- Q1. Layout ---------- */
.q-layout {
  display: grid;
  grid-template-columns: 1.42fr 1fr;
  gap: 44px;
  align-items: start;
}

.q-config { display: grid; gap: 20px; }

/* ---------- Q2. Config group ---------- */
.q-group {
  padding: 30px 32px 34px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012));
}

.q-group__head {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.q-group__no {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(42, 212, 232, 0.28);
  background: linear-gradient(140deg, rgba(42, 212, 232, 0.16), rgba(139, 92, 246, 0.14));
  font-family: var(--font-num);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cyan);
}

.q-group__head h3 {
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.q-group__head small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- Q3. Options ---------- */
.q-opts { display: grid; gap: 10px; }
.q-opts--2 { grid-template-columns: repeat(2, 1fr); }
.q-opts--3 { grid-template-columns: repeat(3, 1fr); }

.q-opt {
  position: relative;
  display: block;
  padding: 15px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease),
              box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
  -webkit-user-select: none;
  user-select: none;
}

.q-opt input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.q-opt__t {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

.q-opt__d {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.q-opt:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.q-opt.is-on {
  border-color: rgba(42, 212, 232, 0.55);
  background: linear-gradient(140deg, rgba(42, 212, 232, 0.13), rgba(139, 92, 246, 0.1));
  box-shadow: 0 14px 36px -20px rgba(42, 212, 232, 0.75);
}

.q-opt.is-on .q-opt__t { color: #fff; }
.q-opt.is-on .q-opt__d { color: var(--text-soft); }

.q-opt.is-on::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 13px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px 2px rgba(42, 212, 232, 0.8);
}

.q-opt:has(input:focus-visible) {
  outline: 2px solid rgba(42, 212, 232, 0.65);
  outline-offset: 2px;
}

/* ---------- Q4. Range ---------- */
.q-range__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.q-range__val {
  font-family: var(--font-num);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.q-range__val small {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

.q-range__hint { font-size: 13px; color: var(--text-muted); }

input[type="range"].q-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  margin-top: 20px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  outline: none;
  cursor: pointer;
}

input[type="range"].q-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #05070c;
  box-shadow: 0 0 0 1px rgba(42, 212, 232, 0.85), 0 0 18px 2px rgba(42, 212, 232, 0.5);
  cursor: pointer;
}

input[type="range"].q-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #05070c;
  box-shadow: 0 0 0 1px rgba(42, 212, 232, 0.85), 0 0 18px 2px rgba(42, 212, 232, 0.5);
  cursor: pointer;
}

/* ---------- Q5. Result panel ---------- */
.q-result {
  position: sticky;
  top: calc(var(--navh) + 18px);
  padding: 32px 30px 30px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(42, 212, 232, 0.24);
  background:
    radial-gradient(130% 90% at 8% 0%, rgba(42, 212, 232, 0.15), transparent 62%),
    radial-gradient(120% 85% at 100% 100%, rgba(139, 92, 246, 0.16), transparent 64%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.q-result::before {
  content: "";
  position: absolute;
  top: 0;
  left: 30px;
  right: 30px;
  height: 1px;
  background: var(--grad-line);
}

.q-result__label {
  font-family: var(--font-num);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.q-amount {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 14px 0 6px;
  font-family: var(--font-num);
}

.q-amount__num {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.06;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.q-amount__dash { font-size: 22px; color: var(--text-faint); padding: 0 8px; }

.q-amount__unit {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 8px;
}

.q-amount.is-flash .q-amount__num { animation: qFlash 0.45s var(--ease); }

@keyframes qFlash {
  from { opacity: 0.3; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.q-result__sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 22px;
}

/* detail rows */
.q-detail {
  display: grid;
  gap: 11px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.q-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 13.5px;
  line-height: 1.6;
}

.q-row > span:first-child { color: var(--text-muted); }

.q-row > span:last-child {
  flex: none;
  font-family: var(--font-num);
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
}

.q-row--sum {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}

.q-row--sum > span:first-child { color: var(--text-soft); }
.q-row--sum > span:last-child { color: #fff; }

.q-empty { font-size: 13px; color: var(--text-faint); }

/* include / exclude */
.q-scope { margin-top: 24px; display: grid; gap: 16px; }

.q-scope h5 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.q-scope ul { display: grid; gap: 7px; }

.q-scope li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.6;
}

.q-scope li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.8;
}

.q-scope--out li::before { background: var(--text-faint); }

.q-disclaimer {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(232, 169, 74, 0.3);
  background: rgba(232, 169, 74, 0.07);
  font-size: 12.5px;
  line-height: 1.75;
  color: #e0bd85;
}

/* ---------- Q6. Actions ---------- */
.q-actions { display: grid; gap: 10px; margin-top: 24px; }

.q-actions .btn { width: 100%; }

/* 报价面板里的微信入口：只是个文字链，不抢主按钮，也不占二维码的位置 */
.q-actions .q-link { justify-self: center; margin-top: 2px; }

.q-link {
  font-size: 12.5px;
  color: var(--text-faint);
  transition: color 0.3s;
}

.q-link:hover { color: var(--cyan); }

/* ---------- Q7. Summary box ---------- */
.q-summary {
  margin-top: 26px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(3, 5, 10, 0.6);
  overflow: hidden;
}

.q-summary__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-soft);
}

.q-summary pre {
  margin: 0;
  padding: 18px;
  font-family: var(--font-num), var(--font-sans);
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 340px;
  overflow: auto;
}

.q-copy {
  flex: none;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  font-size: 12px;
  color: var(--text-soft);
  transition: all 0.3s var(--ease);
}

.q-copy:hover {
  border-color: rgba(42, 212, 232, 0.5);
  color: var(--cyan);
  background: rgba(42, 212, 232, 0.08);
}

.q-copy.is-done {
  border-color: rgba(42, 212, 232, 0.6);
  color: var(--cyan);
}

/* ---------- Q8. Scope / variables (full-width section) ---------- */
.q-scope-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.q-scope-cols .q-scope {
  margin-top: 0;
  padding: 32px 34px 34px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012));
}

.q-scope-cols .q-scope h5 {
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  margin-bottom: 18px;
}

.q-scope-cols .q-scope li { font-size: 15px; line-height: 1.7; }
.q-scope-cols .q-scope li::before { top: 10px; }

.q-vars h5 {
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  margin-bottom: 18px;
}

/* ---------- Q9. Mobile summary bar ---------- */
.q-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(5, 7, 12, 0.94);
  backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--line);
  transition: border-color 0.4s var(--ease);
}

/* 左侧金额区本身是链接：点它直接跳到右侧面板看明细 */
.q-bar__val {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.q-bar__val small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-faint);
  letter-spacing: 0.12em;
  margin-bottom: 2px;
}

/* 电话快捷入口：报价页在窄屏隐藏了通用行动条，这里补回一键拨号 */
.q-bar__tel {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.q-bar__tel svg { width: 19px; height: 19px; }

.q-bar__tel:active {
  color: var(--text);
  border-color: rgba(42, 212, 232, 0.5);
  background: rgba(42, 212, 232, 0.1);
}

.q-bar .btn { width: auto; height: 42px; padding: 0 20px; font-size: 14px; }

/* 出价后，边条从"进度提示"转为"可发送"态 */
.q-bar.is-live { border-top-color: rgba(42, 212, 232, 0.42); }

/* 金额首次出现在边条上时轻微浮现，提示"可以看了" */
.q-bar.is-flash .q-bar__val { animation: qBarFlash 0.5s var(--ease); }

@keyframes qBarFlash {
  from { opacity: 0.25; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Q11. 引导流程：进度条 / 必选标记 / 锁态 ---------- */

/* 进度条 */
.q-progress {
  padding: 20px 24px 18px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(42, 212, 232, 0.22);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(42, 212, 232, 0.12), transparent 60%),
    rgba(255, 255, 255, 0.028);
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}

.q-progress.is-done {
  border-color: rgba(60, 220, 150, 0.34);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(60, 220, 150, 0.13), transparent 60%),
    rgba(255, 255, 255, 0.028);
}

.q-progress__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.q-progress__txt {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}

.q-progress__pct {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 700;
  color: var(--cyan);
}

.q-progress.is-done .q-progress__pct { color: #3cdc96; }

.q-progress__track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.q-progress__track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--grad-brand);
  transition: width 0.45s var(--ease), background 0.4s var(--ease);
}

.q-progress.is-done .q-progress__track i { background: linear-gradient(90deg, #2ae8b0, #3cdc96); }

.q-progress__hint {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* 必选 / 可选 标记 */
.q-group__req,
.q-group__opt {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.q-group__req {
  color: #ffd489;
  background: rgba(255, 200, 100, 0.13);
  border: 1px solid rgba(255, 200, 100, 0.3);
}

.q-group__opt {
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

/* 未作答的组：左侧琥珀色提示线 */
.q-group.is-todo {
  border-color: rgba(255, 200, 100, 0.28);
  box-shadow: inset 3px 0 0 rgba(255, 200, 100, 0.55);
}

.q-group.is-todo .q-group__no {
  color: #ffd489;
  border-color: rgba(255, 200, 100, 0.45);
}

/* 从引导清单跳转过来的短暂高亮 */
.q-group.is-flash {
  animation: qGroupFlash 1.5s var(--ease);
}

@keyframes qGroupFlash {
  0%   { box-shadow: inset 3px 0 0 rgba(42, 212, 232, 0.9), 0 0 0 0 rgba(42, 212, 232, 0.45); }
  35%  { box-shadow: inset 3px 0 0 rgba(42, 212, 232, 0.9), 0 0 0 8px rgba(42, 212, 232, 0); }
  100% { box-shadow: inset 3px 0 0 rgba(42, 212, 232, 0), 0 0 0 0 rgba(42, 212, 232, 0); }
}

/* 结果区：引导态只显示锁态，出价后只显示数字 */
.q-result.is-pending .q-out { display: none; }
.q-result:not(.is-pending) .q-lock { display: none; }

.q-lock { padding-top: 20px; }

.q-lock__ico {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 14px;
  color: var(--cyan);
  border: 1px solid rgba(42, 212, 232, 0.3);
  background: radial-gradient(120% 120% at 30% 20%, rgba(42, 212, 232, 0.2), transparent 70%);
}

.q-lock__ico svg { width: 26px; height: 26px; }

.q-lock h3 {
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  line-height: 1.45;
  margin-bottom: 10px;
}

.q-lock > p {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.q-lock__list {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.q-lock__list a {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 200, 100, 0.22);
  background: rgba(255, 200, 100, 0.055);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
              transform 0.25s var(--ease);
}

.q-lock__list a:hover {
  border-color: rgba(255, 200, 100, 0.5);
  background: rgba(255, 200, 100, 0.11);
  transform: translateX(3px);
}

.q-lock__list b {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffd489;
}

.q-lock__list b::before {
  content: "待选择 · ";
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.q-lock__list span {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.q-lock__foot {
  margin: 0;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-faint);
}

.q-lock__foot a { color: var(--cyan); }

/* 出价前禁用"发给我们" */
.q-actions .btn.is-disabled {
  opacity: 0.42;
  pointer-events: none;
  filter: grayscale(0.35);
}

/* 重新填写 */
.q-reset {
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-faint);
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.q-reset:hover { color: var(--cyan); background: rgba(255, 255, 255, 0.04); }

/* 复制摘要按钮禁用态 */
.q-copy:disabled,
.q-copy[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* 摘要区在未出价时给出占位说明（用 :empty 保证 DOM 里确实是空的） */
.q-summary pre:empty::before {
  content: "完成上方必选项后，这里会自动生成可复制的需求摘要。";
  color: var(--text-faint);
}

@media (max-width: 720px) {
  .q-progress { padding: 18px 20px 16px; }
  .q-lock { padding-top: 16px; }
  .q-lock h3 { font-size: 18px; }
  .q-lock__ico { width: 46px; height: 46px; margin-bottom: 14px; }
}

/* ---------- Q10. 报价跟随（面板常驻） ---------- */

/* 结果列必须撑满整行。
   position:sticky 的跟随余量 = 父容器高度 − 自身高度；
   .q-layout 上的 align-items:start 会把结果列压成与报价面板等高，
   余量变成 0，sticky 就等于没写——数字会跟着页面一起滚走。
   这里用 align-self:stretch 单独把结果列拉满，让 sticky 真正生效。 */
.q-side {
  align-self: stretch;
  position: relative;
  min-width: 0;
}

/* 锚点跳转时给固定导航让位 */
#estimate, #q-result, #form { scroll-margin-top: calc(var(--navh) + 16px); }

@media (min-width: 1181px) {
  /* 报价面板钉在视口内：左边一直答，右边金额一直可见 */
  .q-result {
    top: calc(var(--navh) + 16px);
    max-height: calc(100vh - var(--navh) - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* 引导态内容短，一般不会滚动；万一视口很矮，允许它自己滚，绝不裁掉内容 */
  .q-result.is-pending { overflow-y: auto; }

  /* 结果态：只让明细列表滚动，
     金额 / 摘要句 / 免责声明 / 操作按钮始终留在面板可视区内 */
  .q-result:not(.is-pending) .q-out {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .q-out > .q-amount,
  .q-out > .q-result__sub,
  .q-out > .q-disclaimer,
  .q-out > .q-actions { flex: none; }

  .q-result:not(.is-pending) .q-detail {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-inline: -8px;
    padding-inline: 8px;
  }

  .q-detail::-webkit-scrollbar { width: 6px; }
}

@media (max-width: 1180px) {
  .q-layout { grid-template-columns: 1fr; gap: 30px; }
  .q-result { position: static; }

  /* 报价页底栏交给报价边条（详见 Q9）：
     通用行动条会与它叠成两条，在窄屏上白白吃掉一大截高度。 */
  .q-bar { display: flex; z-index: 880; }
  body[data-page="quote"] .actbar { display: none; }
  body[data-page="quote"] { padding-bottom: 92px; }
  body[data-page="quote"] .totop { display: none; }
  body[data-page="quote"] .chat { bottom: 96px; }
  body[data-page="quote"] .chat__panel { height: min(520px, calc(100vh - 200px)); }
}

@media (max-width: 860px) {
  .q-opts--3 { grid-template-columns: repeat(2, 1fr); }
  .q-scope-cols { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .q-group { padding: 24px 20px 26px; }
  .q-group__head { gap: 12px; margin-bottom: 20px; }
  .q-opts--2, .q-opts--3 { grid-template-columns: 1fr; }
  .q-opt { padding: 14px 16px; }
  .q-result { padding: 26px 22px 26px; }
  .q-result::before { left: 22px; right: 22px; }
  .q-amount__num { font-size: 34px; }
  .q-amount__dash { font-size: 18px; padding: 0 5px; }
  .q-amount__unit { font-size: 13.5px; margin-left: 4px; }
  .q-summary pre { max-height: 260px; }
  .q-scope-cols .q-scope { padding: 24px 22px 26px; }
}
