/* ==========================================================
 * feedback-kit widget — 浮窗按钮 + 弹层表单
 * 类名前缀 .fk-，避免污染宿主
 * ========================================================== */
:root {
  --fk-primary: #3b82f6;
  --fk-primary-hover: #2563eb;
  --fk-text: #1f2937;
  --fk-text-muted: #6b7280;
  --fk-border: #e5e7eb;
  --fk-bg: #ffffff;
  --fk-bg-soft: #f9fafb;
  --fk-error-bg: #fef2f2;
  --fk-error-text: #b91c1c;
  --fk-success-bg: #f0fdf4;
  --fk-success-text: #15803d;
  --fk-radius: 10px;
  --fk-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  --fk-z: 2147482900; /* 略低于 auth-kit，避免遮挡登录弹层 */
}

/* ===== 浮窗按钮 ===== */
.fk-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--fk-z);
  background: var(--fk-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  height: 44px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fk-launcher:hover {
  background: var(--fk-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}
.fk-launcher svg {
  width: 16px;
  height: 16px;
}

/* ===== 遮罩与卡片 ===== */
.fk-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--fk-z);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--fk-text);
  animation: fk-fade-in 0.18s ease-out;
  padding: 16px;
  box-sizing: border-box;
}
@keyframes fk-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fk-card {
  background: var(--fk-bg);
  border-radius: var(--fk-radius);
  box-shadow: var(--fk-shadow);
  width: 460px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  box-sizing: border-box;
  position: relative;
}

.fk-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--fk-text-muted);
  border-radius: 6px;
}
.fk-close:hover {
  background: var(--fk-bg-soft);
  color: var(--fk-text);
}

.fk-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}
.fk-subtitle {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--fk-text-muted);
}

/* ===== 表单 ===== */
.fk-row {
  margin-bottom: 14px;
}
.fk-row-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}
.fk-row-inline .fk-input {
  flex: 1;
  min-width: 0;
}

.fk-label {
  display: block;
  font-size: 13px;
  color: var(--fk-text);
  margin-bottom: 6px;
  font-weight: 500;
}
.fk-label .fk-optional {
  color: var(--fk-text-muted);
  font-weight: normal;
  margin-left: 4px;
}

.fk-input,
.fk-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--fk-border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--fk-text);
  background: var(--fk-bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fk-input:focus,
.fk-textarea:focus {
  border-color: var(--fk-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.fk-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}
.fk-textarea::placeholder,
.fk-input::placeholder {
  color: #9ca3af;
}

.fk-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fk-text-muted);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.fk-check input {
  margin: 0;
}

.fk-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.fk-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--fk-border);
  background: var(--fk-bg-soft);
}
.fk-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fk-thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.fk-thumb-del:hover {
  background: rgba(0, 0, 0, 0.8);
}

.fk-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.fk-btn {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.fk-btn-primary {
  background: var(--fk-primary);
  color: #fff;
}
.fk-btn-primary:hover {
  background: var(--fk-primary-hover);
}
.fk-btn-primary:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}
.fk-btn-secondary {
  background: var(--fk-bg-soft);
  color: var(--fk-text);
  flex: 0 0 auto;
}
.fk-btn-secondary:hover {
  background: var(--fk-border);
}

.fk-msg {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.fk-msg-error {
  background: var(--fk-error-bg);
  color: var(--fk-error-text);
}
.fk-msg-success {
  background: var(--fk-success-bg);
  color: var(--fk-success-text);
}

.fk-help {
  font-size: 12px;
  color: var(--fk-text-muted);
  margin-top: 6px;
}

/* 移动端适配 */
@media (max-width: 480px) {
  .fk-launcher {
    right: 12px;
    bottom: 12px;
    height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }
  .fk-card {
    padding: 20px;
  }
}
