/* 校享团 · 需求调研浮窗 v5 */
:root {
  --xxt-fb-accent: #1677ff;
  --xxt-fb-accent2: #69b1ff;
  --xxt-fb-bg: #ffffff;
  --xxt-fb-text: #1f1f1f;
  --xxt-fb-muted: #8c8c8c;
  --xxt-fb-border: rgba(0, 0, 0, 0.06);
  --xxt-fb-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── 悬浮按钮 ── */
.xxt-fb-fab {
  position: fixed;
  right: 18px;
  bottom: 72px;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: linear-gradient(135deg, #1677ff 0%, #0958d9 55%, #003eb3 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(22, 119, 255, 0.42), 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.35s var(--xxt-fb-ease), box-shadow 0.35s var(--xxt-fb-ease);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  animation: xxtFabIn 0.6s var(--xxt-fb-ease) both;
}
@keyframes xxtFabIn {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.xxt-fb-fab::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.35), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.xxt-fb-fab:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 36px rgba(22, 119, 255, 0.5);
}
.xxt-fb-fab:active { transform: translateY(-1px) scale(0.98); }
.xxt-fb-fab .fab-icon {
  font-size: 17px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

body.has-tour-dock .xxt-fb-fab { bottom: 68px; }
body.dock-bigscreen .xxt-fb-fab { bottom: 56px; }
body.xxt-fb-miniapp .xxt-fb-fab {
  bottom: calc(78px + env(safe-area-inset-bottom, 0));
  right: 12px;
  padding: 9px 13px;
  font-size: 12px;
}

/* ── 遮罩 ── */
.xxt-fb-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--xxt-fb-ease), visibility 0.35s;
}
.xxt-fb-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ── 弹窗 ── */
.xxt-fb-modal {
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--xxt-fb-bg);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255,255,255,0.08) inset;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  transform: translateY(24px) scale(0.96);
  opacity: 0;
  transition: transform 0.4s var(--xxt-fb-ease), opacity 0.4s var(--xxt-fb-ease);
}
.xxt-fb-overlay.open .xxt-fb-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.xxt-fb-header {
  padding: 22px 22px 16px;
  background: linear-gradient(160deg, #f0f7ff 0%, #fff 55%);
  border-bottom: 1px solid var(--xxt-fb-border);
  position: relative;
  flex-shrink: 0;
}
.xxt-fb-header h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--xxt-fb-text);
  letter-spacing: -0.02em;
}
.xxt-fb-lead {
  margin: 0;
  font-size: 13px;
  color: var(--xxt-fb-muted);
  line-height: 1.55;
}
.xxt-fb-page-card {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(22, 119, 255, 0.06);
  border: 1px solid rgba(22, 119, 255, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.xxt-fb-page-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1677ff, #4096ff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.xxt-fb-page-meta { flex: 1; min-width: 0; }
.xxt-fb-page-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  margin-bottom: 2px;
}
.xxt-fb-page-card strong {
  display: block;
  font-size: 14px;
  color: #0958d9;
  line-height: 1.4;
  word-break: break-word;
}

.xxt-fb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(0,0,0,0.04);
  border-radius: 50%;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s, transform 0.2s;
}
.xxt-fb-close:hover { background: rgba(0,0,0,0.08); transform: rotate(90deg); }

.xxt-fb-body {
  padding: 18px 22px 22px;
  overflow-y: auto;
  flex: 1;
}

.xxt-fb-section-label {
  font-size: 12px;
  font-weight: 600;
  color: #595959;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.xxt-fb-section-label span { color: #bfbfbf; font-weight: 400; }

/* 行业标签 */
.xxt-fb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.xxt-fb-tag {
  padding: 7px 12px;
  border: 1px solid #e8e8e8;
  border-radius: 999px;
  background: #fafafa;
  font-size: 12px;
  color: #595959;
  cursor: pointer;
  transition: all 0.25s var(--xxt-fb-ease);
  user-select: none;
}
.xxt-fb-tag:hover {
  border-color: #91caff;
  background: #f0f7ff;
  color: #1677ff;
}
.xxt-fb-tag.active {
  border-color: #1677ff;
  background: linear-gradient(135deg, #e6f4ff, #f0f7ff);
  color: #0958d9;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
}

/* 点选位置 */
.xxt-fb-pick-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.xxt-fb-pick-btn {
  flex: 1;
  min-width: 140px;
  padding: 10px 14px;
  border: 1px dashed #91caff;
  border-radius: 12px;
  background: #fafcff;
  color: #1677ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--xxt-fb-ease);
}
.xxt-fb-pick-btn:hover { background: #e6f4ff; border-style: solid; }
.xxt-fb-pick-btn.active {
  background: #1677ff;
  color: #fff;
  border-style: solid;
  border-color: #1677ff;
}
.xxt-fb-target-chip {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 10px;
  font-size: 12px;
  color: #d46b08;
  margin-bottom: 12px;
  animation: xxtChipIn 0.3s var(--xxt-fb-ease);
}
.xxt-fb-target-chip.show { display: flex; }
.xxt-fb-target-chip button {
  margin-left: auto;
  border: none;
  background: none;
  color: #999;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
@keyframes xxtChipIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 优先级 */
.xxt-fb-priority {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.xxt-fb-pri {
  flex: 1;
  padding: 8px;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  background: #fafafa;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s var(--xxt-fb-ease);
}
.xxt-fb-pri:hover { border-color: #d9d9d9; }
.xxt-fb-pri.active {
  border-color: #1677ff;
  background: #e6f4ff;
  color: #0958d9;
  font-weight: 600;
}
.xxt-fb-pri.urgent.active { border-color: #ff4d4f; background: #fff2f0; color: #cf1322; }

/* 输入框 */
.xxt-fb-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 110px;
  padding: 14px 16px;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.65;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.25s, box-shadow 0.25s;
  background: #fafafa;
}
.xxt-fb-field textarea:focus {
  outline: none;
  border-color: #1677ff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}
.xxt-fb-char-count {
  text-align: right;
  font-size: 11px;
  color: #bfbfbf;
  margin-top: 6px;
}

.xxt-fb-footer-single { padding-top: 16px; }
.xxt-fb-btn-block {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(22, 119, 255, 0.35);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  position: relative;
  overflow: hidden;
}
.xxt-fb-btn-block:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(22, 119, 255, 0.45);
}
.xxt-fb-btn-block:active:not(:disabled) { transform: translateY(0); }
.xxt-fb-btn-block:disabled { opacity: 0.65; cursor: not-allowed; }
.xxt-fb-btn-block.loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  right: 18px;
  top: 50%;
  margin-top: -9px;
  animation: xxtSpin 0.7s linear infinite;
}
@keyframes xxtSpin { to { transform: rotate(360deg); } }

/* 点选模式 */
body.xxt-fb-picking { cursor: crosshair !important; }
body.xxt-fb-picking * { cursor: crosshair !important; }
body.xxt-fb-picking .xxt-fb-fab,
body.xxt-fb-picking .xxt-fb-overlay,
body.xxt-fb-picking .xxt-fb-pick-hint { cursor: default !important; }
.xxt-fb-pick-hint {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2147483003;
  padding: 10px 20px;
  background: #1677ff;
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(22, 119, 255, 0.4);
  animation: xxtFabIn 0.4s var(--xxt-fb-ease);
  pointer-events: none;
}
.xxt-fb-pick-highlight {
  outline: 2px solid #1677ff !important;
  outline-offset: 2px !important;
  background: rgba(22, 119, 255, 0.08) !important;
}

/* Toast */
.xxt-fb-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px) scale(0.95);
  z-index: 2147483004;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  opacity: 0;
  transition: all 0.4s var(--xxt-fb-ease);
  pointer-events: none;
  font-family: inherit;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.xxt-fb-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
.xxt-fb-toast.ok { background: linear-gradient(135deg, #52c41a, #389e0d); }
.xxt-fb-toast.err { background: linear-gradient(135deg, #ff4d4f, #cf1322); }

/* 成功态 */
.xxt-fb-success {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 36px 24px;
  text-align: center;
  animation: xxtFabIn 0.5s var(--xxt-fb-ease);
}
.xxt-fb-success.show { display: flex; }
.xxt-fb-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b7eb8f, #52c41a);
  color: #fff;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(82, 196, 26, 0.35);
}
.xxt-fb-success h4 { margin: 0 0 8px; font-size: 18px; color: #1f1f1f; }
.xxt-fb-success p { margin: 0; font-size: 13px; color: #8c8c8c; line-height: 1.6; }
.xxt-fb-success .xxt-fb-id {
  margin-top: 12px;
  padding: 6px 14px;
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  border-radius: 8px;
  font-size: 13px;
  color: #389e0d;
  font-weight: 600;
}
