/*!
 * 易优CMS 留资组件 v1.0 —— 样式表
 * 配合 lead-tools.js 使用
 * 主题色通过下方 --lk-main 改，一处改全站生效
 */

:root {
  --lk-main: #1a5fa8;
  --lk-main-dark: #0f4478;
  --lk-ink: #1b1f24;
  --lk-line: #e6e8eb;
  --lk-radius: 10px;
}

/* ==================== 悬浮客服条 ==================== */
.lk-bar {
  position: fixed;
  right: 18px;
  bottom: 120px;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.lk-btn {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--lk-line);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 14px rgba(18, 24, 32, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  font-family: inherit;
}
.lk-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(18, 24, 32, 0.16);
  background: #fff;
}
.lk-btn:active { transform: translateY(0); }
.lk-btn:focus-visible { outline: 2px solid var(--lk-main); outline-offset: 2px; }

.lk-ico {
  font-size: 17px;
  font-weight: 700;
  color: var(--lk-main);
  line-height: 1;
  letter-spacing: 0;
}

/* hover 展开的文字气泡 */
.lk-label {
  position: absolute;
  right: 66px;
  top: 50%;
  transform: translate(8px, -50%);
  padding: 7px 12px;
  border-radius: 6px;
  background: var(--lk-ink);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.lk-btn:hover .lk-label,
.lk-btn:focus-visible .lk-label {
  opacity: 1;
  transform: translate(0, -50%);
}

/* 回到顶部：滚动 300px 后才出现 */
.lk-top { display: none; }
.lk-bar.lk-scrolled .lk-top { display: flex; }

/* ==================== 二维码弹窗 ==================== */
.lk-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9998;
  background: rgba(12, 16, 22, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lk-mask.lk-show { display: flex; }

.lk-qr-card {
  position: relative;
  width: 280px;
  max-width: 100%;
  padding: 22px 22px 18px;
  border-radius: var(--lk-radius);
  background: #fff;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
.lk-qr-img {
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}
.lk-qr-tip {
  margin: 12px 0 0;
  font-size: 13px;
  color: #5b6470;
  line-height: 1.6;
}
.lk-qr-close {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #98a1ad;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.lk-qr-close:hover { color: var(--lk-main); }

/* ==================== 轻提示 ==================== */
.lk-toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 9999;
  transform: translate(-50%, 12px);
  max-width: 86vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 24, 30, 0.92);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.lk-toast.lk-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==================== 报价表单（可选，模板自带样式可整段删） ==================== */
.lead-form {
  max-width: 720px;
  font-family: inherit;
}
.lead-form .lk-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}
.lead-form .lk-row > * { flex: 1 1 0; min-width: 0; }
.lead-form input[type="text"],
.lead-form input[type="tel"],
.lead-form input[type="email"],
.lead-form select,
.lead-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--lk-line);
  border-radius: 8px;
  background: #fff;
  color: var(--lk-ink);
  font-size: 15px;
  line-height: 1.4;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lead-form textarea { min-height: 104px; resize: vertical; }
.lead-form input:focus,
.lead-form select:focus,
.lead-form textarea:focus {
  outline: none;
  border-color: var(--lk-main);
  box-shadow: 0 0 0 3px rgba(26, 95, 168, 0.12);
}
.lead-form .lk-err {
  border-color: #e03131 !important;
  box-shadow: 0 0 0 3px rgba(224, 49, 49, 0.12) !important;
}
.lead-form .lk-submit {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--lk-main);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.18s ease;
}
.lead-form .lk-submit:hover { background: var(--lk-main-dark); }
.lead-form .lk-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.lead-form .lk-tip {
  margin: 10px 0 0;
  font-size: 12px;
  color: #8a929d;
  line-height: 1.6;
}

/* ==================== 移动端 ==================== */
@media (max-width: 768px) {
  .lk-bar {
    right: 0;
    left: 0;
    bottom: 0;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: 0 -2px 14px rgba(18, 24, 32, 0.12);
    border-radius: 0;
    flex-wrap: nowrap;
  }
  .lk-btn {
    flex: 1 1 0;
    width: auto;
    height: 48px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    background: transparent;
  }
  .lk-btn:hover { transform: none; box-shadow: none; }
  .lk-ico { font-size: 16px; }
  .lk-label {
    position: static;
    transform: none;
    opacity: 1;
    background: transparent;
    color: #4a525d;
    padding: 0;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .lk-btn:hover .lk-label { transform: none; }
  .lk-top { display: flex; }
  .lk-toast { bottom: 76px; }
  .lk-qr-card { width: 86vw; padding: 18px 16px 14px; }
  .lk-qr-img { width: 100%; }

  .lead-form .lk-row { flex-direction: column; gap: 12px; }
}
