/* =========================================================================
 * topvop-app-shell.css — TOPVOP 全站统一 super-bar
 *
 * Wave A · Foundation. 4 业务流分组 nav + 全站 theme toggle + 用户标识占位。
 *
 * 接入(每页 head 内):
 *   <link rel="stylesheet" href="/static/claude-design-system.css">
 *   <link rel="stylesheet" href="/static/topvop-app-shell.css">
 *   <script src="/static/topvop-app-shell.js" defer></script>
 *
 * 注入位置:body 顶部 prepend(不替换现有 header,叠加上方)。
 * 现有页面 header 保留为 page-specific scope。
 * ======================================================================== */

.topvop-shell {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  backdrop-filter: saturate(140%) blur(6px);
}

/* Brand mark — 衬线给一个 "电影杂志" 感 */
.topvop-shell .ts-brand {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 15px;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  padding-right: 8px;
  border-right: 1px solid var(--border);
}
.topvop-shell .ts-brand:hover { color: var(--accent); }
.topvop-shell .ts-brand .ts-brand-sub {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--accent);
  margin-left: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ART v2 · brand ↔ nav 之间的 fleuron 装饰 — 黄金分隔
   R3 (2026-05-14 audit close): unified to ❧ (U+2767) — wider OS-level CJK font
   coverage than ✦ (U+2726) on Windows Microsoft YaHei stack. Same fallback
   chain as .editorial-rule .fleuron to prevent tofu rectangles. */
.topvop-shell .ts-brand::after {
  content: "\2767";
  font-family: "Segoe UI Symbol", "Apple Color Emoji", "Noto Sans Symbols 2",
               var(--font-serif);
  display: inline-block;
  margin-left: 10px;
  color: var(--accent);
  opacity: 0.55;
  font-size: 8px;
  vertical-align: middle;
  transform: translateY(-1px);
}

/* Nav groups — 4 业务流分组 */
.topvop-shell .ts-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.topvop-shell .ts-nav::-webkit-scrollbar { display: none; }

.topvop-shell .ts-group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.topvop-shell .ts-group-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin-right: 6px;
  font-weight: 600;
}

.topvop-shell .ts-link {
  color: var(--muted);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.topvop-shell .ts-link:hover {
  background: var(--surface-2);
  color: var(--text);
}
.topvop-shell .ts-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* Right cluster: theme toggle + user pill */
.topvop-shell .ts-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.topvop-shell .ts-theme-toggle {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.2;
}
.topvop-shell .ts-theme-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.topvop-shell .ts-user-pill {
  font-size: 11.5px;
  color: var(--muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
}

/* Body 上推一格 给 sticky shell 让位(只对设了 sticky 的非 fixed-layout 页有效) */
body.topvop-shell-active { padding-top: 0; }

/* ART v2 · shell 底部一根 φ 微梯度线 — 替代 hard border,光线感
   R2 (2026-05-13 audit close): @supports guard for color-mix() — Safari < 16.2 /
   Chrome < 111 / Firefox < 113 silent-drop the entire linear-gradient declaration
   on parse; fallback restores a 1px hard border-bottom (matches pre-ART shell). */
.topvop-shell {
  border-bottom: 1px solid var(--border); /* baseline fallback */
}
@supports (background: color-mix(in srgb, white, black)) {
  .topvop-shell {
    border-bottom: none;
    background-image: linear-gradient(180deg, var(--surface) 0%,
                                              var(--surface) calc(100% - 1px),
                                              color-mix(in srgb, var(--accent) 22%, transparent) 100%);
  }
}

/* ART v2 · nav active 链接小三角下指示 — 取代纯背景 */
.topvop-shell .ts-link.active {
  position: relative;
}
.topvop-shell .ts-link.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--accent);
}

/* 响应式 — 窄屏 hide 业务流 label,只显示链接 */
@media (max-width: 760px) {
  .topvop-shell { font-size: 12px; gap: 8px; padding: 0 10px; }
  .topvop-shell .ts-group-label { display: none; }
  .topvop-shell .ts-brand .ts-brand-sub { display: none; }
}
@media (max-width: 480px) {
  .topvop-shell .ts-user-pill { display: none; }
}
