/* ============================================
   Feedback Widget — 樣式
   命名一律 fbw-*，避免與工具樣式衝突
============================================ */

.fbw-trigger {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #2563eb;
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, background 0.15s, opacity 0.3s;
}
.fbw-trigger:hover {
  background: #1d4ed8;
  transform: scale(1.08);
}

/* 滾動時自動半透明縮小，避免擋到按鈕；停止滾動 1.5s 後恢復 */
.fbw-trigger.fbw-dim {
  opacity: 0.3;
  transform: scale(0.8);
}
.fbw-trigger.fbw-dim:hover,
.fbw-trigger.fbw-dim:active {
  opacity: 1;
  transform: scale(1);
}

.fbw-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.fbw-modal-content {
  background: white;
  color: #1f2937;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.fbw-modal-hdr {
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fbw-modal-hdr h3 { margin: 0; font-size: 16px; }
.fbw-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  color: #6b7280;
}
.fbw-close:hover { color: #111827; }

.fbw-modal-body {
  padding: 14px 18px;
  overflow-y: auto;
  flex: 1;
}

.fbw-modal-ftr {
  padding: 12px 18px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  align-items: center;
}

.fbw-tool-tag {
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
}

.fbw-row {
  margin-bottom: 12px;
}
.fbw-label {
  display: block;
  font-size: 13px;
  color: #374151;
  margin-bottom: 4px;
  font-weight: 500;
}

.fbw-modal-content input[type="text"],
.fbw-modal-content textarea,
.fbw-modal-content select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
  color: #1f2937;
  background: white;
  outline: none;
  box-sizing: border-box;
}
.fbw-modal-content input:focus,
.fbw-modal-content textarea:focus,
.fbw-modal-content select:focus {
  border-color: #2563eb;
}

.fbw-dropzone {
  border: 2px dashed #d1d5db;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  color: #6b7280;
  font-size: 13px;
  transition: all 0.15s;
}
.fbw-dropzone:hover, .fbw-dropzone.hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.fbw-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.fbw-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}
.fbw-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fbw-thumb-rm {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.65);
  color: white;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fbw-thumb-rm:hover { background: #dc2626; }

.fbw-btn {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.fbw-btn:hover { background: #f9fafb; }
.fbw-btn-submit {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}
.fbw-btn-submit:hover { background: #1d4ed8; }
.fbw-btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.fbw-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: #1f2937;
  color: white;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
  z-index: 10000;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.fbw-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.fbw-toast.danger { background: #dc2626; }

@media (max-width: 600px) {
  .fbw-trigger {
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
  }
  .fbw-modal-content {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
}
