/* Nexus v0.2 — Video Agent */

:root {
  --bg: #050506;
  --bg-card: #111113;
  --bg-card-hover: #18181b;
  --bar-bg: rgba(255, 255, 255, 0.94);
  --bar-blur: blur(20px);
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent: #8b5cf6;
  --accent-2: #6366f1;
  --accent-glow: rgba(139, 92, 246, 0.35);
  --success: #22c55e;
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Syne", var(--font);
  /* 5 段顶栏：与参考实现一致的响应式中心宽度 */
  --bar-rail-h: 64px;
  --bar-notch-h: 112px;
  --bar-height: 112px;
  --bar-offset: 0px;
  --bar-extend-h: 0px;
  --bar-curve-h: 48px;
  --bar-curve-w: 80px;
  --bar-center-w-max: 320px;
  --bar-center-w: min(var(--bar-center-w-max), calc(100vw - 2 * var(--bar-curve-w)));
  --bar-fill: #ffffff;
  --bar-cap-fill: #ffffff;
  --bar-extend-glass: rgba(255, 255, 255, 0.84);
  --bar-glass-blur: blur(22px) saturate(1.12);
  --page-max: 1200px;
  --grid-cols: 4;
  --card-gap: 22px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Ambient */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
}

.ambient__glow--1 {
  width: 560px;
  height: 560px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, #4c1d95 0%, transparent 70%);
}

.ambient__glow--2 {
  width: 480px;
  height: 480px;
  bottom: 20%;
  left: -120px;
  background: radial-gradient(circle, #1e3a5f 0%, transparent 70%);
}

.ambient__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent);
}

/*
 * 5 段拼合顶栏（Backdrop Segments）
 * [左通栏] + [左贝塞尔 SVG] + [中凸块] + [右贝塞尔 SVG] + [右通栏]
 * .top-bar__seg--center 与 .top-bar__center 共用 --bar-center-w
 */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

/* 结构：上方 extend 向下增高（纯白） + 底部 cap 固定 112px（曲线不变） */
.top-bar__main {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.top-bar.is-expanded .top-bar__main {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
}

/* 展开区：从顶部向下「长」出来（收起态由 :not(.is-expanded) 控制高度） */
.top-bar__extend {
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bar-fill);
  transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}

.top-bar.is-expanded .top-bar__extend {
  max-height: var(--bar-extend-h, 480px);
  min-height: 200px;
  background: var(--bar-extend-glass);
  backdrop-filter: var(--bar-glass-blur);
  -webkit-backdrop-filter: var(--bar-glass-blur);
  /* 与底部帽区分：清晰底边，毛玻璃只作用在展开表单区 */
  border-bottom: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* 底部帽 + 曲线：不用 backdrop-filter，保持锐利轮廓 */
.top-bar.is-expanded .top-bar__seg--rail-left,
.top-bar.is-expanded .top-bar__seg--rail-right,
.top-bar.is-expanded .top-bar__curve-rail,
.top-bar.is-expanded .top-bar__seg--center {
  background: rgba(255, 255, 255, 0.97);
}

.top-bar.is-expanded .top-bar__curve-svg path {
  fill: rgba(255, 255, 255, 0.97);
}

/* 收起：Logo 叠在 cap 顶部通栏 */
.top-bar:not(.is-expanded) .top-bar__extend {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12;
  max-height: var(--bar-rail-h);
  background: transparent;
}

.top-bar:not(.is-expanded) .top-bar__extend-inner {
  display: none;
}

.top-bar.is-expanded .top-bar__extend-inner {
  display: block;
}

.top-bar__extend-inner {
  max-width: min(var(--page-max), 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 2vw, 28px) 16px;
  box-sizing: border-box;
}

.top-bar__extend-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: clamp(16px, 2.5vw, 28px);
  align-items: start;
}

.top-bar__extend-form {
  min-width: 0;
}

/* 展开时左侧：被点模板的二次呈现 */
.agent-preview {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.top-bar.is-expanded .agent-preview {
  display: flex;
}

.agent-preview__frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 12px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.agent-preview__visual {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #1e1b4b, #4338ca);
  position: relative;
  overflow: hidden;
}

.agent-preview__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.agent-preview__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #18181b;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, background 0.2s;
}

.agent-preview__play:hover {
  transform: scale(1.06);
  background: #fff;
}

.agent-preview__badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #52525b;
}

.agent-preview__name {
  margin: 8px 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: #0a0a0b;
  line-height: 1.25;
}

.agent-preview__desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #52525b;
}

.agent-preview__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.agent-preview__tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.68rem;
  font-weight: 500;
  color: #3f3f46;
}

.top-bar__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  height: var(--bar-rail-h);
  padding: 0 clamp(16px, 2vw, 32px);
}

/* 底部帽：高度与 5 段造型固定，不随展开拉伸 */
.top-bar__cap {
  position: relative;
  flex-shrink: 0;
  height: var(--bar-notch-h);
  width: 100%;
}

.top-bar__backdrop {
  position: absolute;
  inset: 0;
  height: var(--bar-notch-h);
  z-index: 0;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.top-bar__seg--rail-left,
.top-bar__seg--rail-right {
  flex: 1 1 0;
  min-width: 0;
  height: var(--bar-rail-h);
  background: var(--bar-fill);
}

.top-bar__seg--curve-left,
.top-bar__seg--curve-right {
  flex: 0 0 var(--bar-curve-w);
  width: var(--bar-curve-w);
  height: var(--bar-notch-h);
  display: flex;
  flex-direction: column;
}

.top-bar__curve-rail {
  flex-shrink: 0;
  height: var(--bar-rail-h);
  background: var(--bar-fill);
}

.top-bar__curve-svg {
  flex-shrink: 0;
  width: 100%;
  height: var(--bar-curve-h);
  display: block;
}

.top-bar__seg--center {
  flex: 0 0 var(--bar-center-w);
  width: var(--bar-center-w);
  height: var(--bar-notch-h);
  background: var(--bar-fill);
}

.top-bar__cap-content {
  position: relative;
  z-index: 10;
  height: var(--bar-notch-h);
  pointer-events: none;
}

.top-bar__drawer-head {
  flex-shrink: 0;
  padding: 4px 0 8px;
}

.top-bar__center {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: var(--bar-center-w);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 7px;
  pointer-events: auto;
}

.top-bar:not(.is-expanded) .agent-panel__fields,
.top-bar:not(.is-expanded) .top-bar__drawer-head {
  display: none;
}

@media (min-width: 640px) {
  :root {
    --bar-center-w-max: 420px;
    --bar-curve-w: 112px;
  }
}

@media (min-width: 768px) {
  :root {
    --bar-center-w-max: 500px;
    --bar-curve-w: 144px;
  }
}

@media (min-width: 1024px) {
  :root { --bar-center-w-max: 580px; }
}

/* 模板插拔输入区（展开时位于主输入上方） */
.agent-panel__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a1a1aa;
  margin-bottom: 4px;
}

.agent-panel__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0a0a0b;
}

.agent-panel__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  width: 100%;
  padding: 0 0 10px;
}

.top-bar:not(.is-expanded) .agent-panel__fields {
  display: none;
}


.agent-field--full {
  grid-column: 1 / -1;
}

.agent-field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #52525b;
}

.agent-field__hint {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  color: #a1a1aa;
}

.top-bar.is-expanded .agent-field__control {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(0, 0, 0, 0.08);
}

.top-bar.is-expanded .agent-field__control:focus {
  background: rgba(255, 255, 255, 0.85);
}

.top-bar.is-expanded .agent-field__upload-btn {
  background: rgba(255, 255, 255, 0.5);
}

.agent-field__control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fafafa;
  font-family: inherit;
  font-size: 0.85rem;
  color: #18181b;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.agent-field__control:focus {
  border-color: #a1a1aa;
  background: #fff;
}

.agent-field__control--area {
  min-height: 72px;
  resize: vertical;
  line-height: 1.5;
}

.agent-field__upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.agent-field__upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px dashed #d4d4d8;
  border-radius: 10px;
  background: #fafafa;
  font-family: inherit;
  font-size: 0.8rem;
  color: #3f3f46;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.agent-field__upload-btn:hover {
  border-color: #a1a1aa;
  background: #fff;
}

.agent-field__file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.agent-field__file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  font-size: 0.7rem;
  color: #3f3f46;
}

.agent-field__file-chip button {
  border: none;
  background: none;
  color: #a1a1aa;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.agent-panel__empty {
  margin: 0;
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: #71717a;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo__img {
  display: block;
  width: auto;
  height: 20px;
  max-height: 20px;
}

.search-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
}

.top-bar.is-dragover .composer-pill {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.composer__attachments {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-bottom: 4px;
  max-width: 100%;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  font-size: 0.7rem;
  color: #3f3f46;
}

.attachment-chip__thumb {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
}

.attachment-chip__name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip__remove {
  border: none;
  background: none;
  color: #a1a1aa;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

/* 胶囊输入框 — 宽度驱动顶栏平底槽 */
.composer-pill {
  display: flex;
  align-items: center;
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 5px 0 17px;
  background: #ffffff;
  border: 1px solid #d4d4d8;
  border-radius: 999px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.composer-pill:focus-within {
  border-color: #a1a1aa;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.prompt-input,
.composer-pill__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 42px;
  height: 42px;
  color: #18181b;
  padding: 0;
  outline: none;
  width: 100%;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  text-overflow: clip;
}

.prompt-input::-webkit-scrollbar,
.composer-pill__input::-webkit-scrollbar {
  height: 0;
}

.prompt-input::placeholder,
.composer-pill__input::placeholder {
  color: #a1a1aa;
}

.composer-pill__send {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin-left: 4px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.composer-pill__send:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.composer-pill__send:not(:disabled):hover {
  transform: scale(1.08);
}

.composer-pill__star {
  display: block;
  transform-origin: center;
  animation: star-spin 8s linear infinite, star-pulse 2.4s ease-in-out infinite;
}

.composer-pill__star .star-grad-a { stop-color: #38bdf8; }
.composer-pill__star .star-grad-b { stop-color: #6366f1; }
.composer-pill__star .star-grad-c { stop-color: #a855f7; }

.composer-pill__send:disabled .composer-pill__star {
  opacity: 0.38;
  animation-duration: 12s, 3.5s;
}

.composer-pill__send:not(:disabled) .composer-pill__star {
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.55));
}

@keyframes star-spin {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.08); }
  to { transform: rotate(360deg) scale(1); }
}

@keyframes star-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.45)); }
  50% { filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.75)); }
}

/* 附件 / 语音 */
.composer-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 3px;
  padding-bottom: 1px;
  line-height: 1;
}

.composer-tools__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #71717a;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.composer-tools__btn:hover {
  color: #3f3f46;
  background: rgba(0, 0, 0, 0.04);
}

.composer-tools__btn[aria-pressed="true"] {
  color: #dc2626;
}

.composer-tools__btn[aria-pressed="true"] .icon-mic {
  animation: pulse-mic 1.2s ease-in-out infinite;
}

@keyframes pulse-mic {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.composer__hint,
.composer__drop-hint {
  margin: 4px 0 0;
  font-size: 0.68rem;
  text-align: center;
}

.composer__hint { color: #dc2626; }
.composer__drop-hint { color: #3b82f6; font-weight: 500; }

/* 工作台参数 */
.param-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.param-field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.param-field__control {
  width: 100%;
  appearance: none;
  padding: 10px 32px 10px 12px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.25) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Page */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 12px 20px 48px;
  transition: none;
}

/* Hero */
.hero {
  text-align: center;
  padding: 0 0 20px;
}

.hero__eyebrow {
  display: inline-block;
  margin: 0 0 20px;
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 999px;
}

.hero__title {
  margin: 0 0 10px;
  font-family: var(--font);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero__accent {
  background: linear-gradient(90deg, #c4b5fd, #818cf8, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__desc {
  margin: 0 auto;
  max-width: 640px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  text-wrap: balance;
}

.hero__stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
}

.stat-chip__value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.stat-chip__label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Section head */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head__desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Filter pills */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-pill.is-active {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}

/* Template grid — fixed rows, vertical page scroll */
.templates {
  margin-top: 0;
}

.templates__grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: var(--card-gap);
  margin-bottom: 48px;
}

.template-card {
  display: flex;
  flex-direction: column;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

.template-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.template-card.is-hidden {
  display: none;
}

.template-card.is-selected .template-card__visual {
  transform: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.template-card:hover .template-card__visual {
  transform: scale(1.01);
}

.template-card__visual {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0;
  border: none;
  overflow: hidden;
  background: var(--bg-card);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  transform-origin: center center;
}

.template-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.template-card__placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
  z-index: 2;
}

.template-card__placeholder--media {
  background: #0a0a0b;
}

.template-card__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 1;
}

.template-card__icon {
  width: 44px;
  height: 44px;
  color: rgba(255,255,255,0.5);
  z-index: 1;
}

/* 标签保留 DOM，初期隐藏，后续可 data-show-tags 开启 */
.template-card__badge,
.template-card__meta {
  display: none;
}

.template-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.5);
  color: #fafafa;
  border-radius: 0;
  backdrop-filter: blur(8px);
}

.template-card__meta {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  display: none;
  gap: 6px;
}

.template-card__tag {
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: 500;
  color: #e4e4e7;
  background: rgba(0,0,0,0.45);
  border-radius: 0;
}

.template-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  transition: opacity 0.25s;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.template-card:hover .template-card__overlay { opacity: 1; }

.template-card__body {
  padding: 14px 2px 0;
}

.template-card__name {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.template-card__desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.output-preview__text {
  margin: 10px 0 0;
  padding: 12px;
  min-height: 96px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.55;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  scrollbar-width: thin;
}

.task-dock__item-sub {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: #a1a1aa;
  line-height: 1.4;
}

.task-dock__item.is-active .task-dock__item-title {
  color: #fafafa;
}

/* 弹窗 + 任务队列展开：同一套任务状态/输出区 */
.task-run-panel {
  margin: 0 0 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.task-run-panel__status {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.task-run-panel__output {
  margin: 0;
  padding: 10px 12px;
  min-height: 72px;
  max-height: 240px;
  overflow: auto;
  overflow-y: scroll;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text);
  scrollbar-width: thin;
}

#agentTaskStatus.task-run-panel-host {
  margin: 8px 0 10px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.auth-modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.auth-modal__card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 360px);
  border: 1px solid var(--border);
  background: #0b0b10;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.auth-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.auth-modal__head button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.auth-modal__body {
  padding: 14px;
}

.auth-input {
  width: 100%;
  height: 38px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  background: #111317;
  color: var(--text);
  padding: 0 10px;
}

.auth-error {
  min-height: 18px;
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: #f87171;
}

.auth-submit {
  width: 100%;
}


/* Workspace */
.workspace { margin-bottom: 72px; }

.workspace__layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

.panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
}

.panel__title {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.selection-card__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 12px;
  color: var(--text-dim);
}

.selection-card__empty svg { margin-bottom: 12px; opacity: 0.4; }
.selection-card__empty p { margin: 0 0 4px; font-size: 0.9rem; color: var(--text-muted); }
.selection-card__empty span { font-size: 0.75rem; }

.selection-card__active {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.selection-card__thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.selection-card__info h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.selection-card__info p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.param-summary {
  list-style: none;
  margin: 0;
  padding: 0;
}

.param-summary li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.param-summary li:last-child { border-bottom: none; }
.param-summary span { color: var(--text-dim); }
.param-summary strong { color: var(--text); font-weight: 600; }

.output-panel {
  min-height: 360px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.output-panel__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 40px;
  text-align: center;
  position: relative;
}

.output-panel__rings {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 1px solid var(--border);
  border-radius: 50%;
  animation: ring-pulse 4s ease-in-out infinite;
}

.output-panel__rings::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 50%;
}

@keyframes ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}

.output-panel__empty h3 {
  margin: 24px 0 8px;
  font-size: 1.1rem;
  position: relative;
}

.output-panel__empty p {
  margin: 0 0 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 320px;
  position: relative;
}

.ghost-btn {
  padding: 10px 20px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.ghost-btn:hover {
  border-color: var(--accent);
  color: #c4b5fd;
}

.output-panel__active {
  padding: 24px;
}

.output-panel__progress { margin-bottom: 20px; }

.progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  transition: width 0.3s;
}

.progress-label {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.output-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}

.output-preview__frame {
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border: 1px solid var(--border);
}

.output-preview__meta h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.output-preview__meta p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Recent */
.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.recent-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-strong);
}

.recent-item__dot {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.recent-item__info { flex: 1; min-width: 0; }

.recent-item__title {
  margin: 0 0 4px;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-item__meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.recent-item__status {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.recent-item__status--draft {
  background: rgba(161, 161, 170, 0.15);
  color: var(--text-muted);
}

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 24px 28px 40px;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

.footer code {
  font-size: 0.72rem;
  padding: 2px 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
}

.footer__sep { opacity: 0.4; }

/* 右下角任务队列悬浮窗 */
.task-dock {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.task-dock__pill,
.task-dock__panel {
  pointer-events: auto;
}

.task-dock__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.task-dock__pill:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(39, 39, 42, 0.92);
}

.task-dock.is-open .task-dock__pill {
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.2);
}

.task-dock__pill-icon {
  opacity: 0.85;
}

.task-dock__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #fff;
}

.task-dock__panel {
  width: min(360px, calc(100vw - 40px));
  max-height: min(420px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: rgba(17, 17, 19, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: task-dock-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes task-dock-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.task-dock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.task-dock__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.task-dock__close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.task-dock__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.task-dock__body {
  overflow-y: auto;
  padding: 12px 14px 16px;
}

.task-dock__section + .task-dock__section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.task-dock__section-title {
  margin: 0 0 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.task-dock__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-dock__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.task-dock__item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-strong);
}

.task-dock__item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
}

.task-dock__item-body {
  flex: 1;
  min-width: 0;
}

.task-dock__item {
  color: var(--text);
  text-align: left;
}

.task-dock__item-title {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-dock__item-meta {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.task-dock__item-progress {
  margin-top: 6px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.task-dock__item-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s;
}

.task-dock__item-status {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

.task-dock__item-status--done {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.task-dock__empty {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.top-bar.is-expanded .composer-pill {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Responsive — grid cols, no horizontal scroll */
@media (max-width: 1024px) {
  :root { --grid-cols: 3; }
  .workspace__layout { grid-template-columns: 1fr; }
  .output-preview { grid-template-columns: 1fr; }
  .recent-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --grid-cols: 2; }

  .top-bar__nav { padding-left: 16px; padding-right: 16px; }

  .top-bar__extend-inner { padding-left: 16px; padding-right: 16px; }

  .top-bar__extend-layout {
    grid-template-columns: 1fr;
  }

  .agent-preview__frame {
    max-height: 160px;
    aspect-ratio: 16 / 9;
  }

  .agent-panel__fields { grid-template-columns: 1fr; }

  .task-dock {
    right: 14px;
    bottom: 18px;
  }

  .logo__img { height: 18px; }

  .page { padding-left: 16px; padding-right: 16px; }

  .section-head { flex-direction: column; align-items: flex-start; }

  .recent-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  :root { --grid-cols: 2; --card-gap: 14px; }
}

/* ---- v0.5: 去 bar + 紧凑布局 + 点击位弹窗 ---- */
:root {
  --page-max: 1280px;
  --grid-cols: 5;
  --card-gap: 12px;
}

.top-bar {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1001;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(5, 5, 6, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header__link,
.app-header__btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #f4f4f5;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.app-header__btn {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.38);
}

.app-header__points {
  font-size: 0.74rem;
  color: #d4d4d8;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.page {
  padding-top: 18px !important;
}

.section-head--compact {
  margin-bottom: 10px;
}

.filter-pill {
  padding: 6px 12px;
  font-size: 0.74rem;
}

.templates__grid {
  gap: 10px;
  margin-bottom: 24px;
}

.template-card__body {
  padding-top: 8px;
}

.template-card__name {
  font-size: 0.86rem;
  margin-bottom: 4px;
}

.template-card__desc {
  font-size: 0.74rem;
}

.agent-popover {
  position: fixed;
  z-index: 1200;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(20, 20, 22, 0.96);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}

.agent-popover__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.agent-popover__head strong {
  font-size: 0.82rem;
}

.agent-popover__head button {
  border: none;
  background: transparent;
  color: #a1a1aa;
  font-size: 1rem;
  cursor: pointer;
}

.agent-popover__body {
  padding: 10px;
}

.agent-popover__fields {
  grid-template-columns: 1fr !important;
  gap: 8px;
  padding-bottom: 8px;
}

.agent-popover .agent-field__label {
  color: #d4d4d8;
}

.agent-popover .agent-field__control,
.agent-popover .agent-field__upload-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
}

.agent-popover .composer-pill {
  height: 38px;
  min-height: 38px;
}

.agent-popover .prompt-input {
  height: 38px;
  line-height: 38px;
  color: #f4f4f5;
}

.task-dock {
  right: 12px;
  bottom: 12px;
}

.task-dock__panel {
  width: min(340px, calc(100vw - 24px));
  max-height: min(360px, calc(100vh - 100px));
}

.task-dock__head {
  padding: 10px 12px;
}

.task-dock__body {
  padding: 8px 10px 10px;
}

.task-dock__item {
  padding: 8px 9px;
  gap: 8px;
}

.task-dock__item-thumb {
  width: 28px;
  height: 28px;
}

.task-dock__item-title {
  font-size: 0.74rem;
  margin-bottom: 2px;
}

.task-dock__item-meta {
  font-size: 0.62rem;
}

.task-dock__item-status {
  font-size: 0.58rem;
  padding: 2px 5px;
}

.task-dock__item-idx {
  font-size: 0.62rem;
  color: #a1a1aa;
  margin-right: 6px;
}

.task-dock__item-detail {
  margin-top: 5px;
  padding: 6px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.24);
  font-size: 0.64rem;
  color: #cfcfd4;
  line-height: 1.4;
}

@media (max-width: 1200px) {
  :root { --grid-cols: 4; }
}

@media (max-width: 980px) {
  :root { --grid-cols: 3; }
}

@media (max-width: 768px) {
  :root { --grid-cols: 2; }
  .app-header { padding: 10px 12px; }
  .app-header__points { display: none; }
}

/* ---- v0.6: 直角黑底流光面板 + 任务队列交互 ---- */
@keyframes ca-border-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.ca-panel {
  position: relative;
  border-radius: 0 !important;
  background: transparent;
  border: none !important;
  box-shadow: none !important;
  overflow: visible;
}

.ca-panel__glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #7c3aed, #22d3ee, #6366f1, #c084fc, #7c3aed);
  background-size: 220% 100%;
  animation: ca-border-flow 3.2s linear infinite;
}

.ca-panel__inner {
  position: relative;
  z-index: 1;
  margin: 2px;
  background: #050505;
}

.agent-popover.ca-panel {
  width: min(392px, calc(100vw - 20px));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.agent-popover .ca-panel__inner {
  display: flex;
  flex-direction: column;
}

.agent-popover__head {
  padding: 7px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.agent-popover__head strong {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.agent-popover__head button {
  width: 22px;
  height: 22px;
  line-height: 1;
  color: #a1a1aa;
}

.agent-popover__body {
  padding: 8px;
}

.agent-popover__fields {
  gap: 6px !important;
  padding-bottom: 6px;
}

.agent-popover .agent-field__label {
  font-size: 0.68rem;
  margin-bottom: 3px;
}

.agent-popover .agent-field__control,
.agent-popover .agent-field__upload-btn {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 0.74rem;
  border-radius: 0;
}

.agent-popover .composer-pill {
  height: 34px;
  min-height: 34px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.agent-popover .prompt-input {
  height: 34px;
  line-height: 34px;
  font-size: 0.78rem;
}

.agent-popover .composer-tools {
  margin-top: 6px;
  gap: 6px;
}

.agent-popover .composer-tools__btn {
  width: 28px;
  height: 28px;
  border-radius: 0;
}

.task-dock__panel.ca-panel {
  width: min(320px, calc(100vw - 20px));
  max-height: min(340px, calc(100vh - 88px));
  border-radius: 0 !important;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

.task-dock__panel[hidden] {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.task-dock.is-open .task-dock__panel:not([hidden]) {
  display: flex !important;
  flex-direction: column;
  visibility: visible;
  pointer-events: auto;
}

.task-dock__panel-inner {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  overflow: hidden;
}

.task-dock__head {
  padding: 7px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.task-dock__title {
  font-size: 0.78rem;
}

.task-dock__close {
  border-radius: 0;
  width: 22px;
  height: 22px;
}

.task-dock__body {
  padding: 6px 7px 8px;
  overflow: auto;
}

.task-dock__section-title {
  font-size: 0.62rem;
  margin-bottom: 5px;
}

.task-dock__item {
  border-radius: 0;
  padding: 6px 7px;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.task-dock__item.is-active {
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(139, 92, 246, 0.1);
}

.task-dock__pill {
  border-radius: 0;
  padding: 8px 12px;
  font-size: 0.74rem;
}

.logo__img {
  display: block;
  height: 22px;
  width: auto;
}

.hero {
  padding: 4px 0 16px;
}

.hero__eyebrow {
  margin-bottom: 12px;
  border-radius: 0;
  font-size: 0.68rem;
}

.hero__title {
  font-size: clamp(1.5rem, 3.6vw, 2.15rem);
}

.hero__desc {
  font-size: 0.82rem;
  max-width: 520px;
}

/* ---- v0.7: Logo / 顶距 / 四边流光 / 队列内展开 ---- */
:root {
  --bar-offset: 0px;
}

.page {
  padding: 14px 20px 56px !important;
  transition: none !important;
}

.ca-panel {
  overflow: hidden;
}

.agent-popover__head {
  align-items: flex-start;
  gap: 8px;
}

.agent-popover__head-text {
  flex: 1;
  min-width: 0;
}

.agent-popover__desc {
  margin: 3px 0 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: #a1a1aa;
  font-weight: 400;
}

.agent-composer-host[hidden] {
  display: none !important;
}

.agent-composer-host:not([hidden]) {
  display: block;
}

.agent-composer-slot {
  min-width: 0;
}

.task-dock__row {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.task-dock__row.is-expanded .task-dock__item {
  border-color: rgba(139, 92, 246, 0.45);
}

.task-dock__expand-slot {
  overflow: visible;
  max-height: none;
}

.task-dock__expand {
  padding: 6px 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: none;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 0;
  overflow: visible;
}

.task-dock__editor [data-task-run-panel-host] .task-run-panel {
  margin-top: 0;
}

.task-dock__row .task-dock__item {
  border-bottom: none;
}

.task-dock__expand-head {
  margin-bottom: 8px;
}

.task-dock__expand-head strong {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: #f4f4f5;
}

.task-dock__expand-head p {
  margin: 4px 0 0;
  font-size: 0.64rem;
  line-height: 1.4;
  color: #a1a1aa;
}

.task-dock .agent-panel__fields {
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  padding: 0 0 6px;
  margin: 0;
}

.task-dock .agent-field__label {
  font-size: 0.68rem;
  margin-bottom: 3px;
  color: #d4d4d8;
}

.task-dock .agent-field__control,
.task-dock .agent-field__upload-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
  min-height: 30px;
  padding: 6px 8px;
  font-size: 0.74rem;
  border-radius: 0;
}

.task-dock .agent-field__upload-btn {
  border-style: solid;
}

.task-dock .composer-pill {
  height: 34px;
  min-height: 34px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.task-dock .prompt-input {
  height: 34px;
  line-height: 34px;
  font-size: 0.78rem;
  color: #f4f4f5;
}

.task-dock .composer-tools {
  margin-top: 6px;
  gap: 6px;
}

.task-dock .composer-tools__btn {
  width: 28px;
  height: 28px;
  border-radius: 0;
}

.task-dock .attachment-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
}

.task-dock .attachment-chip__name {
  color: #f4f4f5;
}

.task-dock .attachment-chip__remove {
  color: #a1a1aa;
}

.task-dock .agent-field__file-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
}

.task-dock.is-open .task-dock__panel.ca-panel {
  width: min(360px, calc(100vw - 20px));
  max-height: min(72vh, 560px);
}

.logo__img {
  height: 20px;
  width: auto;
}

.hero {
  padding: 2px 0 18px;
}

.hero__title {
  margin-bottom: 8px;
}

.hero__desc {
  margin-left: auto;
  margin-right: auto;
}

/* ---- v0.8: 修复面板描边为“环形包裹”，避免彩色面片溢出 ---- */
.ca-panel {
  overflow: hidden !important;
}

.ca-panel__glow {
  background: conic-gradient(
    from 0deg,
    #7c3aed,
    #22d3ee,
    #6366f1,
    #c084fc,
    #a78bfa,
    #7c3aed
  ) !important;
  animation: ca-border-flow 3.2s linear infinite;

  /* 只保留边框环形区域，其它透明 */
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;

  /* 与 mask 的 content-box 结合：内容区保持不被渲染出来的“环厚” */
  padding: 1px;
  inset: 0;
}

.ca-panel__inner {
  margin: 1px !important;
}

.agent-popover[hidden] {
  display: none !important;
}

.agent-popover {
  position: fixed !important;
}

.task-dock__editor .composer-pill {
  margin-top: 6px;
}

.task-dock__prompt {
  color: #f4f4f5;
}

.hero__desc {
  max-width: 640px !important;
}
