/* ============================================================
   Quote Widget 悬浮报价工具条
   依赖全局主题变量（--accent / --bg-card / --text-* 等），自动适配深浅主题
   显示/隐藏采用即时终态，不依赖动画时钟，确保任何环境下都可靠可见
   ============================================================ */
.qw {
  --qw-size: 48px;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9500;
  font-family: var(--font-sans);
}
.qw, .qw * { box-sizing: border-box; }

/* ---------- 竖排 dock ---------- */
.qw-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
}
.qw.qw-show .qw-dock {
  opacity: 1;
  pointer-events: auto;
}

.qw-item {
  width: var(--qw-size);
  height: var(--qw-size);
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
  transition: transform .2s ease, box-shadow .2s ease;
}
.qw-item .qw-ico { font-size: 20px; line-height: 1; }
.qw-item:hover { transform: translateY(-2px); box-shadow: 0 12px 26px var(--accent-glow); }
.qw-item:active { transform: scale(.95); }

/* 主报价按钮：胶囊形、带文字，更醒目 */
.qw-quote {
  width: auto;
  padding: 0 18px;
  height: 46px;
  border-radius: 100px;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.qw-quote .qw-ico { font-size: 17px; }

/* ---------- 报价表单 panel ---------- */
.qw-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: 304px;
  margin: 0;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  display: none;
}
.qw.qw-panel-open .qw-panel { display: block; }

.qw-close {
  position: absolute;
  top: 9px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--text-tertiary);
}
.qw-close:hover { color: var(--text-primary); }

.qw-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  padding-right: 20px;
}
.qw-sub {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 8px 0 14px;
}

.qw-input {
  width: 100%;
  height: 42px;
  margin: 0 0 10px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color .2s ease;
}
.qw-input::placeholder { color: var(--text-tertiary); }
.qw-input:focus { border-color: var(--accent); }

.qw-submit {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  transition: opacity .2s ease, transform .2s ease;
}
.qw-submit:hover { opacity: .93; }
.qw-submit:active { transform: scale(.98); }
.qw-submit:disabled { opacity: .55; cursor: not-allowed; }

.qw-promise {
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-tertiary);
  margin: 10px 0 0;
}

/* 表单错误提示 */
.qw-error {
  display: none;
  font-size: 12px;
  color: #ff5a5a;
  margin: 0 0 8px;
}
.qw-error.qw-on { display: block; }

/* ---------- 成功态 ---------- */
.qw-success { text-align: center; padding: 6px 0; }
.qw-success .qw-s-ico { font-size: 38px; line-height: 1; }
.qw-success .qw-s-t {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 12px 0 6px;
}
.qw-success .qw-s-d {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.qw-success .qw-s-call {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

/* ---------- 移动端 ---------- */
@media (max-width: 600px) {
  .qw { right: 12px; bottom: 12px; --qw-size: 44px; }
  .qw-item .qw-ico { font-size: 18px; }
  .qw-quote { height: 44px; font-size: 13px; padding: 0 16px; }

  .qw-panel {
    position: fixed;
    left: 50%;
    bottom: 16px;
    width: min(90vw, 320px);
    transform: translateX(-50%);
  }
}
