/* 统一顶部极克制总—分切换栏（38px，不干扰宿主应用样式） */
:root {
  --gf-bar-h: 38px;
}

#gf-portal-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--gf-bar-h);
  z-index: 2147483000;
  background: linear-gradient(90deg, rgba(11, 17, 32, 0.98) 0%, rgba(15, 23, 42, 0.96) 55%, rgba(17, 24, 39, 0.98) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 12.5px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 10px;
  box-sizing: border-box;
}

#gf-portal-bar *,
#gf-portal-bar *::before,
#gf-portal-bar *::after {
  box-sizing: border-box;
}

.gf-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.gf-bar-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #f8fafc;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.gf-bar-brand:hover {
  color: #93c5fd;
}

.gf-bar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
  flex-shrink: 0;
}

.gf-bar-sep {
  color: rgba(148, 163, 184, 0.45);
  flex-shrink: 0;
}

.gf-bar-scene {
  color: #e2e8f0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gf-bar-tag {
  font-size: 11px;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.gf-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.gf-bar-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gf-bar-btn:hover {
  background: rgba(51, 65, 85, 0.98);
  border-color: rgba(148, 163, 184, 0.5);
  color: #ffffff;
}

.gf-bar-btn.gf-primary {
  background: rgba(37, 99, 235, 0.26);
  border-color: rgba(96, 165, 250, 0.55);
  color: #dbeafe;
}

.gf-bar-btn.gf-primary:hover {
  background: rgba(37, 99, 235, 0.44);
  color: #ffffff;
}

.gf-switcher-wrap {
  position: relative;
}

.gf-switcher-menu {
  position: fixed;
  top: calc(var(--gf-bar-h) + 6px);
  right: 12px;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - var(--gf-bar-h) - 24px);
  overflow-y: auto;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 20px 44px -12px rgba(15, 23, 42, 0.28);
  padding: 10px;
  z-index: 2147483001;
  display: none;
}

.gf-switcher-menu.open {
  display: block;
}

.gf-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 8px;
}

.gf-menu-head strong {
  font-size: 13px;
  color: #0f172a;
}

.gf-menu-head span {
  font-size: 11px;
  color: #64748b;
}

.gf-menu-group {
  margin-bottom: 8px;
}

.gf-menu-group-title {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  padding: 4px 8px;
  letter-spacing: 0.02em;
}

.gf-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 8px;
  text-decoration: none;
  color: #0f172a;
  transition: background 0.14s ease;
}

.gf-menu-item:hover {
  background: #f1f5f9;
}

.gf-menu-item.current {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.gf-menu-item.planned {
  opacity: 0.62;
  cursor: default;
}

.gf-menu-item.planned:hover {
  background: transparent;
}

.gf-menu-item-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.gf-menu-item-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
}

.gf-menu-item-sub {
  font-size: 11px;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.gf-menu-pill {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.gf-menu-pill.live {
  background: #eff6ff;
  color: #1d4ed8;
}

.gf-menu-pill.here {
  background: #1d4ed8;
  color: #ffffff;
}

.gf-menu-pill.soon {
  background: #f1f5f9;
  color: #64748b;
}

.gf-menu-foot {
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.gf-menu-hub-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.gf-menu-hub-link:hover {
  background: #1e293b;
}

body.gf-has-portal-bar {
  padding-top: var(--gf-bar-h) !important;
}

@media (max-width: 680px) {
  #gf-portal-bar {
    padding: 0 10px;
  }
  .gf-bar-tag,
  .gf-bar-copy-btn {
    display: none !important;
  }
  .gf-bar-scene {
    max-width: 120px;
  }
}

/* 跨站共享 AI 执行轨迹、红线阻断引导与线性图标基础样式（含 store） */
.gf-svg-ic {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: -0.15em;
}

.ga-ai-trace {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 10px;
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.03) 0%, rgba(37, 99, 235, 0.045) 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 11.5px;
  line-height: 1.4;
}

.ga-trace-lead {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: #1d4ed8;
  white-space: nowrap;
  padding-right: 6px;
  border-right: 1px solid rgba(15, 23, 42, 0.1);
}

.ga-trace-steps {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.ga-trace-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: #334155;
  font-weight: 500;
}

.ga-trace-step i {
  font-style: normal;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
}

.ga-trace-step.is-ok i {
  background: #d1fae5;
  color: #047857;
}

.ga-trace-step.is-warn {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
  font-weight: 600;
}

.ga-trace-step.is-warn i {
  background: #fee2e2;
  color: #dc2626;
}

.ga-trace-arrow {
  color: #94a3b8;
  font-size: 10.5px;
}

.ga-block-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 4px 9px;
  border-radius: 7px;
  margin-right: 4px;
  white-space: nowrap;
}

.ga-block-hint i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
  flex-shrink: 0;
}

/* 联系作者入口按钮与美化微信二维码弹窗 */
.gf-bar-contact-btn {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(56, 189, 248, 0.42);
  color: #e0f2fe;
}

.gf-bar-contact-btn:hover {
  background: rgba(14, 165, 233, 0.32);
  border-color: rgba(125, 211, 252, 0.72);
  color: #ffffff;
}

.gf-contact-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483002;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

.gf-contact-modal.open {
  display: flex;
}

.gf-contact-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.gf-contact-dialog {
  position: relative;
  width: min(340px, 100%);
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 20px;
  padding: 26px 24px 24px;
  text-align: center;
  box-shadow: 0 28px 60px -16px rgba(15, 23, 42, 0.36);
}

.gf-contact-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.gf-contact-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.gf-contact-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #0284c7;
  margin-bottom: 6px;
}

.gf-contact-dialog h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.gf-contact-dialog p {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: #475569;
  line-height: 1.5;
}

.gf-qr-frame {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid rgba(2, 132, 199, 0.22);
  box-shadow: 0 14px 30px -16px rgba(2, 132, 199, 0.35);
}

.gf-qr-plate {
  position: relative;
  background: #ffffff;
  padding: 10px;
  border-radius: 13px;
  box-shadow: 0 4px 14px -4px rgba(15, 23, 42, 0.08);
}

.gf-qr-plate img {
  width: 188px;
  height: 188px;
  display: block;
  border-radius: 6px;
  object-fit: contain;
}

.gf-qr-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #0284c7;
  border-style: solid;
  pointer-events: none;
}

.gf-qr-corner.tl { top: 4px; left: 4px; border-width: 2.5px 0 0 2.5px; border-radius: 4px 0 0 0; }
.gf-qr-corner.tr { top: 4px; right: 4px; border-width: 2.5px 2.5px 0 0; border-radius: 0 4px 0 0; }
.gf-qr-corner.bl { bottom: 4px; left: 4px; border-width: 0 0 2.5px 2.5px; border-radius: 0 0 0 4px; }
.gf-qr-corner.br { bottom: 4px; right: 4px; border-width: 0 2.5px 2.5px 0; border-radius: 0 0 4px 0; }

.gf-qr-cap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #0369a1;
}

.gf-qr-cap i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
