/* Top bar: brand, page title, then the appearance switch and the 檢查 status at the right edge.
   The bar, brand, divider and status button rules are copied from
   Website/CreatorTool/Styles/topbar.css with identical values (re-copy when it changes); the bar
   is sticky here because the page scrolls as a document. */
.topbar {
  z-index: var(--z-topbar);
  position: sticky;
  top: 0;
  flex: none;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: var(--space-7);
  padding: 0 var(--space-7) 0 var(--space-8);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex: none;
}
.brand-mark {
  width: 28px;
  height: 28px;
  display: block;
}
/* The wordmark ignores the 字型 preset: it is brand text, not interface or reading text. */
.brand-name {
  font: 700 var(--font-size-xl)/1 var(--font-brand);
  letter-spacing: var(--fp-tracking-zh-wordmark);
}
.topbar-divider {
  flex: none;
  width: 1px;
  height: 24px;
  background: var(--color-border);
}
.topbar-spacer {
  flex: 1 1 0;
  min-width: 0;
}
/* The page name uses the serif role, like the creator workspace's story title. */
.page-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 var(--font-size-md)/1.2 var(--font-serif);
}
/* 外觀: the pressed half gets the same raised thumb as the creator workspace's theme switch. */
.segmented.theme-switch > button {
  height: 34px;
  padding: 0 var(--space-6);
  font-size: var(--font-size-sm);
}
.segmented.theme-switch > button[aria-pressed="true"] {
  background: var(--color-surface);
  box-shadow: var(--shadow-thumb);
  color: var(--color-text);
  font-weight: 700;
}

/* Diagnostics button */
.diagnostics-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  flex: none;
  height: var(--control-height);
  padding: 0 var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}
.diagnostics-button .icon {
  width: 16px;
  height: 16px;
}
.diagnostics-button[data-tone="ok"] {
  border-color: var(--color-positive-border);
  color: var(--color-positive);
}
.diagnostics-button[data-tone="error"],
.diagnostics-button[data-tone="warning"] {
  border-color: var(--color-accent-ring);
  color: var(--color-attention);
}
.diagnostics-button:hover,
.diagnostics-button[aria-expanded="true"] {
  background: var(--color-hover);
}
.diagnostics-count {
  display: none;
}
