.gf-kf {
  --gf-kf-primary: #1f6fff;
  --gf-kf-primary-dark: #1557d6;
  --gf-kf-bg: #ffffff;
  --gf-kf-soft: #f4f7fb;
  --gf-kf-border: #e5ebf5;
  --gf-kf-text: #1f2937;
  --gf-kf-muted: #667085;
  --gf-kf-shadow: 0 18px 45px rgba(25, 45, 85, 0.18);
  position: fixed;
  right: 78px;
  bottom: 24px;
  z-index: 9999;
  font-family: inherit;
  color: var(--gf-kf-text);
}

.gf-kf * {
  box-sizing: border-box;
}

/* .gf-kf__launcher {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 10px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #2f7cff, #1bc7d4);
  box-shadow: 0 12px 28px rgba(31, 111, 255, 0.28);
  cursor: pointer;
} */

.gf-kf__launcher:hover {
  transform: translateY(-1px);
}

.gf-kf__launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 13px;
  font-weight: 700;
}

.gf-kf__launcher-text {
  font-size: 15px;
  font-weight: 600;
}

.gf-kf__panel {
  display: none;
  position: absolute;
  right: 0;
  bottom: 62px;
  width: 390px;
  height: 580px;
  overflow: hidden;
  border: 1px solid var(--gf-kf-border);
  border-radius: 20px;
  background: var(--gf-kf-bg);
  box-shadow: var(--gf-kf-shadow);
}

.gf-kf--open .gf-kf__panel {
  display: flex;
  flex-direction: column;
}

.gf-kf__header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gf-kf-border);
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.gf-kf__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #1f6fff, #19c6d2);
  font-weight: 700;
  font-size: 13px;
}

.gf-kf__title {
  font-size: 16px;
  font-weight: 700;
}

.gf-kf__status {
  margin-top: 2px;
  color: var(--gf-kf-muted);
  font-size: 12px;
}

.gf-kf__clear,
.gf-kf__close {
  border: 0;
  background: transparent;
  color: var(--gf-kf-muted);
  cursor: pointer;
}

.gf-kf__clear {
  margin-left: auto;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 13px;
}

.gf-kf__clear:hover {
  background: var(--gf-kf-soft);
  color: var(--gf-kf-primary);
}

.gf-kf__close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 26px;
}

.gf-kf__close:hover {
  background: var(--gf-kf-soft);
}

.gf-kf__body {
  flex: 1;
  min-height: 0;
  background: #f7f9fc;
}

.gf-kf__messages {
  height: 100%;
  padding: 16px;
  overflow-y: auto;
}

.gf-kf__msg {
  display: flex;
  margin-bottom: 12px;
}

.gf-kf__msg--user {
  justify-content: flex-end;
}

.gf-kf__msg--assistant {
  justify-content: flex-start;
}

.gf-kf__bubble,
.gf-kf__human-card {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
}

.gf-kf__msg--assistant .gf-kf__bubble,
.gf-kf__human-card {
  border: 1px solid var(--gf-kf-border);
  background: #fff;
}

.gf-kf__msg--user .gf-kf__bubble {
  color: #fff;
  background: var(--gf-kf-primary);
  border-bottom-right-radius: 4px;
}

.gf-kf__bubble a {
  color: var(--gf-kf-primary);
  font-weight: 600;
  text-decoration: none;
}

.gf-kf__bubble a:hover {
  text-decoration: underline;
}

.gf-kf__cursor {
  display: inline-block;
  width: 7px;
  height: 16px;
  margin-left: 2px;
  vertical-align: -3px;
  border-radius: 2px;
  background: var(--gf-kf-primary);
  animation: gfKfBlink 0.8s infinite;
}

.gf-kf__actions {
  padding: 10px 14px;
  border-top: 1px solid var(--gf-kf-border);
  background: #fff;
}

.gf-kf__human-btn {
  width: 100%;
  height: 38px;
  border: 1px solid #d8e5ff;
  border-radius: 12px;
  color: var(--gf-kf-primary);
  background: #f7fbff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.gf-kf__human-btn:hover {
  color: #fff;
  border-color: var(--gf-kf-primary);
  background: var(--gf-kf-primary);
}

.gf-kf__inline-quick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
}

.gf-kf__quick-item {
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--gf-kf-border);
  border-radius: 10px;
  color: var(--gf-kf-primary);
  background: #fff;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(25, 45, 85, 0.06);
}

.gf-kf__quick-item:hover {
  border-color: #bfd4ff;
  background: #f7fbff;
}

.gf-kf__form {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--gf-kf-border);
  background: #fff;
}

.gf-kf__input {
  flex: 1;
  height: 42px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--gf-kf-border);
  border-radius: 12px;
  color: var(--gf-kf-text);
  outline: none;
}

.gf-kf__input:focus {
  border-color: var(--gf-kf-primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 255, 0.12);
}

.gf-kf__send {
  width: 68px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--gf-kf-primary);
  font-weight: 600;
  cursor: pointer;
}

.gf-kf__send:hover {
  background: var(--gf-kf-primary-dark);
}

.gf-kf__send:disabled,
.gf-kf__input:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.gf-kf__human-card {
  width: 100%;
}

.gf-kf__human-title {
  margin-bottom: 6px;
  color: var(--gf-kf-primary);
  font-size: 15px;
  font-weight: 700;
}

.gf-kf__human-card p {
  margin: 0 0 10px;
  color: var(--gf-kf-muted);
}

.gf-kf__human-card dl {
  margin: 0;
}

.gf-kf__human-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px dashed var(--gf-kf-border);
}

.gf-kf__human-card dt {
  color: var(--gf-kf-muted);
}

.gf-kf__human-card dd {
  margin: 0;
  color: var(--gf-kf-text);
  font-weight: 600;
}

.gf-kf__human-card dd a {
  color: var(--gf-kf-primary);
  text-decoration: none;
}

.gf-kf__human-qr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--gf-kf-border);
}

.gf-kf__human-qr-title {
  color: var(--gf-kf-muted);
  font-size: 13px;
}

.gf-kf__human-qr img {
  width: 88px;
  height: 88px;
  border: 1px solid var(--gf-kf-border);
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
}

@keyframes gfKfBlink {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 1; }
}

/* ============================================================
   咨询表单弹窗 (gf-inquiry-modal)
   ============================================================ */

/* 滚动锁定：弹窗打开时挂在 body 上 */
.gf-modal-noscroll {
  overflow: hidden;
}

/* 遮罩层：默认隐藏，open 状态淡入 */
.gf-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 20, 40, 0.55);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.gf-modal-backdrop--open {
  display: flex;
  animation: gfModalFadeIn 0.2s ease;
}

/* 弹窗卡片 */
.gf-modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: 20px;
  background: var(--bg-secondary, #fff);
  box-shadow: 0 24px 60px rgba(10, 20, 50, 0.22);
  padding: 36px 32px 32px;
  animation: gfModalSlideUp 0.22s ease;
}

/* 关闭按钮 */
.gf-modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary, #667085);
  font-size: 22px;
  line-height: 28px;
  cursor: pointer;
  transition: background 0.15s;
}

.gf-modal__close:hover {
  background: var(--accent-dim, rgba(40, 227, 160, 0.12));
  color: var(--text-primary, #0f172a);
}

/* 头部 */
.gf-modal__head {
  text-align: center;
  margin-bottom: 24px;
}

.gf-modal__icon {
  font-size: 32px;
  margin-bottom: 8px;
  line-height: 1;
}

.gf-modal__title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.gf-modal__desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #667085);
}

/* 表单行 */
.gf-modal__row {
  margin-bottom: 16px;
}

.gf-modal__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.gf-modal__req {
  color: #e53e3e;
}

/* 输入框 & 文本域 */
.gf-modal__input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-medium, rgba(148,163,184,0.3));
  border-radius: 10px;
  background: var(--bg-primary, #f8fafc);
  color: var(--text-primary, #0f172a);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.gf-modal__input:focus {
  border-color: var(--accent, #28e3a0);
  box-shadow: 0 0 0 3px var(--accent-dim, rgba(40,227,160,0.15));
  background: var(--bg-secondary, #fff);
}

.gf-modal__input--err {
  border-color: #e53e3e !important;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.12) !important;
}

.gf-modal__textarea {
  resize: vertical;
  min-height: 90px;
}

/* 字数统计 */
.gf-modal__count {
  display: block;
  margin-top: 4px;
  text-align: right;
  font-size: 12px;
  color: var(--text-tertiary, #94a3b8);
}

/* 错误提示 */
.gf-modal__err {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #e53e3e;
  min-height: 16px;
}

/* 提交按钮 */
.gf-modal__submit {
  display: block;
  width: 100%;
  margin-top: 8px;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--accent, #28e3a0);
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
}

.gf-modal__submit:hover:not(:disabled) {
  opacity: 0.88;
  transform: translateY(-1px);
}

.gf-modal__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 提交成功状态 */
.gf-modal__success {
  text-align: center;
  padding: 32px 0 16px;
}

.gf-modal__success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-dim, rgba(40,227,160,0.15));
  color: var(--accent, #28e3a0);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
}

.gf-modal__success p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

/* 深色主题适配 */
html.dark .gf-modal {
  background: #111827;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

html.dark .gf-modal__input {
  background: #1f2937;
  border-color: rgba(255,255,255,0.1);
  color: #f1f5f9;
}

html.dark .gf-modal__input:focus {
  background: #1f2937;
}

/* 入场动画 */
@keyframes gfModalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes gfModalSlideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* 移动端适配 */
@media (max-width: 520px) {
  .gf-modal {
    padding: 28px 20px 24px;
    border-radius: 16px;
  }
}

@media (max-width: 768px) {
  .gf-kf {
    right: 14px;
    bottom: 14px;
  }

  .gf-kf__panel {
    position: fixed;
    right: 10px;
    left: 10px;
    bottom: 72px;
    width: auto;
    height: min(620px, calc(100vh - 92px));
    border-radius: 18px;
  }

  .gf-kf__launcher-text {
    display: none;
  }

  .gf-kf__launcher {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
  }

}
