  #kf-root * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  #kf-btn {
    position: fixed;
    right: 1.9rem;
    bottom: 7rem;        
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #8982bc;        
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    z-index: 99998;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }
  #kf-btn:hover {
    background: #7c4ddb;
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.55);
  }
  #kf-btn:active {
    transform: scale(0.96);
  }
  #kf-btn svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    display: block;
  }

  #kf-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(46, 31, 74, 0.45);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  #kf-overlay.show {
    display: flex;
    opacity: 1;
  }

  /* 弹窗 */
  #kf-modal {
    width: 100%;
    max-width: 720px;
    height: 80vh;
    max-height: 640px;
    background: #fdfbff;
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(46, 31, 74, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e8e0f5;
    transform: scale(0.94);
    transition: transform 0.2s ease;
  }
  #kf-overlay.show #kf-modal {
    transform: scale(1);
  }

  #kf-header {
    padding: 10px 14px;
    background: #8982bc;
    border-bottom: 1px solid #ece4f7;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  #kf-title {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: #3d2a5c;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .kf-header-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #dccdf5;
    background: #fdfbff;
    border-radius: 8px;
    color: #6d4aad;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    flex-shrink: 0;
  }
  .kf-header-btn:hover {
    background: #ede4ff;
    color: #4a2d8a;
  }
  .kf-header-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  #kf-body {
    flex: 1;
    position: relative;
    background: #fff;
    overflow: hidden;
  }
  #kf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
  }
  #kf-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bda;
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #fdfbff;
    z-index: 1;
  }
  #kf-loading.hide { display: none; }

  @media (max-width: 768px) {
    #kf-btn {
      right: 14px;
      bottom: 9rem;
      width: 50px;
      height: 50px;
    }
    #kf-btn svg { width: 24px; height: 24px; }
    #kf-overlay { padding: 10px; }
    #kf-modal {
      width: 100%;
      height: 86vh;
      max-height: none;
      border-radius: 12px;
    }
  }

  @media (max-width: 380px) {
    #kf-modal { height: 90vh; }
  }