/* ============================================================
   统一入口 · 使用说明（四端共享）样式
   依赖 /shared/theme.css 的设计令牌，未加载时自动退化为可用样式
   ============================================================ */

/* ---------- 「?」就地帮助图标 ---------- */
.gq-q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 5px; flex: none;
  border-radius: 50%; border: 1px solid var(--border-strong, #cfd6e4);
  background: transparent; color: var(--muted, #8a93a6);
  font-size: 10.5px; font-weight: 700; line-height: 1;
  cursor: pointer; vertical-align: middle; padding: 0;
  font-family: var(--font-sans, system-ui, sans-serif);
  transition: all .15s;
}
.gq-q:hover { color: var(--accent, #4c7dff); border-color: var(--accent, #4c7dff); background: var(--accent-soft, rgba(76,125,255,.1)); }

/* ---------- 气泡 ---------- */
.gq-pop {
  position: fixed; z-index: 9998; max-width: min(420px, 92vw);
  /* 2026-10-16：限高 + 三段式布局（标题固定 / 正文滚动 / 按钮固定）。
     原先无 max-height 且无滚动：多图或长文时气泡超出屏幕被裁掉，滚轮只能滚页面、内容看不全。 */
  max-height: min(72vh, 640px);
  box-sizing: border-box;   /* 让 padding/border 计入高度上限（否则总高会超出 72vh 约 30px） */
  display: flex; flex-direction: column;
  background: var(--surface-solid, #fff); color: var(--text, #1a2233);
  border: 1px solid var(--border-strong, #cfd6e4); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0,0,0,.18); padding: 14px 16px;
  font-family: var(--font-sans, system-ui, sans-serif); font-size: 13px; line-height: 1.75;
}
.gq-pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex: none; }
.gq-pop-title { flex: 1; font-size: 13.5px; font-weight: 700; }
.gq-pop-close { border: none; background: transparent; color: var(--muted, #8a93a6); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.gq-pop-close:hover { color: var(--danger, #e5484d); }
.gq-pop-body {
  white-space: pre-wrap; word-break: break-word; color: var(--text-2, #48526b);
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  overscroll-behavior: contain;   /* 滚到边界时不带动底层页面 */
}
.gq-pop-body::-webkit-scrollbar { width: 8px; }
.gq-pop-body::-webkit-scrollbar-thumb { background: var(--border-strong, #cfd6e4); border-radius: 4px; }
.gq-pop-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; flex: none; }
.gq-img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border, #e3e8f0); margin-top: 8px; display: block; cursor: zoom-in; }
/* 气泡内的单张图片限高：大图不占满整屏（点击仍可放大看原图） */
.gq-pop-body .gq-img { max-height: 42vh; object-fit: contain; }

/* ---------- 弹层 ---------- */
.gq-mask {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  background: rgba(12, 18, 30, .55); padding: 24px; animation: gq-fade .16s ease;
}
@keyframes gq-fade { from { opacity: 0; } to { opacity: 1; } }
.gq-card {
  width: 820px; max-width: 96vw; max-height: 88vh; display: flex; flex-direction: column;
  background: var(--surface-solid, #fff); color: var(--text, #1a2233);
  border: 1px solid var(--border-strong, #cfd6e4); border-radius: 14px; overflow: hidden;
  font-family: var(--font-sans, system-ui, sans-serif);
}
.gq-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border, #e3e8f0); flex: none; }
.gq-head h3 { flex: 1; margin: 0; font-size: 16px; font-weight: 700; }
.gq-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gq-body { padding: 18px 22px 26px; overflow: auto; flex: 1; font-size: 13.5px; line-height: 1.85; }
.gq-body h4 { margin: 18px 0 8px; font-size: 14.5px; color: var(--accent, #4c7dff); }
.gq-body h4:first-child { margin-top: 0; }
.gq-body p { margin: 0 0 10px; white-space: pre-wrap; word-break: break-word; }
.gq-body figure { margin: 12px 0; }
.gq-body figcaption { font-size: 12px; color: var(--muted, #8a93a6); margin-top: 6px; text-align: center; }
.gq-empty { color: var(--muted, #8a93a6); text-align: center; padding: 40px 0; }
.gq-stamp { font-size: 11.5px; color: var(--faint, #a8b0c2); }

/* ---------- 编辑器 ---------- */
.gq-editor { display: flex; flex-direction: column; gap: 10px; }
.gq-field { display: block; }
.gq-field > span { display: block; font-size: 12px; color: var(--muted, #8a93a6); margin-bottom: 5px; }
.gq-input, .gq-textarea {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-strong, #cfd6e4);
  background: var(--surface, #f7f9fc); color: var(--text, #1a2233); resize: vertical;
}
.gq-textarea { min-height: 90px; line-height: 1.7; }
.gq-block { border: 1px solid var(--border, #e3e8f0); border-radius: 9px; padding: 10px 12px; background: var(--surface, #f7f9fc); }
.gq-block-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.gq-block-head .gq-kind { font-size: 11px; color: var(--muted, #8a93a6); flex: 1; }
.gq-mini {
  border: 1px solid var(--border-strong, #cfd6e4); background: transparent; color: var(--muted, #8a93a6);
  border-radius: 6px; padding: 3px 8px; font-size: 11.5px; cursor: pointer; font-family: inherit;
}
.gq-mini:hover { color: var(--accent, #4c7dff); border-color: var(--accent, #4c7dff); }
.gq-mini.danger:hover { color: var(--danger, #e5484d); border-color: var(--danger, #e5484d); }
.gq-btn {
  border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; background: var(--accent, #4c7dff); color: #fff;
}
.gq-btn.ghost { background: transparent; color: var(--muted, #8a93a6); border: 1px solid var(--border-strong, #cfd6e4); }
.gq-btn:disabled { opacity: .5; cursor: not-allowed; }
.gq-msg { font-size: 12.5px; margin-top: 6px; }
.gq-msg.ok { color: var(--ok, #17a673); }
.gq-msg.err { color: var(--danger, #e5484d); }
.gq-lightbox { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.86); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.gq-lightbox img { max-width: 100%; max-height: 100%; }
