/* 全站圈选截图反馈 overlay */

.tb-fb-root {
  --tb-fb-ink: #1f2937;
  --tb-fb-muted: #6b7280;
  --tb-fb-line: #e5e7eb;
  --tb-fb-hl: #fbbc04;
  --tb-fb-accent: #ff522b;
  --tb-fb-accent-h: #e44624;
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
  overflow: hidden;
}

.tb-fb-stage {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}
/* 关闭态必须彻底退出层叠，避免挡住 z-index:10001 的顶部公告条 */
.tb-fb-root[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: 0 !important;
  inset: auto !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}
.tb-fb-root:not(.is-live) .tb-fb-stage,
.tb-fb-root:not(.is-live) .tb-fb-dialog,
.tb-fb-root:not(.is-live) .tb-fb-wait {
  display: none !important;
}

.tb-fb-root.is-live {
  background: transparent;
}

.tb-fb-freeze {
  display: none;
}

.tb-fb-veil {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  pointer-events: none;
}

.tb-fb-annots,
.tb-fb-draw,
.tb-fb-hover {
  position: absolute;
  pointer-events: none;
}

.tb-fb-region {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
}
.tb-fb-region.is-hl {
  border: 2px solid var(--tb-fb-hl);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.tb-fb-region.is-bo {
  background: #000;
  border: 2px solid #3c4043;
}
.tb-fb-region-x {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #374151;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  font-size: 12px;
}
.tb-fb-region-x:hover {
  background: #111827;
}

.tb-fb-draw,
.tb-fb-hover {
  border: 2px solid var(--tb-fb-hl);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.tb-fb-hover {
  border-style: dashed;
}
.tb-fb-draw.is-bo,
.tb-fb-hover.is-bo {
  background: rgba(0, 0, 0, 0.72);
  border-color: #3c4043;
}

.tb-fb-wait {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  z-index: 7;
  pointer-events: auto;
}
.tb-fb-wait[hidden] {
  display: none !important;
}
.tb-fb-wait-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.05rem 1.2rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 22rem;
  font-size: 0.875rem;
  color: var(--tb-fb-muted);
}
.tb-fb-wait-card p {
  margin: 0;
}
.tb-fb-spin {
  width: 22px;
  height: 22px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--tb-fb-accent);
  border-radius: 50%;
  animation: tb-fb-rot 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes tb-fb-rot {
  to {
    transform: rotate(360deg);
  }
}

.tb-fb-dialog {
  position: fixed;
  z-index: 6;
  width: min(368px, calc(100vw - 24px));
  background: #fff;
  color: var(--tb-fb-ink);
  border-radius: 14px;
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.12),
    0 12px 32px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  pointer-events: auto;
}
.tb-fb-dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.7rem 0.5rem 1rem;
  cursor: move;
  user-select: none;
}
.tb-fb-dialog-bar h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.tb-fb-icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--tb-fb-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.tb-fb-icon-btn:hover {
  background: #f3f4f6;
  color: var(--tb-fb-ink);
}
.tb-fb-icon-btn .iconfont {
  font-size: 16px;
}

.tb-fb-step {
  padding: 0 1rem 0.95rem;
}
.tb-fb-label {
  display: block;
  font-size: 0.75rem;
  color: var(--tb-fb-muted);
  margin-bottom: 0.35rem;
}
#tbFbText {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  border: 1px solid var(--tb-fb-line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: inherit;
  background: #fff;
  outline: none;
}
#tbFbText:focus {
  border-color: rgba(255, 82, 43, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 82, 43, 0.14);
}

.tb-fb-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.75rem 0 0.65rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.tb-fb-check input {
  accent-color: var(--tb-fb-accent);
}

.tb-fb-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.tb-fb-tool {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--tb-fb-line);
  background: #fff;
  border-radius: 8px;
  padding: 0.45rem 0.4rem;
  font-size: 0.78rem;
  color: var(--tb-fb-ink);
  cursor: pointer;
  font-family: inherit;
}
.tb-fb-tool .iconfont {
  font-size: 14px;
}
.tb-fb-tool.is-on {
  border-color: var(--tb-fb-accent);
  color: var(--tb-fb-accent);
  background: rgba(255, 82, 43, 0.08);
}
.tb-fb-tip {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: var(--tb-fb-muted);
  line-height: 1.4;
  min-height: 2em;
}

.tb-fb-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.85rem;
}
.tb-fb-btn {
  border: 0;
  background: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.tb-fb-btn-text {
  color: var(--tb-fb-muted);
}
.tb-fb-btn-text:hover {
  background: #f3f4f6;
  color: var(--tb-fb-ink);
}
.tb-fb-btn-solid {
  background: var(--tb-fb-accent);
  color: #fff;
}
.tb-fb-btn-solid:hover {
  background: var(--tb-fb-accent-h);
}
.tb-fb-btn-solid:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tb-fb-preview-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--tb-fb-muted);
}
.tb-fb-preview-shot {
  border: 1px solid var(--tb-fb-line);
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}
.tb-fb-preview-shot img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  object-position: top center;
}
.tb-fb-preview-desc {
  margin: 0.65rem 0 0;
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.tb-fb-meta {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
}
.tb-fb-meta div {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.2rem;
}
.tb-fb-meta dt {
  color: var(--tb-fb-muted);
  width: 2.4rem;
  flex-shrink: 0;
}
.tb-fb-meta dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-fb-legal {
  margin: 0.7rem 0 0;
  font-size: 0.68rem;
  color: var(--tb-fb-muted);
  line-height: 1.45;
}
.tb-fb-thanks {
  text-align: center;
  padding: 0.75rem 0 0.25rem;
}
.tb-fb-thanks .iconfont {
  font-size: 2rem;
  color: #0f766e;
}
.tb-fb-thanks h3 {
  margin: 0.4rem 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.tb-fb-thanks p {
  margin: 0;
  color: var(--tb-fb-muted);
  font-size: 0.85rem;
}
.tb-fb-thanks a {
  color: var(--tb-fb-accent);
}

body.tb-fb-open .tb-backtop,
body.tb-fb-open .sf-wx-modal {
  visibility: hidden !important;
}

.tb-fb-root.is-draw {
  cursor: crosshair;
}
.tb-fb-root.is-pan {
  cursor: default;
}

html.tb-fb-draw-cursor,
html.tb-fb-draw-cursor body {
  cursor: crosshair;
}
html.tb-fb-draw-cursor .tb-fb-dialog,
html.tb-fb-draw-cursor .tb-fb-dialog * {
  cursor: auto;
}

.tb-fb-root.is-capturing .tb-fb-stage,
.tb-fb-root.is-capturing .tb-fb-dialog {
  visibility: hidden;
}

.nice-dark-mode .tb-fb-dialog,
.nice-dark-mode .tb-fb-wait-card {
  background: #23272e;
  color: #f2f4f7;
  --tb-fb-ink: #f2f4f7;
  --tb-fb-muted: #a8b0bd;
  --tb-fb-line: rgba(255, 255, 255, 0.12);
}
.nice-dark-mode #tbFbText {
  background: #1b1f25;
  color: #f2f4f7;
  border-color: var(--tb-fb-line);
}
.nice-dark-mode .tb-fb-tool {
  background: #1b1f25;
  color: #f2f4f7;
  border-color: var(--tb-fb-line);
}
.nice-dark-mode .tb-fb-icon-btn:hover,
.nice-dark-mode .tb-fb-btn-text:hover {
  background: rgba(255, 255, 255, 0.08);
}
.nice-dark-mode .tb-fb-wait {
  background: rgba(15, 18, 22, 0.55);
}

@media (max-width: 640px) {
  .tb-fb-dialog {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0;
    width: 100%;
    max-width: none;
    border-radius: 16px 16px 0 0;
    cursor: default;
  }
  .tb-fb-dialog-bar {
    cursor: default;
  }
}
