/* ==========================================================================
   S66AI 漫剧工作台 V7.0 — 极简高定建筑感工作台体系 (SkillPay Architectural Craft)
   统一导航骨架 · 清晰双页切换（独立选择智能体页 ⇄ 对话工作台页）· 触感物理光影
   ========================================================================== */

:root {
  color-scheme: light;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* SkillPay 建筑白瓷色系 (Default Light) */
  --bg-canvas: #f6f6f7;
  --bg-surface: #ffffff;
  --bg-sidebar: #f1f2f5;
  --bg-elevated: #e9ebf0;
  --bg-hover: rgba(20, 25, 35, 0.048);
  --bg-active: rgba(22, 119, 255, 0.085);

  --ink-primary: #141923;
  --ink-secondary: #525c6e;
  --ink-muted: #8a94a6;
  --ink-inverse: #ffffff;

  --line: #e3e6ee;
  --line-strong: #cdd3e0;

  --brand-accent: #1677ff;
  --brand-accent-soft: rgba(22, 119, 255, 0.1);
  --emerald: #0ca678;
  --amber: #d97706;
  --danger: #e03131;
  --violet: #7048e8;

  --card-gradient: linear-gradient(135deg, #f8f9fb 0%, #ffffff 72%);
  --spotlight-color: rgba(22, 119, 255, 0.06);
  --skill-hover-shadow: -3px -3px 12px 0 #ffffff, 4px 8px 22px 0 rgba(20, 25, 35, 0.1);
  --skill-pressed-shadow: inset 3px 3px 8px 0 rgba(20, 25, 35, 0.12), inset -3px -3px 8px 0 #ffffff;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-float: 0 12px 32px rgba(20, 25, 35, 0.09), 0 2px 6px rgba(20, 25, 35, 0.04);
  --shadow-modal: 0 26px 68px rgba(15, 23, 42, 0.18);

  /* 兼容独立管理后台变量 */
  --bg-root: var(--bg-canvas);
  --text-primary: var(--ink-primary);
  --text-secondary: var(--ink-secondary);
  --text-muted: var(--ink-muted);
  --border-subtle: var(--line);
  --border-strong: var(--line-strong);
  --accent: var(--brand-accent);
  --accent-soft: var(--brand-accent-soft);
}

html.dark {
  color-scheme: dark;
  --bg-canvas: #0e1015;
  --bg-surface: #151820;
  --bg-sidebar: #11131a;
  --bg-elevated: #1e222d;
  --bg-hover: rgba(255, 255, 255, 0.055);
  --bg-active: rgba(56, 189, 248, 0.13);

  --ink-primary: #f2f4f8;
  --ink-secondary: #9da6b8;
  --ink-muted: #667085;
  --ink-inverse: #0c0f14;

  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);

  --brand-accent: #38bdf8;
  --brand-accent-soft: rgba(56, 189, 248, 0.13);
  --emerald: #20c997;
  --amber: #f59e0b;
  --danger: #ff6b6b;
  --violet: #9775fa;

  --card-gradient: linear-gradient(135deg, #14171f 0%, #191d27 100%);
  --spotlight-color: rgba(56, 189, 248, 0.085);
  --skill-hover-shadow: 0 14px 34px rgba(0, 0, 0, 0.52), 0 0 0 1px rgba(255, 255, 255, 0.15);
  --skill-pressed-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.6);
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-float: 0 14px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-modal: 0 30px 76px rgba(0, 0, 0, 0.72);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.28) transparent;
}

html.dark * {
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

/* 全站极简细条滚动条（彻底替换 Windows 刺眼白条，日夜双模式完美融合） */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.24);
  border-radius: 999px;
  transition: background-color 0.2s;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.48);
}
html.dark ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
}
html.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

.app-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ==================== 全局 GPU 鼠标聚光灯效果（零卡顿 translate3d 合成层） ==================== */
.cursor-spotlight-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 38;
  overflow: hidden;
}

.cursor-spotlight-orb {
  position: absolute;
  top: 0;
  left: 0;
  width: 680px;
  height: 680px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  transform: translate3d(-9999px, -9999px, 0);
  transition: opacity 0.35s var(--ease-smooth);
  background: radial-gradient(
    circle,
    rgba(22, 119, 255, 0.068) 0%,
    rgba(14, 165, 233, 0.036) 28%,
    rgba(99, 102, 241, 0.015) 52%,
    transparent 72%
  );
}

html.dark .cursor-spotlight-orb {
  background: radial-gradient(
    circle,
    rgba(56, 189, 248, 0.105) 0%,
    rgba(99, 102, 241, 0.055) 30%,
    rgba(56, 189, 248, 0.018) 55%,
    transparent 74%
  );
}

.cursor-spotlight-orb.active {
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  .cursor-spotlight-layer {
    display: none;
  }
}

/* ==================== 顶部站点导航栏 ==================== */
.site-topbar {
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
  z-index: 40;
}

.topbar-brand-area {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}

.brand-orb {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  flex: 0 0 29px;
  background: url("./brand-logo.svg?v=20261203h") center / cover no-repeat;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  transition: transform 0.28s var(--ease-spring);
}
.brand-link:hover .brand-orb,
.topbar-brand-area:hover .brand-orb {
  transform: scale(1.07) rotate(-4deg);
}

.brand-sep {
  color: var(--line-strong);
}

.brand-studio-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.site-topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-topnav::-webkit-scrollbar { display: none; }

.site-topnav a {
  position: relative;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-secondary);
  white-space: nowrap;
  transition: color 0.16s, background-color 0.16s;
}
.site-topnav a:hover {
  color: var(--ink-primary);
  background: var(--bg-hover);
}
.site-topnav a.active {
  color: var(--ink-primary);
  font-weight: 600;
}
.site-topnav a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==================== 工作台主体（固定左侧导航栏 + 右侧舞台） ==================== */
.workbench-body {
  flex: 1;
  min-height: 0;
  display: flex;
}

.workbench-sidebar {
  width: 288px;
  flex: 0 0 288px;
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  padding: 12px 11px;
  gap: 10px;
  transition: width 0.26s var(--ease-expo), padding 0.26s var(--ease-expo), opacity 0.2s;
  overflow: hidden;
}
.workbench-sidebar.collapsed {
  width: 0;
  flex: 0 0 0;
  padding: 0;
  opacity: 0;
  border-right: none;
}

/* SkillPay 同款高定分段切换控件 + 进页光学聚焦序列 */
@keyframes sidebarItemOpticalIn {
  0% {
    opacity: 0;
    filter: blur(9px);
    transform: translate3d(-10px, 12px, 0) scale(0.968);
  }
  68% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.view-segmented-nav {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: sidebarItemOpticalIn 0.56s var(--ease-expo) 20ms both;
}

.seg-tab {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  padding: 0 6px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: background-color 0.18s var(--ease-smooth), color 0.18s, box-shadow 0.18s;
}
.seg-tab svg {
  flex-shrink: 0;
}
.seg-tab:hover:not(.active) {
  color: var(--ink-primary);
}
.seg-tab.active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  box-shadow: var(--shadow-xs);
}

.seg-count {
  flex-shrink: 0;
  font-size: 10.5px;
  line-height: 1.4;
  padding: 0 5.5px;
  border-radius: 999px;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  font-weight: 700;
}

.seg-live-count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  font-size: 10.5px;
  line-height: 1.4;
  padding: 0 5.5px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: var(--emerald);
  font-weight: 700;
}
.seg-live-count::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: livePulseSoft 1.2s ease-in-out infinite;
}

.new-session-btn {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 37px;
  width: 100%;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.22s var(--ease-spring), box-shadow 0.2s, border-color 0.2s;
  animation: sidebarItemOpticalIn 0.58s var(--ease-expo) 70ms both;
}
.new-session-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 28%, rgba(56, 189, 248, 0.16) 48%, transparent 64%);
  transform: translateX(-115%);
  animation: luxurySheenSweep 1.15s var(--ease-expo) 260ms forwards;
}
.new-session-btn:hover {
  border-color: var(--brand-accent);
  box-shadow: var(--skill-hover-shadow);
  transform: translateY(-1.5px);
}
.new-session-btn:active {
  transform: translateY(0);
  box-shadow: var(--skill-pressed-shadow);
}

.sidebar-search-box {
  flex-shrink: 0;
  animation: sidebarItemOpticalIn 0.58s var(--ease-expo) 115ms both;
}
.sidebar-search-box input {
  width: 100%;
  height: 33px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sidebar-search-box input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px var(--brand-accent-soft);
}

/* ==================== 左侧独立「正在创作中」实时工作流模块 ==================== */
.sidebar-running-module {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--emerald) 34%, var(--line));
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--emerald) 7%, var(--bg-surface)) 0%,
    var(--bg-surface) 100%
  );
  box-shadow: 0 6px 18px rgba(12, 166, 120, 0.08);
  animation: stageFadeUp 0.24s var(--ease-expo) both;
}

html.dark .sidebar-running-module {
  border-color: rgba(32, 201, 151, 0.3);
  background: linear-gradient(145deg, rgba(16, 44, 38, 0.55) 0%, rgba(21, 24, 32, 0.92) 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38);
}

.srm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.srm-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--emerald);
}

.srm-title .live-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: livePulseSoft 1.2s ease-in-out infinite;
}

.srm-count {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6.5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--emerald) 16%, transparent);
  color: var(--emerald);
}

.srm-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 176px;
  overflow-y: auto;
}

.srm-card {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 9px 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color 0.16s, transform 0.16s var(--ease-spring), box-shadow 0.16s;
}

html.dark .srm-card {
  background: rgba(17, 20, 28, 0.88);
}

.srm-card:hover {
  border-color: color-mix(in srgb, var(--emerald) 50%, var(--line));
  transform: translateY(-1px);
}

.srm-card.active {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-accent) 28%, transparent);
}

/* 底部流光进度细条 */
.srm-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--emerald), var(--brand-accent), transparent);
  background-size: 200% 100%;
  animation: srmProgressFlow 2.1s linear infinite;
}

@keyframes srmProgressFlow {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.srm-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.srm-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.srm-stop-btn {
  flex-shrink: 0;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}
.srm-stop-btn:hover {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
}

.srm-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
}

.srm-progress-txt {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--emerald);
  white-space: nowrap;
}

/* ==================== 历史会话记录列表 ==================== */
.sidebar-list-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  animation: sidebarItemOpticalIn 0.58s var(--ease-expo) 150ms both;
}

.prune-empty-btn {
  border: none;
  background: transparent;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.prune-empty-btn:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.count-pill {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--ink-secondary);
}

.sidebar-group-label {
  flex-shrink: 0;
  padding: 6px 8px 2px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.session-history-scroller {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}

.session-card {
  flex-shrink: 0;
  --sb-glow: 0;
  --sb-tx: 0px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8.5px 10px 8.5px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transform: translate3d(var(--sb-tx, 0px), 0, 0);
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.session-card.is-optical-enter,
.srm-card.is-optical-enter,
.sidebar-group-label.is-optical-enter {
  animation: sidebarItemOpticalIn 0.62s var(--ease-expo) var(--sb-delay, 170ms) both;
}
.session-card.is-optical-enter .sc-entry-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    112deg,
    transparent 28%,
    color-mix(in srgb, var(--brand-accent) 12%, rgba(255, 255, 255, 0.22)) 48%,
    transparent 64%
  );
  transform: translateX(-115%);
  animation: luxurySheenSweep 1.1s var(--ease-expo) calc(var(--sb-delay, 170ms) + 140ms) forwards;
}

/* 左侧会话卡片跨项共享 1px 水晶流光折射边框（Raycast / Linear 质感） */
.session-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    160px circle at var(--sb-mx, 50%) var(--sb-my, 50%),
    color-mix(in srgb, var(--brand-accent) 78%, #ffffff),
    transparent 75%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: var(--sb-glow, 0);
  pointer-events: none;
}

.session-card:hover {
  background: var(--bg-hover);
}
.session-card.active {
  background: var(--bg-surface);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}
.session-card.active::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: var(--brand-accent);
  z-index: 2;
}

.sc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.sc-title {
  font-size: 12.8px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.sc-actions {
  display: none;
  align-items: center;
  gap: 2px;
}
.session-card:hover .sc-actions {
  display: inline-flex;
}
.sc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-muted);
}
.sc-agent-tag {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--bg-elevated);
  color: var(--ink-secondary);
  max-width: 135px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--emerald);
}

.sc-live-badge .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  animation: livePulseSoft 1.2s ease-in-out infinite;
}

@keyframes livePulseSoft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.42; }
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.footer-key-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-secondary);
}
.footer-key-link:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
}

/* ==================== 右侧舞台通用动画 ==================== */
.stage-container {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

@keyframes stageFadeUp {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translate3d(0, 14px, 0) scale(0.985);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes visionCardMaterialize {
  0% {
    opacity: 0;
    filter: blur(12px);
    transform: perspective(1400px) translate3d(0, 24px, 0) scale(0.962);
  }
  65% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: perspective(1400px) translate3d(0, 0, 0) scale(1);
  }
}

@keyframes sidebarGlideIn {
  from {
    opacity: 0;
    transform: translate3d(-12px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.workbench-sidebar {
  animation: sidebarGlideIn 0.56s var(--ease-expo) both;
}

.stage-animate-in {
  animation: stageFadeUp 0.42s var(--ease-expo) both;
}

.arch-eyebrow {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

/* ==================== 独立页面 A：Linear / Apple Vision 光学级导演中枢 ==================== */
.agent-select-page {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-canvas);
  padding: clamp(20px, 2.8vw, 32px) clamp(20px, 3.2vw, 40px) 48px;
}

/* Linear 标志性顶置体积光幕（进页时从上方柔和展开） */
.studio-volumetric-cone {
  position: absolute;
  top: -160px;
  left: 50%;
  width: 920px;
  height: 420px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 60% 70% at 50% 25%,
    rgba(22, 119, 255, 0.12) 0%,
    rgba(99, 102, 241, 0.06) 45%,
    transparent 75%
  );
  filter: blur(28px);
  animation: coneUnfold 1.2s var(--ease-expo) both;
}

html.dark .studio-volumetric-cone {
  background: radial-gradient(
    ellipse 62% 72% at 50% 22%,
    rgba(56, 189, 248, 0.16) 0%,
    rgba(139, 92, 246, 0.09) 46%,
    transparent 76%
  );
}

@keyframes coneUnfold {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.84) translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0);
  }
}

.agent-page-inner {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 顶部高定黑曜光学横幅（光学聚焦入场 + 顶边镜面扫光） */
.director-hero-stage {
  position: relative;
  border-radius: 22px;
  padding: 28px 32px;
  background: linear-gradient(140deg, #090d16 0%, #0f172a 55%, #131126 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 22px 50px rgba(9, 13, 22, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(300px, 0.92fr);
  gap: 28px;
  align-items: center;
  overflow: hidden;
  animation: visionCardMaterialize 0.68s var(--ease-expo) both;
}

html.dark .director-hero-stage {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.dhs-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* 进场一次性高定玻璃斜向掠光（克制奢华，绝不廉价频闪） */
.dhs-top-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    108deg,
    transparent 28%,
    rgba(255, 255, 255, 0.09) 46%,
    rgba(186, 230, 253, 0.16) 50%,
    transparent 58%
  );
  transform: translateX(-110%);
  animation: luxurySheenSweep 1.35s var(--ease-expo) 0.18s forwards;
}

@keyframes luxurySheenSweep {
  to {
    transform: translateX(115%);
  }
}

.dhs-ribbon {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  will-change: transform;
}

.dhs-ribbon.ribbon-1 {
  width: 360px;
  height: 220px;
  top: -80px;
  left: -30px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.34) 0%, rgba(37, 99, 235, 0.12) 60%, transparent 78%);
  animation: cinemaRibbonFlow 14s ease-in-out infinite alternate;
}

.dhs-ribbon.ribbon-2 {
  width: 340px;
  height: 220px;
  bottom: -90px;
  right: 8%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.32) 0%, rgba(56, 189, 248, 0.1) 58%, transparent 78%);
  animation: cinemaRibbonFlow 18s ease-in-out infinite alternate-reverse;
}

@keyframes cinemaRibbonFlow {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(32px, 14px, 0) scale(1.09); }
}

.dhs-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.038) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 90% at 72% 50%, #000 18%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 72% 50%, #000 18%, transparent 78%);
}

.dhs-content {
  position: relative;
  z-index: 2;
}

.dhs-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.dhs-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: livePulseSoft 2.2s ease-in-out infinite;
}

.dhs-title {
  margin: 12px 0 8px;
  font-size: clamp(21px, 2.2vw, 27px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  background: linear-gradient(95deg, #ffffff 35%, #bae6fd 82%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dhs-subtitle {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.65;
  color: rgba(226, 232, 240, 0.76);
  max-width: 540px;
}

.dhs-quick-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.dhs-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.22s, border-color 0.22s, transform 0.24s var(--ease-spring);
}
.dhs-map-btn .dhs-arrow {
  transition: transform 0.24s var(--ease-spring);
}
.dhs-map-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(186, 230, 253, 0.55);
  transform: translateY(-1px);
}
.dhs-map-btn:hover .dhs-arrow {
  transform: translateX(3px);
}

.dhs-hint-pill {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.9);
}

/* ==================== 右侧精密光纤脉冲工作流（稳重大气 · 光束穿梭点亮节点） ==================== */
.dhs-optic-pipeline {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 18px;
}

.optic-rail {
  position: absolute;
  left: 4px;
  top: 16px;
  bottom: 16px;
  width: 1.5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.optic-comet {
  position: absolute;
  left: 0;
  top: -36px;
  width: 100%;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent 0%, #38bdf8 55%, #ffffff 100%);
  box-shadow: 0 0 12px #38bdf8;
  animation: opticCometRun 3.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes opticCometRun {
  0% { top: -40px; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: 105%; opacity: 0; }
}

.optic-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9.5px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(12px);
}

.optic-node.node-1 { animation: opticNodeGlow 3.6s ease-in-out 0.15s infinite; }
.optic-node.node-2 { animation: opticNodeGlow 3.6s ease-in-out 1.15s infinite; }
.optic-node.node-3 { animation: opticNodeGlow 3.6s ease-in-out 2.15s infinite; }

@keyframes opticNodeGlow {
  0%, 100% {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(15, 23, 42, 0.56);
  }
  24% {
    border-color: rgba(56, 189, 248, 0.42);
    background: rgba(18, 33, 61, 0.78);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.12);
  }
  52% {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(15, 23, 42, 0.56);
  }
}

.optic-idx {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #bae6fd;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.optic-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.optic-meta strong {
  font-size: 12.5px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.optic-meta span {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.optic-state {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
  flex-shrink: 0;
}
.optic-state.live {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.32);
}

/* 分类筛选与搜索栏 */
.agent-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  animation: visionCardMaterialize 0.64s var(--ease-expo) 0.08s both;
}
.agent-toolbar-row:empty {
  display: none;
}

.category-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.cat-pill {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
.cat-pill:hover:not(.active) {
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}
.cat-pill.active {
  background: var(--ink-primary);
  color: var(--ink-inverse);
  border-color: var(--ink-primary);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.agent-search-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 33px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  color: var(--ink-muted);
}
.agent-search-input-wrap input {
  border: none;
  outline: none;
  background: transparent;
  width: 155px;
  font-size: 12.5px;
  color: var(--ink-primary);
}

/* ==================== 三列光学水晶智能体矩阵（跨卡片近场流光边框 + 物理阻尼惯性） ==================== */
.skillpay-agent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.skillpay-agent-grid[data-count="1"] {
  grid-template-columns: 1fr;
}
.skillpay-agent-grid[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sp-agent-card {
  --card-accent: #0ea5e9;
  --card-accent-2: #2563eb;
  --glow-alpha: 0;
  --spot-alpha: 0;
  position: relative;
  min-height: 244px;
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  cursor: pointer;
  overflow: hidden;
  will-change: transform, box-shadow;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 10px 28px rgba(15, 23, 42, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translate3d(0, var(--ty, 0px), 0);
  transition: box-shadow 0.32s var(--ease-smooth), border-color 0.28s var(--ease-smooth);
  animation: visionCardMaterialize 0.72s var(--ease-expo) var(--delay, 140ms) both;
}

.sp-agent-card.accent-violet {
  --card-accent: #8b5cf6;
  --card-accent-2: #6366f1;
}
.sp-agent-card.accent-emerald {
  --card-accent: #10b981;
  --card-accent-2: #0d9488;
}

html.dark .sp-agent-card {
  background: linear-gradient(160deg, rgba(24, 29, 41, 0.94) 0%, rgba(16, 19, 27, 0.98) 100%);
  border-color: rgba(255, 255, 255, 0.085);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 顶部极细 1px 镜面高光丝线 + 进场一次性水晶掠光（取代呆板粗彩条） */
.sac-top-beam {
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card-accent) 65%, #ffffff), transparent);
  opacity: 0.75;
  pointer-events: none;
}

.sac-entry-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    112deg,
    transparent 30%,
    color-mix(in srgb, var(--card-accent) 10%, rgba(255, 255, 255, 0.22)) 48%,
    transparent 62%
  );
  transform: translateX(-115%);
  animation: luxurySheenSweep 1.2s var(--ease-expo) calc(var(--delay, 140ms) + 180ms) forwards;
}

.sac-main-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  position: relative;
  z-index: 2;
}

/* 内部丝绸聚光层 + Raycast 风格跨卡片近场共享 1px 水晶折射边框 */
.sp-agent-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    380px circle at var(--mx, 50%) var(--my, 30%),
    color-mix(in srgb, var(--card-accent) 11%, transparent),
    transparent 68%
  );
  opacity: var(--spot-alpha, 0);
  pointer-events: none;
  z-index: 0;
}

.sp-agent-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.25px;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 30%),
    color-mix(in srgb, var(--card-accent) 88%, #ffffff),
    transparent 74%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: var(--glow-alpha, 0);
  pointer-events: none;
  z-index: 3;
}

.sp-agent-card:hover {
  box-shadow:
    0 22px 48px rgba(15, 23, 42, 0.1),
    0 6px 18px color-mix(in srgb, var(--card-accent) 12%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

html.dark .sp-agent-card:hover {
  box-shadow:
    0 26px 56px rgba(0, 0, 0, 0.58),
    0 0 32px color-mix(in srgb, var(--card-accent) 14%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.sp-agent-card.is-current {
  border-color: color-mix(in srgb, var(--card-accent) 42%, var(--line-strong));
}

.sac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.sac-icon-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sac-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 26%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--card-accent) 12%, var(--bg-surface)) 0%, var(--bg-surface) 100%);
  display: grid;
  place-items: center;
  font-size: 21px;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--card-accent) 12%, transparent);
  transition: transform 0.36s var(--ease-spring), box-shadow 0.32s;
}
.sp-agent-card:hover .sac-icon {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--card-accent) 24%, transparent);
}

.sac-cat {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sac-status-badge {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  padding: 3.5px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 24%, var(--line));
  background: color-mix(in srgb, var(--card-accent) 8%, var(--bg-surface));
  color: var(--card-accent);
}
.sac-status-badge.current {
  border-color: color-mix(in srgb, var(--emerald) 40%, transparent);
  background: color-mix(in srgb, var(--emerald) 13%, transparent);
  color: var(--emerald);
}

.sac-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.sac-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}

.sac-feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.sac-feat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-canvas);
  color: var(--ink-secondary);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.sac-foot {
  margin-top: auto;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sac-model-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sac-model-note::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--card-accent);
}

.sac-cta-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 15px;
  border-radius: 9px;
  border: none;
  background: var(--ink-primary);
  color: var(--ink-inverse);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--ink-primary) 32%, transparent);
  transform: translateY(-1px);
  transition: transform 0.24s var(--ease-spring), box-shadow 0.24s, background-color 0.24s;
}
.sac-cta-btn .cta-arr {
  display: inline-block;
  transition: transform 0.24s var(--ease-spring);
}
.sp-agent-card:hover .sac-cta-btn {
  background: linear-gradient(135deg, var(--card-accent) 0%, var(--card-accent-2) 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--card-accent) 34%, transparent);
  transform: translateY(-2px);
}
.sp-agent-card:hover .sac-cta-btn .cta-arr {
  transform: translateX(3px);
}

@media (max-width: 920px) {
  .director-hero-stage {
    grid-template-columns: 1fr;
  }
  .dhs-optic-pipeline {
    display: none;
  }
  .skillpay-agent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .skillpay-agent-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== 独立页面 B：对话创作工作台 ==================== */
.chat-workspace-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
}

/* 清晰明确的 1智能体 / 2模型 / 3密钥 顶栏 */
.chat-top-deck {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  background: var(--bg-surface);
  z-index: 20;
}

.deck-steps-bar {
  min-height: 54px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.deck-slot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.slot-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

.slot-sep {
  color: var(--line-strong);
  margin: 0 2px;
}

.slot-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--bg-canvas);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s var(--ease-spring);
}
.slot-trigger:hover {
  border-color: var(--ink-primary);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}

.switch-action-tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.vendor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.vendor-google { background: #1677ff; }
.vendor-openai { background: #10b981; }
.vendor-anthropic { background: #d97706; }

.group-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
}
.group-gemini { background: rgba(22, 119, 255, 0.12); color: var(--brand-accent); }
.group-chatgpt { background: rgba(12, 166, 120, 0.13); color: var(--emerald); }
.group-claude { background: rgba(217, 119, 6, 0.14); color: var(--amber); }

.key-slot-trigger .status-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}
.key-slot-trigger.ready {
  border-color: rgba(12, 166, 120, 0.38);
}
.key-slot-trigger.ready .status-led {
  background: var(--emerald);
}
.key-slot-trigger.managed .status-led {
  background: var(--violet);
}

.deck-right-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.memory-badge {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(12, 166, 120, 0.12);
  color: var(--emerald);
  font-weight: 600;
  white-space: nowrap;
}
.memory-badge.is-warm {
  background: rgba(245, 158, 11, 0.14);
  color: var(--amber);
}

/* 可折叠式 API 密钥抽屉 */
.key-drawer {
  overflow: hidden;
  max-height: 110px;
  opacity: 1;
  border-top: 1px solid var(--line);
  background: var(--bg-canvas);
  transition: max-height 0.3s var(--ease-expo), opacity 0.22s;
}
.key-drawer.collapsed {
  max-height: 0;
  opacity: 0;
  border-top-color: transparent;
}
.key-drawer.flash-attention {
  animation: kdPulse 0.7s ease 2;
}
@keyframes kdPulse {
  0%, 100% { background: var(--bg-canvas); }
  50% { background: rgba(224, 49, 49, 0.09); }
}

.key-drawer-inner {
  padding: 9px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.kd-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  font-size: 12.5px;
}
.kd-badge {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--ink-primary);
  color: var(--ink-inverse);
}
.kd-title { font-weight: 600; }
.kd-scope { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-secondary); cursor: pointer; }
.kd-link { color: var(--brand-accent); font-weight: 600; }

.kd-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 280px;
  max-width: 540px;
}
.kd-input-box {
  flex: 1;
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 6px 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
}
.kd-input-box:focus-within { border-color: var(--ink-primary); }
.kd-input-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: ui-monospace, monospace;
  font-size: 12.5px;
}

/* ==================== 对话视窗与欢迎卡片 ==================== */
.chat-scroll-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 44px 20px 24px;
}

.empty-chat-welcome {
  max-width: 660px;
  margin: 28px auto 20px;
}

.welcome-card {
  padding: 24px 26px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-canvas);
}

.wc-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.wc-avatar {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  display: grid;
  place-items: center;
  font-size: 24px;
  box-shadow: var(--shadow-xs);
}

.wc-label {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.wc-title {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 600;
}

.wc-switch-btn {
  margin-left: auto;
}

.wc-desc {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.wc-quick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-prompt-chip {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring), border-color 0.18s, box-shadow 0.18s;
}
.quick-prompt-chip:hover {
  border-color: var(--line-strong);
  box-shadow: var(--skill-hover-shadow);
  transform: translateX(3px);
}

/* 消息气泡与分镜卡片 */
.message-stream-container {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.msg-card.msg-just-added {
  animation: stageFadeUp 0.22s var(--ease-expo) both;
}

/* 对话流双向视口滚动显现动效（GPU 纯合成层，清晰丝滑、零布局抖动） */
.chat-scroll-reveal {
  opacity: 0;
  transform: translate3d(0, var(--reveal-y, 32px), 0) scale(0.968);
  will-change: opacity, transform;
  transition:
    opacity 0.52s var(--ease-expo),
    transform 0.58s var(--ease-expo);
}
.chat-scroll-reveal.is-in-view {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.msg-card.user {
  align-self: flex-end;
  max-width: min(86%, 720px);
  padding: 13px 18px;
  border-radius: 16px 16px 4px 16px;
  border: 1px solid var(--line);
  background: var(--bg-canvas);
}

.msg-card.assistant {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 18px 22px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.22s var(--ease-smooth), box-shadow 0.22s var(--ease-smooth);
}
.msg-card.assistant.is-streaming-card {
  border-color: rgba(22, 119, 255, 0.28);
  box-shadow: 0 6px 24px rgba(22, 119, 255, 0.06);
}
html.dark .msg-card.assistant.is-streaming-card {
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
}
.msg-card.assistant::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    460px circle at var(--card-mx, 50%) var(--card-my, 50%),
    var(--spotlight-color),
    transparent 68%
  );
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.msg-card.assistant:hover::before {
  opacity: 1;
}
.msg-card.assistant > * {
  position: relative;
  z-index: 1;
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink-muted);
}
.msg-meta-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.msg-role-label {
  font-weight: 600;
  color: var(--ink-primary);
}
.msg-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* 实时跳字字数徽章（等宽数字防抖动） */
.msg-char-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1.5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-canvas);
  color: var(--ink-secondary);
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.msg-char-pill.is-live {
  border-color: rgba(22, 119, 255, 0.32);
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  font-weight: 600;
}
.msg-char-pill .char-live-dot {
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
  background: currentColor;
  animation: livePulseSoft 1s ease-in-out infinite;
}

/* 丝滑流式分段微动效 & 呼吸光束游标 */
.stream-section-enter {
  animation: streamSectionReveal 0.26s var(--ease-expo) both;
}
@keyframes streamSectionReveal {
  from {
    opacity: 0.35;
    transform: translate3d(0, 4px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.streaming-caret {
  display: inline-block;
  width: 2.5px;
  height: 1.08em;
  margin-left: 3px;
  vertical-align: text-bottom;
  border-radius: 2px;
  background: var(--brand-accent);
  box-shadow: 0 0 8px var(--brand-accent);
  animation: caretBlinkSmooth 0.85s ease-in-out infinite;
}
@keyframes caretBlinkSmooth {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50% { opacity: 0.22; transform: scaleY(0.86); }
}

.thinking-safe-banner {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px;
  margin-bottom: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-canvas);
  color: var(--ink-secondary);
  font-size: 12.5px;
}
.pulse-dots {
  display: inline-flex;
  gap: 3px;
}
.pulse-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-primary);
  animation: dotWave 1.2s infinite ease-in-out;
}
.pulse-dots i:nth-child(2) { animation-delay: 0.16s; }
.pulse-dots i:nth-child(3) { animation-delay: 0.32s; }
@keyframes dotWave {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.15); }
}

.md-section-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-canvas);
  padding: 14px 16px;
  margin: 12px 0;
  transition: border-color 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
}

/* 快捷跳转到位时的柔和呼吸提示高亮 */
.qnav-flash-target {
  border-color: var(--brand-accent) !important;
  box-shadow: 0 0 0 2px var(--brand-accent-soft) !important;
}

/* ==================== 右侧无字极简刻度快捷导航轨（Cherry 同款悬停预览 + 点击直达） ==================== */
.chat-quick-nav-rail {
  position: absolute;
  right: 12px;
  top: 52%;
  transform: translateY(-50%);
  z-index: 28;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 2px;
}

.chat-quick-nav-list {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-height: 58vh;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.chat-quick-nav-list::-webkit-scrollbar {
  display: none;
}

.qnav-tick-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0 4px;
  margin: 0;
  width: 28px;
  height: 15px;
  flex: 0 0 15px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  outline: none;
}

.qnav-tick-btn.is-sub {
  height: 12px;
  flex-basis: 12px;
}

.qnav-tick-bar {
  display: block;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink-muted);
  opacity: 0.44;
  transition: width 0.2s var(--ease-expo), height 0.16s, background-color 0.16s, opacity 0.16s;
}

.qnav-tick-btn.is-sub .qnav-tick-bar {
  width: 5px;
  height: 1.8px;
  opacity: 0.3;
}

.qnav-tick-btn.active .qnav-tick-bar {
  width: 18px;
  height: 2.5px;
  background: var(--ink-primary);
  opacity: 1;
}

.qnav-tick-btn:hover .qnav-tick-bar,
.qnav-tick-btn:focus-visible .qnav-tick-bar {
  width: 19px;
  height: 2.5px;
  background: var(--brand-accent);
  opacity: 1;
}

.chat-quick-nav-popover {
  position: absolute;
  right: 44px;
  top: 50%;
  z-index: 32;
  width: 280px;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  box-shadow: var(--shadow-float);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(6px, -50%, 0);
  transition: opacity 0.16s var(--ease-smooth), transform 0.18s var(--ease-expo), top 0.14s var(--ease-expo);
}

.chat-quick-nav-popover.visible {
  opacity: 1;
  transform: translate3d(0, -50%, 0);
}

.qnp-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qnp-snippet {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.52;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

@media (max-width: 900px) {
  .chat-quick-nav-rail,
  .chat-quick-nav-popover {
    display: none !important;
  }
}
.md-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.md-section-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
}

.md-rendered {
  font-size: 14px;
  line-height: 1.76;
  word-break: break-word;
}
.md-rendered p { margin: 6px 0; }
.md-rendered h1, .md-rendered h2, .md-rendered h3, .md-rendered h4 { margin: 15px 0 7px; font-weight: 600; }
.md-rendered ul, .md-rendered ol { margin: 6px 0; padding-left: 20px; }
.md-rendered hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.md-rendered code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-elevated);
  font-family: ui-monospace, monospace;
  font-size: 12.5px;
}
.md-rendered pre {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-canvas);
  overflow-x: auto;
}
.bracket-tag { color: var(--brand-accent); font-weight: 600; }

.md-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.md-table th, .md-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.md-table th:last-child, .md-table td:last-child { border-right: none; }
.md-table tr:last-child td { border-bottom: none; }
.md-table th { background: var(--bg-canvas); font-weight: 600; color: var(--ink-secondary); }

.floating-bottom-pill {
  position: absolute;
  bottom: 132px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  box-shadow: var(--shadow-float);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ==================== 底部高质感输入坞 ==================== */
.composer-dock {
  flex: 0 0 auto;
  padding: 8px 24px 16px;
}

.composer-frame {
  max-width: 860px;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--bg-canvas);
  padding: 12px 14px 10px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.composer-frame:focus-within {
  border-color: var(--ink-primary);
  background: var(--bg-surface);
  box-shadow: var(--shadow-float);
}
.composer-frame.drag-over {
  border-color: var(--brand-accent);
  background: var(--brand-accent-soft);
}

.attachment-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  font-size: 12px;
}

.composer-frame textarea {
  width: 100%;
  min-height: 46px;
  max-height: 210px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 14.5px;
  line-height: 1.6;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
}
.composer-tools-left, .composer-tools-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.composer-tool-btn {
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.composer-tool-btn:hover { border-color: var(--ink-primary); color: var(--ink-primary); }
.composer-meta-hint { font-size: 11.5px; color: var(--ink-muted); }

.composer-model-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.composer-model-switch:hover { border-color: var(--ink-primary); }
.mini-badge {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--bg-elevated);
  color: var(--ink-secondary);
}

.stop-gen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid rgba(224, 49, 49, 0.35);
  background: rgba(224, 49, 49, 0.08);
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.stop-square { width: 8px; height: 8px; border-radius: 2px; background: var(--danger); }

.extruded-send-btn {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
.extruded-send-btn__face {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border-radius: 9px;
  background: var(--ink-primary);
  color: var(--ink-inverse);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--ink-primary) 35%, transparent);
  transform: translateY(-1px);
  transition: transform 0.16s var(--ease-spring), box-shadow 0.16s;
}
.extruded-send-btn:hover:not(:disabled) .extruded-send-btn__face { transform: translateY(-2px); }
.extruded-send-btn:active:not(:disabled) .extruded-send-btn__face { transform: translateY(1px); box-shadow: none; }
.extruded-send-btn:disabled { cursor: not-allowed; opacity: 0.42; }

/* ==================== 模型选择弹窗 ==================== */
.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(12, 15, 22, 0.52);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-sheet {
  width: 100%;
  max-width: 880px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: stageFadeUp 0.24s var(--ease-expo) both;
}
.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.sheet-header h3 { margin: 4px 0 2px; font-size: 18px; }
.sheet-sub { margin: 0; font-size: 12.5px; color: var(--ink-muted); }

.sheet-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-canvas);
}
.sheet-search-input {
  flex: 1;
  min-width: 220px;
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  outline: none;
}
.sheet-search-input:focus { border-color: var(--ink-primary); }
.sheet-filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-tab {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.filter-tab.active {
  background: var(--ink-primary);
  color: var(--ink-inverse);
  border-color: var(--ink-primary);
}
.sheet-model-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  background: var(--bg-canvas);
}
.model-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: none;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--card-gradient);
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.18s;
}
.model-card:hover { z-index: 2; box-shadow: var(--skill-hover-shadow); }
.model-card.selected { background: var(--bg-active); box-shadow: inset 0 0 0 1.5px var(--brand-accent); }
.mc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mc-name { font-weight: 600; font-size: 14.5px; }
.mc-id { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--ink-muted); }
.mc-desc { font-size: 12.5px; color: var(--ink-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-foot { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-muted); }

/* ==================== 通用按钮 & 独立管理后台兼容样式 ==================== */
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--ink-primary); }

.micro-icon-btn, .inline-icon-btn {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  padding: 3px 6px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
}
.micro-icon-btn:hover, .inline-icon-btn:hover { color: var(--ink-primary); background: var(--bg-hover); }

.chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  vertical-align: middle;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.chip-btn:hover { border-color: var(--ink-primary); color: var(--ink-primary); }

.text-link-btn {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12px;
  cursor: pointer;
}
.text-link-btn:hover { color: var(--ink-primary); text-decoration: underline; }

/* 独立管理后台兼容 */
.topbar { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: var(--bg-surface); border-bottom: 1px solid var(--line); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.version-pill, .group-pill { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--brand-accent-soft); color: var(--brand-accent); font-weight: 600; }
.primary-btn { height: 36px; padding: 0 16px; border-radius: 9px; border: none; background: var(--ink-primary); color: var(--ink-inverse); font-weight: 600; font-size: 13px; cursor: pointer; }
.secondary-btn { height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-surface); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.secondary-btn.mini { height: 32px; padding: 0 11px; font-size: 12px; }
.danger-btn { height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid rgba(224, 49, 49, 0.35); background: rgba(224, 49, 49, 0.08); color: var(--danger); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.danger-btn.mini { height: 30px; padding: 0 10px; }
.full-width-btn { width: 100%; }
.side-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 11px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink-secondary); font-size: 13px; text-align: left; cursor: pointer; }
.side-item.active { background: var(--bg-surface); border-color: var(--line); color: var(--ink-primary); font-weight: 600; }
.admin-login-panel { flex: 1; display: grid; place-items: center; padding: 24px; }
.login-card { max-width: 420px; width: 100%; padding: 28px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-surface); box-shadow: var(--shadow-float); }
.login-card h4 { margin: 0 0 8px; font-size: 17px; }
.login-card p { margin: 0 0 18px; font-size: 13px; color: var(--ink-secondary); }
.login-form-row { display: flex; gap: 8px; }
.login-form-row input { flex: 1; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--bg-canvas); }
.form-error { margin-top: 10px; color: var(--danger); font-size: 12.5px; }
.admin-tab { padding: 10px 16px; border: 1px solid transparent; border-bottom: none; border-radius: 10px 10px 0 0; background: transparent; color: var(--ink-secondary); font-weight: 600; font-size: 13px; cursor: pointer; }
.admin-tab.active { background: var(--bg-surface); border-color: var(--line); color: var(--ink-primary); }
.security-banner { padding: 13px 16px; border-radius: 12px; border: 1px solid rgba(12, 166, 120, 0.3); background: rgba(12, 166, 120, 0.07); }
.security-banner strong { color: var(--emerald); font-size: 13px; }
.security-banner p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-secondary); }
.admin-agents-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; }
.admin-agents-sidebar, .admin-agent-select-list { display: flex; flex-direction: column; gap: 6px; }
.admin-agent-editor, .admin-section { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-surface); display: flex; flex-direction: column; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 10px; }
.form-grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.field-block { display: flex; flex-direction: column; gap: 5px; }
.field-block label { font-size: 12px; font-weight: 600; color: var(--ink-secondary); }
.field-block input, .field-block select, .field-block textarea { padding: 8px 11px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-canvas); }
.checkbox-line { justify-content: flex-end; }
.learn-head-between, .section-head-between, .admin-toolbar-between, .editor-actions-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.learn-upload-btns, .toolbar-btns, .single-model-key-adder { display: flex; gap: 8px; flex-wrap: wrap; }
.single-model-key-adder input { flex: 1; min-width: 220px; height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-canvas); }
.single-model-key-adder select, .inline-field select { height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-canvas); }
.mono-textarea { font-family: ui-monospace, monospace; font-size: 12.5px; line-height: 1.6; }
.policy-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.policy-card { display: flex; align-items: flex-start; gap: 9px; padding: 13px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg-canvas); cursor: pointer; }
.policy-card p { margin: 4px 0 0; font-size: 12px; color: var(--ink-secondary); }
.admin-group-keys-list, .admin-models-list { display: flex; flex-direction: column; gap: 8px; }
.group-key-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-canvas); }
.group-key-row input { height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-surface); font-family: ui-monospace, monospace; }
.admin-model-item { display: grid; grid-template-columns: 1.1fr 1.1fr 0.75fr 0.85fr 1fr auto; gap: 8px; align-items: center; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-canvas); }
.admin-model-item input { height: 32px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg-surface); font-size: 12.5px; width: 100%; }
.deploy-code-block { padding: 14px; border-radius: 10px; background: #101319; color: #e2e8f0; font-size: 12.5px; overflow-x: auto; line-height: 1.6; }
.mini-count { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--bg-elevated); color: var(--ink-secondary); }

.toast-stack, .toast-container { position: fixed; top: 64px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-surface); color: var(--ink-primary); box-shadow: var(--shadow-float); font-size: 13px; font-weight: 600; animation: stageFadeUp 0.2s var(--ease-expo) both; }
.toast.ok { border-left: 3px solid var(--emerald); }
.toast.err { border-left: 3px solid var(--danger); color: var(--danger); }

@media (max-width: 1040px) {
  .skillpay-agent-grid:not([data-count="1"]) { grid-template-columns: repeat(2, 1fr); }
  .policy-cards, .admin-agents-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .skillpay-agent-grid:not([data-count="1"]) { grid-template-columns: 1fr; }
  .sp-agent-card { border-right: none !important; }
  .workbench-sidebar { position: fixed; top: 52px; bottom: 0; left: 0; z-index: 60; box-shadow: var(--shadow-modal); }
  .brand-studio-label, .brand-sep, .slot-sep, .composer-meta-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   独立新站扩展：1. 学员门户首页 (/)  2. 学员身份胶囊  3. 教务与实时对话审计总后台
   ========================================================================== */

/* 1. 学员门户首页（高定建筑网格点阵背景 + 通栏公告带 + 黄金比例左展右登） */
.portal-shell {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background-color: var(--bg-canvas);
  background-image:
    radial-gradient(900px 460px at 18% 12%, rgba(22, 119, 255, 0.065), transparent 65%),
    radial-gradient(760px 420px at 84% 82%, rgba(12, 166, 120, 0.055), transparent 62%),
    radial-gradient(rgba(20, 25, 35, 0.065) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
}

html.dark .portal-shell {
  background-image:
    radial-gradient(900px 460px at 18% 12%, rgba(56, 189, 248, 0.085), transparent 65%),
    radial-gradient(760px 420px at 84% 82%, rgba(32, 201, 151, 0.065), transparent 62%),
    radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
}

.portal-header {
  height: 60px;
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
html.dark .portal-header {
  background: rgba(21, 24, 32, 0.86);
}

/* 顶部通栏公告条（贴合顶栏下方，清爽利落不破坏主体视觉重心） */
.portal-notice-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(22, 119, 255, 0.045);
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.5;
}
html.dark .portal-notice-bar {
  background: rgba(56, 189, 248, 0.07);
}
.portal-notice-tag {
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.portal-main {
  flex: 1;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(24px, 3.5vw, 44px) clamp(20px, 3vw, 36px) 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.portal-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(350px, 410px);
  gap: clamp(28px, 3.8vw, 52px);
  align-items: center;
}

.portal-showcase-col {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.portal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  box-shadow: var(--shadow-xs);
}

.portal-hero-title {
  margin: 16px 0 12px;
  font-size: clamp(28px, 2.9vw, 40px);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.portal-hero-sub {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-secondary);
  max-width: 540px;
}

.portal-showcase-videos {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 10px 4px 16px;
}
.portal-showcase-videos.is-marquee {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%);
}
.showcase-marquee-track {
  display: flex;
  align-items: stretch;
  gap: 18px;
  width: max-content;
  will-change: transform;
  animation: showcaseMarqueeLoop var(--marquee-dur, 26s) linear infinite;
}
.portal-showcase-videos.is-marquee:hover .showcase-marquee-track {
  animation-play-state: paused;
}
@keyframes showcaseMarqueeLoop {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
.showcase-single-wrap {
  width: 100%;
  max-width: 520px;
}

.showcase-video-card {
  position: relative;
  width: 300px;
  flex: 0 0 300px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #0d1016;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
  transition: transform 0.42s var(--ease-spring), box-shadow 0.24s, border-color 0.2s;
}
.showcase-single-wrap .showcase-video-card {
  width: 100%;
  flex: 1 1 auto;
}
.showcase-video-card:hover {
  z-index: 4;
  border-color: var(--ink-primary);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(15, 23, 42, 0.08);
}
.svc-media-box {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #0b0e14;
  overflow: hidden;
}
.svc-media-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.svc-play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.22);
  transition: background-color 0.2s;
}
.showcase-video-card:hover .svc-play-badge {
  background: rgba(0, 0, 0, 0.08);
}
.svc-play-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #141923;
  display: grid;
  place-items: center;
  font-size: 16px;
  padding-left: 3px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s var(--ease-spring);
}
.showcase-video-card:hover .svc-play-circle {
  transform: scale(1.08);
}
.svc-caption {
  padding: 10px 13px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.svc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.svc-tag {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  font-weight: 600;
}
.showcase-empty-slot {
  grid-column: 1 / -1;
  padding: 28px 22px;
  border-radius: 16px;
  border: 1.5px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  gap: 16px;
}
html.dark .showcase-empty-slot {
  background: rgba(21, 24, 32, 0.65);
}

/* 案例影院防下载容器 + 柔和不挡画面的飘动水印 */
.theater-video-stage {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-modal);
}
.theater-moving-watermark {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.36);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.52);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  will-change: transform;
  animation: watermarkGentleDrift 24s ease-in-out infinite;
}
@keyframes watermarkGentleDrift {
  0%   { top: 10%; left: 6%; }
  25%  { top: 14%; left: 66%; }
  50%  { top: 72%; left: 62%; }
  75%  { top: 68%; left: 8%; }
  100% { top: 10%; left: 6%; }
}

.portal-feat-card {
  position: relative;
  padding: 16px 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  transition: transform 0.24s var(--ease-spring), box-shadow 0.24s, border-color 0.2s, background-color 0.2s;
}
html.dark .portal-feat-card {
  background: rgba(21, 24, 32, 0.72);
}
.portal-feat-card:hover {
  z-index: 2;
  background: var(--bg-surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-float);
  transform: translateY(-3px);
}
.pfc-num {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-accent);
  margin-bottom: 6px;
}
.pfc-title {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 600;
}
.pfc-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.portal-auth-vault {
  padding: 32px 30px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  box-shadow: 0 20px 52px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
html.dark .portal-auth-vault {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.portal-footer {
  flex: 0 0 auto;
  padding: 14px 36px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
}
html.dark .portal-footer {
  background: rgba(21, 24, 32, 0.72);
}

.vault-head-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--emerald);
  margin-bottom: 8px;
}

.vault-title {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 700;
}

.vault-sub {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.55;
}

.vault-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.vault-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-primary);
}
.vault-input-wrap {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-canvas);
  transition: border-color 0.18s, background-color 0.18s, box-shadow 0.18s;
}
.vault-input-wrap:focus-within {
  border-color: var(--ink-primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--brand-accent-soft);
}
.vault-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
}

.vault-submit-btn {
  width: 100%;
  height: 44px;
  margin-top: 8px;
  border: none;
  border-radius: 11px;
  background: var(--ink-primary);
  color: var(--ink-inverse);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring), opacity 0.18s, box-shadow 0.18s;
}
.vault-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-float);
}
.vault-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.vault-contact-box {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-muted);
}

/* 2. 工作台右上角学员身份胶囊 */
.student-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-canvas);
  font-size: 12.5px;
  font-weight: 600;
}
.stu-cohort-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  font-weight: 600;
}

/* 3. 教务管理与对话实时审计后台专属样式 */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.kpi-card {
  padding: 14px 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.kpi-label { font-size: 12px; color: var(--ink-muted); font-weight: 500; }
.kpi-val { margin-top: 4px; font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-val.warn { color: var(--danger); }
.kpi-val.good { color: var(--emerald); }

.stu-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-surface);
}
.stu-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.stu-table th, .stu-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.stu-table th {
  background: var(--bg-canvas);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
}
.stu-table tr:last-child td { border-bottom: none; }
.stu-table tr:hover td { background: var(--bg-hover); }

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status-tag.ok { background: rgba(12, 166, 120, 0.12); color: var(--emerald); }
.status-tag.warn { background: rgba(217, 119, 6, 0.14); color: var(--amber); }
.status-tag.err { background: rgba(224, 49, 49, 0.12); color: var(--danger); }

/* 双栏对话实时审计阅读器 */
.audit-split-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  min-height: 560px;
  max-height: calc(100vh - 230px);
}
.audit-session-list-pane {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-surface);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.audit-sess-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 0.15s;
}
.audit-sess-row:hover { background: var(--bg-hover); }
.audit-sess-row.active {
  background: var(--bg-active);
  border-left: 3px solid var(--brand-accent);
}
.audit-sess-row.flagged-extraction {
  border-left: 3px solid var(--danger);
}
.audit-sess-row.flagged-off_topic {
  border-left: 3px solid var(--amber);
}

.audit-transcript-pane {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.audit-transcript-head {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-canvas);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.audit-transcript-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.audit-msg-box {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.68;
  white-space: pre-wrap;
  word-break: break-word;
}
.audit-msg-box.user {
  background: var(--bg-canvas);
  border-left: 3px solid var(--brand-accent);
}
.audit-msg-box.user.is-flagged {
  background: rgba(224, 49, 49, 0.06);
  border-color: rgba(224, 49, 49, 0.4);
  border-left: 4px solid var(--danger);
}
.audit-msg-box.assistant {
  background: var(--bg-surface);
}

.agent-check-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.agent-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg-canvas);
  font-size: 12.5px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .portal-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .portal-auth-vault { order: -1; }
  .portal-feature-grid { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .audit-split-layout { grid-template-columns: 1fr; max-height: none; }
}

/* ==================== 多模态图片与视频附件预览样式 ==================== */
.att-media-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 5px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  font-size: 12px;
}
.att-media-thumb {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.att-media-vid-badge {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}

.msg-media-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.msg-inline-img {
  max-width: 220px;
  max-height: 180px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s;
}
.msg-inline-img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-float);
}
.msg-inline-video {
  max-width: min(100%, 380px);
  max-height: 260px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #000;
}

/* ==================== 全局按钮「近场感应 3D 物理倾斜」交互体系 ==================== */
.tilt-3d-btn {
  transform-style: preserve-3d;
  will-change: transform;
  transform: perspective(520px) rotateX(var(--brx, 0deg)) rotateY(var(--bry, 0deg)) translate3d(var(--btx, 0px), var(--bty, 0px), 0) scale3d(var(--bsc, 1), var(--bsc, 1), 1);
  transition: transform 0.42s var(--ease-spring), box-shadow 0.22s var(--ease-smooth), border-color 0.2s !important;
}
.tilt-3d-btn.is-btn-tilting {
  transition: transform 0.08s linear, box-shadow 0.18s var(--ease-smooth), border-color 0.16s !important;
}

.extruded-send-btn.is-queue-mode .extruded-send-btn__face {
  background: var(--brand-accent);
  color: #ffffff;
}

/* ==================== 同会话排队发送队列条 ==================== */
.queued-messages-bar {
  max-width: 860px;
  margin: 0 auto 8px;
  padding: 9px 13px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 7px;
  animation: stageFadeUp 0.2s var(--ease-expo) both;
}
.qmb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-secondary);
}
.qmb-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--brand-accent);
}
.qmb-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 136px;
  overflow-y: auto;
}
.qmb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-canvas);
  font-size: 12.5px;
}
.qmb-idx {
  flex-shrink: 0;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}
.qmb-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-primary);
}
.qmb-item-actions {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==================== 漫剧全流程 10 步交互式思维导图样式 ==================== */
.workflow-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(22, 119, 255, 0.35);
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s, background-color 0.18s;
}
.workflow-nav-pill:hover {
  background: var(--brand-accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(22, 119, 255, 0.28);
  transform: translateY(-1px);
}

.wf-modal-sheet {
  position: relative;
  width: min(94vw, 1160px);
  max-height: 90vh;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: var(--bg-canvas);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: center top;
  will-change: transform, opacity, filter;
}

.wf-modal-sheet.wf-unfold-active {
  animation: wfCinemaUnfold 0.56s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.wf-modal-sheet.wf-unfold-active::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(22, 119, 255, 0.14) 44%,
    rgba(12, 166, 120, 0.12) 52%,
    transparent 74%
  );
  transform: translateX(-120%);
  animation: wfAuroraSweep 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

@keyframes wfCinemaUnfold {
  0% {
    opacity: 0;
    transform: perspective(1200px) translate3d(0, 38px, 0) scale3d(0.91, 0.88, 1) rotateX(8deg);
    filter: blur(6px);
  }
  65% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: perspective(1200px) translate3d(0, 0, 0) scale3d(1, 1, 1) rotateX(0deg);
    filter: blur(0);
  }
}

@keyframes wfAuroraSweep {
  0% { transform: translateX(-115%); opacity: 0.9; }
  100% { transform: translateX(135%); opacity: 0; }
}

.wf-scroll-reveal {
  opacity: 0;
  transform: perspective(900px) translate3d(0, var(--wf-ry, 34px), 0) scale(0.95) rotateX(var(--wf-rx, 6deg));
  will-change: opacity, transform;
  transition:
    opacity 0.52s cubic-bezier(0.16, 1, 0.3, 1) var(--wf-stagger, 0ms),
    transform 0.58s cubic-bezier(0.16, 1, 0.3, 1) var(--wf-stagger, 0ms);
}

.wf-scroll-reveal.wf-in-view {
  opacity: 1;
  transform: perspective(900px) translate3d(0, 0, 0) scale(1) rotateX(0deg);
}

/* 对话工具栏：高定自定义向上浮窗智力选择器（彻底替换丑陋的原生 select） */
.reasoning-picker-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.reasoning-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background-color 0.18s, box-shadow 0.18s;
}
.reasoning-trigger-btn:hover,
.reasoning-trigger-btn.open {
  border-color: var(--brand-accent);
  color: var(--ink-primary);
  box-shadow: 0 0 0 2px var(--brand-accent-soft);
}
.reasoning-icon {
  font-size: 13px;
  line-height: 1;
}
.reasoning-menu-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  z-index: 45;
  min-width: 196px;
  padding: 6px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: stageFadeUp 0.16s var(--ease-expo) both;
}
.reasoning-opt-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.14s;
}
.reasoning-opt-btn:hover {
  background: var(--bg-hover);
}
.reasoning-opt-btn.selected {
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}
.reasoning-opt-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.reasoning-opt-title {
  font-size: 12.5px;
  font-weight: 600;
}
.reasoning-opt-sub {
  font-size: 11px;
  color: var(--ink-muted);
}
.reasoning-opt-btn.selected .reasoning-opt-sub {
  color: var(--brand-accent);
  opacity: 0.85;
}

.wf-header {
  padding: 18px 24px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wf-canvas-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-image: radial-gradient(rgba(20, 25, 35, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
}
html.dark .wf-canvas-scroll {
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
}

.wf-phase-group {
  animation: stageFadeUp 0.38s var(--ease-expo) var(--phase-delay, 0ms) both;
}

.wf-phase-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.wf-phase-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 999px;
}
.wf-phase-badge.p1 { background: rgba(217, 119, 6, 0.14); color: var(--amber); }
.wf-phase-badge.p2 { background: var(--brand-accent-soft); color: var(--brand-accent); }
.wf-phase-badge.p3 { background: rgba(112, 72, 232, 0.14); color: var(--violet); }
.wf-phase-badge.p4 { background: rgba(12, 166, 120, 0.14); color: var(--emerald); }

.wf-phase-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

.wf-step-grid {
  display: grid;
  gap: 14px;
}
.wf-step-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wf-step-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.wf-node-card {
  padding: 16px 18px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s, border-color 0.2s;
}
.wf-node-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-float);
  border-color: var(--line-strong);
}

/* 💰 变现核心环节金色高光卡 */
.wf-node-card.is-money-core {
  border-color: rgba(217, 119, 6, 0.45);
  background: linear-gradient(155deg, rgba(245, 158, 11, 0.07) 0%, var(--bg-surface) 58%);
}
/* ✨ AI 智能体核心编译区蓝色高光卡 */
.wf-node-card.is-ai-core {
  border-color: rgba(22, 119, 255, 0.35);
  background: linear-gradient(155deg, rgba(22, 119, 255, 0.06) 0%, var(--bg-surface) 60%);
}

.wf-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wf-step-num {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
}
.wf-tag-soft {
  font-size: 11px;
  padding: 1.5px 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--ink-secondary);
  font-weight: 600;
}
.wf-tag-gold {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  color: var(--amber);
  font-weight: 700;
}
.wf-tag-blue {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  font-weight: 700;
}

.wf-node-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink-primary);
}
.wf-node-desc {
  margin: 0;
  font-size: 12.8px;
  line-height: 1.62;
  color: var(--ink-secondary);
}

.wf-qr-box {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wf-qr-img {
  width: 92px;
  height: 92px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 4px;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.2s var(--ease-spring);
}
.wf-qr-img:hover {
  transform: scale(1.06);
}
.wf-qr-empty {
  font-size: 11.5px;
  color: var(--ink-muted);
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px dashed var(--line-strong);
  background: var(--bg-canvas);
}

.wf-agent-pills {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.wf-agent-jump, .wf-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid rgba(22, 119, 255, 0.35);
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  transition: background-color 0.16s, color 0.16s, transform 0.16s;
}
.wf-agent-jump:hover, .wf-action-chip:hover {
  background: var(--brand-accent);
  color: #ffffff;
  transform: translateY(-1px);
}

.wf-flow-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 20px;
  color: var(--brand-accent);
  font-size: 15px;
  font-weight: 700;
  opacity: 0.72;
  animation: livePulseSoft 1.8s ease-in-out infinite;
}

.wf-mentor-banner {
  margin-top: 8px;
  padding: 15px 18px;
  border-radius: 15px;
  border: 1px solid rgba(12, 166, 120, 0.35);
  background: linear-gradient(135deg, rgba(12, 166, 120, 0.08) 0%, var(--bg-surface) 65%);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.wf-mentor-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(12, 166, 120, 0.15);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* ==================== 右侧「分镜区块快捷跳转」3D 立体键帽按钮组（与发送按钮同款高对比度配色） ==================== */
.sb-jump-dock {
  position: absolute;
  right: 18px;
  top: 76px;
  z-index: 29;
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: stageFadeUp 0.22s var(--ease-expo) both;
}
.sb-jump-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 33px;
  padding: 0 13px;
  border-radius: 9px;
  border: none;
  background: var(--ink-primary);
  color: var(--ink-inverse);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--ink-primary) 38%, transparent), 0 6px 16px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
  transition: transform 0.16s var(--ease-spring), box-shadow 0.16s, opacity 0.16s;
}
.sb-jb-svg {
  flex-shrink: 0;
  opacity: 0.92;
}
.sb-jump-btn:hover {
  transform: translateY(-2.5px);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--ink-primary) 42%, transparent), 0 10px 22px rgba(0, 0, 0, 0.24);
}
.sb-jump-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}
.sb-count-dot {
  margin-left: auto;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-inverse) 18%, transparent);
  color: var(--ink-inverse);
}
.sb-shot-wrap {
  position: relative;
}
.sb-shot-popover {
  position: absolute;
  top: 0;
  right: calc(100% + 10px);
  z-index: 42;
  width: 248px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  box-shadow: var(--shadow-float);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  animation: stageFadeUp 0.16s var(--ease-expo) both;
}
.sb-shot-chip {
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s, border-color 0.14s, color 0.14s;
}
.sb-shot-chip:hover {
  border-color: var(--brand-accent);
  background: var(--brand-accent);
  color: #ffffff;
}

.md-section-card.is-script-anchor {
  border-color: rgba(22, 119, 255, 0.35);
}
.md-section-card.is-video-unit {
  border-left: 3px solid var(--brand-accent);
}

@media (max-width: 900px) {
  .wf-step-grid.cols-3, .wf-step-grid.cols-2 { grid-template-columns: 1fr; }
}
