/* ============================================================
 * topbar.css · v11.9.100
 * 全平台统一顶栏样式 — 所有页面同源同位置
 *
 * 期望 markup:
 *   <header class="topbar">
 *     <div class="topbar-inner">
 *       <a class="brand" href="/">
 *         <span class="brand-name">DesignAI</span>
 *         <span class="brand-sep">·</span>
 *         <span class="brand-page">XX</span>
 *       </a>
 *       <nav class="topbar-nav">
 *         <a href="..." class="...">工业 / 平面设计</a>
 *         ...
 *       </nav>
 *       <div class="topbar-meta">
 *         <!-- auth_gate / wallet / kbd 等右侧元素 -->
 *       </div>
 *     </div>
 *   </header>
 *
 * 颜色变量(若页面未定义,使用兜底):
 *   --ink, --ink-muted, --ink-faint, --line, --accent, --accent-grad
 *   --serif, --sans, --mono, --t-fast
 * ============================================================ */

.topbar {
  border-bottom: 1px solid var(--line, #e6e6e0);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* Brand 左侧:DesignAI · <页面名> */
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}
.brand-name {
  font-family: var(--serif, 'Cormorant Garamond', 'Times New Roman', serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink, #1a1a1a);
  letter-spacing: -0.01em;
  font-style: italic;
}
.brand-sep {
  color: var(--ink-faint, #c0c0b8);
  font-size: 14px;
}
.brand-page {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 11px;
  color: var(--ink-faint, #9a9a93);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Nav 中部 */
.topbar-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  flex: 1 1 auto;
  justify-content: center;
  margin: 0;
}
.topbar-nav a {
  font-family: var(--sans, -apple-system, 'PingFang SC', sans-serif);
  font-size: 13px;
  color: var(--ink-muted, #6a6a63);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.18s;
  position: relative;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.topbar-nav a:hover { color: var(--ink, #1a1a1a); background: transparent; }
.topbar-nav a.active { color: var(--ink, #1a1a1a); }
.topbar-nav a.active::after {
  content: "";
  position: absolute;
  bottom: -22px;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--accent-grad, linear-gradient(90deg, #7b5ab3, #9572d3));
}
.topbar-nav a svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

/* Meta 右侧:auth_gate.js 会往里塞钱包/头像;recipe 等也可塞 back-link */
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.topbar-meta kbd {
  font-family: var(--mono, monospace);
  font-size: 10.5px;
  color: var(--ink-muted, #6a6a63);
  background: #fafaf7;
  border: 1px solid var(--line, #e6e6e0);
  border-radius: 4px;
  padding: 2px 5px;
}
.topbar-meta .back-link {
  font-family: var(--sans, sans-serif);
  font-size: 12.5px;
  color: var(--ink-muted, #6a6a63);
  text-decoration: none;
  transition: color 0.18s;
}
.topbar-meta .back-link:hover { color: var(--ink, #1a1a1a); }

/* 平板 */
@media (max-width: 980px) {
  .topbar-inner { padding: 14px 20px; gap: 18px; }
  .topbar-nav { gap: 20px; }
  .topbar-nav a { font-size: 12.5px; }
}
