/* ===== topbar.css : 页头导航栏（.app-topbar）样式 ===== */
.brand-mark{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.app-topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  margin: 0;
  min-height: 64px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  /* 浅科技蓝玻璃 topbar（参考图风格） */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(234, 246, 251, 0.62)),
    rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(6, 63, 180, 0.14);
  box-shadow: 0 6px 20px rgba(6, 63, 180, 0.08);
  backdrop-filter: blur(16px);
}
.app-topbar-left{
  display: flex;
  align-items: center;
  min-width: 0;
}
.app-topbar-brand{
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.app-topbar-logo{
  display: block;
  width: 148px;
  height: auto;
  max-height: 36px;
  object-fit: contain;
}
.app-topbar-title{
  color: #063fb4;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.app-topbar-subtitle{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.app-topbar-right{
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.app-topbar-chip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 14px;
  color: #063fb4;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid rgba(6, 63, 180, 0.16);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 4px 14px rgba(6, 63, 180, 0.08);
}
.brand-lockup{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-mark{
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}
.brand-mark-large{
  width: 56px;
  height: 56px;
}
.brand-mark-small{
  width: 30px;
  height: 30px;
}
.brand-mark-svg{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-wordmark{
  color: inherit;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}
.login-brand-lockup .brand-wordmark{
  font-size: 34px;
}
/* User-facing shell refinement. No admin stylesheet imports this file. */
.app-topbar {
  min-height: 66px;
  padding: 0 26px;
  border-bottom-color: rgba(10, 99, 216, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 250, 255, 0.74)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 28px rgba(12, 72, 138, 0.08);
  backdrop-filter: blur(18px);
}

.app-topbar-right {
  gap: 8px;
}

.app-topbar-chip {
  min-height: 34px;
  padding: 0 12px;
  border-color: rgba(10, 99, 216, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: none;
  transition:
    transform 0.24s ease-out,
    border-color 0.24s ease-out,
    background 0.24s ease-out,
    box-shadow 0.24s ease-out;
}

.saas-shell-message-link {
  position: relative;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  color: #344054;
  background: #ffffff;
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.saas-shell-message-link:hover,
.saas-shell-message-link:focus-visible {
  border-color: rgba(37, 99, 235, .28);
  color: #1d4ed8;
  background: #f8fbff;
  outline: none;
}

.saas-shell-message-badge {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #ef4444;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.saas-shell-message-badge[hidden] {
  display: none;
}

.app-topbar-chip:hover {
  border-color: rgba(22, 139, 255, 0.28);
  background: #fff;
  box-shadow: 0 8px 18px rgba(12, 82, 157, 0.1);
  transform: translateY(-2px);
}

.app-topbar-chip:active {
  transform: scale(0.98);
}

.app-mobile-nav-toggle {
  display: none;
}

.agent-mobile-history-toggle {
  display: none;
}

.saas-shell-upgrade {
  font-family: inherit;
  cursor: pointer;
}

.saas-shell-workspace.is-brand {
  padding: 4px 10px;
  border-color: rgba(112, 137, 255, .2) !important;
  background: #0b1020 !important;
}

.saas-shell-workspace-logo {
  display: block;
  width: 96px;
  height: auto;
  max-height: 24px;
  object-fit: contain;
  object-position: center;
}

.support-contact-dialog {
  width: min(680px, calc(100% - 24px));
  max-width: 680px;
}

.modal-content.support-contact-modal {
  --support-modal-bg: #10131a;
  --support-modal-band: #171b24;
  --support-modal-card: #1b202a;
  --support-modal-card-hover: #232a35;
  --support-modal-border: rgba(148, 163, 184, .2);
  overflow: hidden;
  border: 1px solid var(--support-modal-border) !important;
  border-radius: 8px !important;
  color: var(--hx-workbench-text-secondary, #c4c9d1);
  background: var(--support-modal-bg) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .56) !important;
}

.support-contact-header {
  align-items: center;
  padding: 18px 20px;
  border-bottom-color: var(--support-modal-border);
  background: var(--support-modal-band);
}

.support-contact-header .btn-close {
  opacity: .68;
}

.support-contact-header .btn-close:hover,
.support-contact-header .btn-close:focus-visible {
  opacity: 1;
}

.support-contact-title-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
}

.support-contact-logo {
  display: block;
  width: min(180px, 58vw);
  height: auto;
  max-height: 44px;
  object-fit: contain;
  object-position: left center;
}

.support-contact-body {
  padding: 18px 20px;
  background: var(--support-modal-bg) !important;
}

.support-contact-qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.support-contact-qr-card {
  display: grid;
  min-width: 0;
  padding: 14px;
  place-items: center;
  gap: 12px;
  border: 1px solid var(--support-modal-border);
  border-radius: 8px;
  background: var(--support-modal-card);
}

.support-contact-qr-card:first-child {
  border-top-color: rgba(34, 197, 94, .52);
}

.support-contact-qr-card.is-wecom {
  border-top-color: rgba(96, 165, 250, .55);
}

.support-contact-qr-heading {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
}

.support-contact-qr-heading i {
  color: #22c55e;
  font-size: 20px;
}

.support-contact-qr-card.is-wecom .support-contact-qr-heading i {
  color: #60a5fa;
}

.support-contact-qr-heading h3 {
  margin: 0;
  color: var(--hx-workbench-text, #f4f6f8);
  font-size: 14px;
  font-weight: 800;
}

.support-contact-qr-image {
  display: block;
  width: min(164px, 100%);
  aspect-ratio: 1 / 1;
  border: 6px solid #ffffff;
  border-radius: 6px;
  background: #ffffff;
  object-fit: contain;
}

.support-contact-list {
  display: grid;
  margin-top: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.support-contact-item {
  display: grid;
  min-width: 0;
  min-height: 68px;
  padding: 10px 12px;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  border: 1px solid var(--support-modal-border);
  border-radius: 8px;
  color: var(--hx-workbench-text-secondary, #c4c9d1);
  background: var(--support-modal-card);
  text-decoration: none;
}

.support-contact-item > i {
  grid-row: 1 / 3;
  color: var(--hx-workbench-ai-blue, #3b82f6);
  font-size: 19px;
}

.support-contact-item > span {
  color: var(--hx-workbench-text-muted, #858c99);
  font-size: 11px;
}

.support-contact-item > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--hx-workbench-text, #f4f6f8);
  font-size: 12px;
  font-weight: 700;
}

a.support-contact-item:hover,
a.support-contact-item:focus-visible {
  border-color: rgba(96, 165, 250, .55);
  color: var(--hx-workbench-text, #f4f6f8);
  background: var(--support-modal-card-hover);
  outline: none;
}

.support-contact-footer {
  padding: 12px 20px;
  border-top-color: var(--support-modal-border);
  background: var(--support-modal-band);
}

.support-contact-online {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  border-color: transparent;
  background: #2563eb;
  font-weight: 700;
}

.support-contact-online:hover,
.support-contact-online:focus-visible {
  border-color: transparent;
  background: #1d4ed8;
}

@media (max-width: 520px) {
  .support-contact-dialog {
    width: calc(100% - 16px);
    margin-right: 8px;
    margin-left: 8px;
  }

  .support-contact-qr-grid,
  .support-contact-list {
    grid-template-columns: 1fr;
  }

  .support-contact-qr-card {
    grid-template-columns: minmax(0, 1fr) 124px;
  }

  .support-contact-qr-heading {
    align-self: start;
  }

  .support-contact-qr-image {
    width: 124px;
  }
}

@media (max-width: 768px) {
  .app-topbar {
    min-height: 56px;
    padding: 0 10px;
    gap: 10px;
    overflow: visible;
  }

  .app-topbar-right {
    display: none;
  }

  .app-topbar-logo {
    width: 124px;
    max-height: 30px;
  }

  .app-mobile-nav-toggle {
    display: inline-grid;
    place-content: center;
    gap: 4px;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--app-mobile-nav-border, rgba(16, 24, 40, .14));
    border-radius: 9px;
    color: var(--app-mobile-nav-color, #344054);
    background: var(--app-mobile-nav-bg, #fff);
    box-shadow: var(--app-mobile-nav-shadow, none);
    cursor: pointer;
    transition:
      transform .18s ease,
      border-color .18s ease,
      color .18s ease,
      background .18s ease,
      box-shadow .18s ease;
  }

  body[data-page="agent"] .agent-mobile-history-toggle.is-visible {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    margin-right: auto;
    padding: 0;
    border: 1px solid rgba(59, 130, 246, .28);
    border-radius: 9px;
    color: #93c5fd;
    background: rgba(30, 41, 59, .92);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
  }

  body[data-page="agent"] .agent-mobile-history-toggle.is-visible:hover,
  body[data-page="agent"] .agent-mobile-history-toggle.is-visible:focus-visible,
  body[data-page="agent"] .agent-mobile-history-toggle.is-visible[aria-expanded="true"] {
    border-color: rgba(96, 165, 250, .68);
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    outline: none;
  }

  body[data-page="agent"] .agent-mobile-history-toggle.is-visible:active {
    transform: scale(.96);
  }

  body[data-page="agent"].mobile-history-open .agent-mobile-history-toggle {
    position: fixed;
    z-index: 141;
    top: 10px;
    left: 12px;
    margin: 0;
  }

  .app-mobile-nav-toggle span {
    display: block;
    width: 16px;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .18s ease, opacity .18s ease;
  }

  .app-mobile-nav-toggle:hover {
    border-color: var(--app-mobile-nav-hover-border, rgba(37, 99, 235, .32));
    color: var(--app-mobile-nav-hover-color, #1d4ed8);
    background: var(--app-mobile-nav-hover-bg, #f8fafc);
  }

  .app-mobile-nav-toggle:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--app-mobile-nav-focus, rgba(37, 99, 235, .2));
  }

  .app-mobile-nav-toggle:active {
    transform: scale(.96);
  }

  body.mobile-nav-open .app-mobile-nav-toggle {
    border-color: var(--app-mobile-nav-hover-border, rgba(37, 99, 235, .32));
    color: var(--app-mobile-nav-hover-color, #1d4ed8);
    background: var(--app-mobile-nav-hover-bg, #eff6ff);
    box-shadow: none;
  }

  body.mobile-nav-open .app-mobile-nav-toggle span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
  }

  body.mobile-nav-open .app-mobile-nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.mobile-nav-open .app-mobile-nav-toggle span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
  }
}

/* 2026-08 SaaS user shell pass. Visual only; links and auth hooks unchanged. */
.app-topbar {
  min-height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
  backdrop-filter: blur(14px);
}

.app-topbar-chip {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  box-shadow: none;
}

.app-topbar-chip:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: #f8fbff;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
  color: #1d4ed8;
}

.app-chip-purple,
.app-chip-green,
.app-chip-blue,
.app-chip-orange {
  background: #ffffff;
  color: #344054;
}

#home-credit-chip {
  border-color: rgba(8, 145, 178, 0.2);
  background: #ecfeff;
  color: #0e7490;
}

/* The page sidebar already exposes these entries; keep the topbar focused. */
.app-topbar-right #home-credit-chip,
.app-topbar-right > a.app-chip-green {
  display: none !important;
}

/* Notification entry: keep the unread state visible without competing with the topbar actions. */
.saas-shell-message-link {
  display: inline-flex;
  width: 72px;
  min-height: 36px;
  padding: 0 10px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 8px;
  color: #cbd5e1;
  background: #151922;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

.saas-shell-message-link:hover,
.saas-shell-message-link:focus-visible {
  border-color: rgba(96, 165, 250, .58);
  color: #ffffff;
  background: #202530;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .22);
  outline: none;
}

.saas-shell-message-link > i {
  color: #93c5fd;
  font-size: 16px;
}

.saas-shell-message-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid #0b0f16;
  border-radius: 999px;
  color: #ffffff;
  background: #ef4444;
  font-size: 10px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
}

@media (max-width: 768px) {
  .app-topbar {
    min-height: 56px;
    padding: 0 12px;
  }

  body[data-page="agent"] .app-mobile-nav-toggle {
    width: 38px;
    height: 38px;
    gap: 4px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 10px;
    color: #dbe4ef;
    background: rgba(24, 28, 36, .92);
    box-shadow: none;
  }

  body[data-page="agent"] .app-mobile-nav-toggle span {
    width: 16px;
    height: 1.5px;
  }

  body[data-page="agent"] .app-mobile-nav-toggle:is(:hover, :focus-visible) {
    border-color: rgba(96, 165, 250, .5);
    color: #fff;
    background: #202530;
  }

  body[data-page="agent"].mobile-nav-open .app-mobile-nav-toggle {
    border-color: rgba(96, 165, 250, .55);
    color: #fff;
    background: #202530;
    box-shadow: none;
  }
}
