/* ==========================================================================
   H3 Studio · 浅色工作台（对齐即梦参考图）
   左导航 240px + 对话流 + 底部悬浮输入条；零外部字体 / 图标 / CDN。
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --bg-ghost: #fafafa;
  --line: #ededed;
  --line-strong: #e3e3e6;
  --text: #1a1a1a;
  --text-2: #5a5a5a;
  --muted: #8a8a8a;
  --faint: #b5b5b5;
  --accent: #7c5cff;
  --accent-strong: #6b4ee6;
  --accent-weak: #f3f0ff;
  --accent-line: #ddd3ff;
  --green: #2fa96b;
  --amber: #b7791f;
  --danger: #e5484d;
  --ar: 16 / 9;
  --shadow-card: 0 6px 28px rgba(0, 0, 0, 0.07);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

a {
  color: var(--accent-strong);
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: #5b4aa8;
  background: var(--accent-weak);
  border-radius: 4px;
  padding: 1px 4px;
  overflow-wrap: anywhere;
}

kbd {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--text-2);
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ic {
  width: 16px;
  height: 16px;
  flex: none;
}

[hidden] {
  display: none !important;
}

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

/* ============================ 布局骨架 ============================ */

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 240px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 10px 10px;
  background: var(--bg);
  border-right: 1px solid var(--line);
  transition: width 0.18s ease, transform 0.2s ease;
  z-index: 50;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #8b70ff, #5b3ce0);
  box-shadow: 0 3px 10px rgba(124, 92, 255, 0.28);
}

.brand-mark .ic {
  width: 16px;
  height: 16px;
}

.brand-name {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: normal;
  white-space: nowrap;
}

.icon-btn {
  width: 28px;
  height: 28px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.icon-btn:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.icon-btn .ic {
  width: 16px;
  height: 16px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-item .ic {
  width: 17px;
  height: 17px;
  color: var(--text-2);
}

.nav-item:hover {
  background: var(--bg-soft);
}

.nav-item.is-active {
  background: var(--accent-weak);
  color: var(--accent-strong);
  font-weight: 600;
}

.nav-item.is-active .ic {
  color: var(--accent);
}

.side-extra {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.side-entry {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  text-align: left;
}

.side-entry:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.side-entry .ic {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.side-entry-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-new {
  margin-left: auto;
  padding: 1px 5px;
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  background: var(--accent-weak);
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1.4;
  flex: none;
}

/* 对话历史 */
.history {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.history-title {
  padding: 0 10px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.history-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 6px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  color: var(--text);
}

.history-item:hover {
  background: var(--bg-soft);
}

.history-item.is-active {
  background: var(--bg-soft);
}

.history-thumb {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 7px;
  overflow: hidden;
  background: linear-gradient(145deg, #f0ecff, #e6e0fb);
  display: grid;
  place-items: center;
  color: var(--accent);
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-thumb .ic {
  width: 15px;
  height: 15px;
}

.history-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  color: var(--text);
}

.history-time {
  flex: none;
  font-size: 12px;
  color: var(--faint);
}

.history-empty {
  padding: 8px 12px;
  color: var(--faint);
  font-size: 12px;
}

.history-empty[hidden] {
  display: none;
}

.sidebar-foot {
  flex: none;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.side-foot-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
}

.side-foot-btn:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.side-foot-btn .ic {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transform: rotate(-90deg);
}

/* 折叠态（桌面） */
.app.is-sidebar-collapsed .sidebar {
  width: 64px;
  padding: 12px 8px;
}

.app.is-sidebar-collapsed .brand-name,
.app.is-sidebar-collapsed .nav-label,
.app.is-sidebar-collapsed .side-entry-label,
.app.is-sidebar-collapsed .tag-new,
.app.is-sidebar-collapsed .history,
.app.is-sidebar-collapsed .side-foot-btn span,
.app.is-sidebar-collapsed .side-foot-btn .ic {
  display: none;
}

.app.is-sidebar-collapsed .sidebar-head {
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  padding: 2px 0 10px;
}

.app.is-sidebar-collapsed .nav-item,
.app.is-sidebar-collapsed .side-entry,
.app.is-sidebar-collapsed .side-foot-btn {
  justify-content: center;
  padding: 0;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(1px);
}

/* ---------- 主区 ---------- */
.main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
}

.main-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 32px;
}

.hamburger {
  display: none;
}

.main-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: normal;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-head-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

.conn[data-state="ok"] {
  color: #2b7a56;
  border-color: #d7eee2;
  background: #f3fbf7;
}

.conn[data-state="ok"] .conn-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 169, 107, 0.12);
}

.conn[data-state="warn"] {
  color: var(--amber);
  border-color: #f1e2c4;
  background: #fdf8ee;
}

.conn[data-state="warn"] .conn-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.12);
}

.conn[data-state="down"] {
  color: var(--danger);
  border-color: #f6d4d5;
  background: #fef5f5;
}

.conn[data-state="down"] .conn-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12);
}

.key-line {
  flex: none;
  margin: 0 32px 4px;
  color: var(--amber);
  font-size: 12px;
  line-height: 1.6;
}

.key-line code {
  color: #8a5a12;
  background: #fdf3e1;
}

.content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* ---------- 对话流 ---------- */
.feed-wrap {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.feed {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 6px 32px 28px;
}

.feed-day {
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.feed-empty {
  padding: 90px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.gen {
  padding: 4px 0 34px;
  scroll-margin-top: 20px;
}

.gen.is-highlight {
  animation: gen-highlight 1.6s ease;
  border-radius: 12px;
}

@keyframes gen-highlight {
  0%,
  100% {
    background: transparent;
  }
  20%,
  70% {
    background: #faf8ff;
  }
}

.gen-head {
  margin-bottom: 2px;
}

.gen-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.gen-prompt {
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.gen-prompt-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gen.is-expanded .gen-prompt-text {
  display: block;
  -webkit-line-clamp: unset;
}

.gen-meta {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  margin-left: 2px;
}

.gen-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  vertical-align: 1px;
}

.gen-detail-btn:hover {
  color: var(--accent-strong);
}

.gen-detail-btn .ic {
  width: 13px;
  height: 13px;
}

.gen-detail {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-ghost);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.8;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.gen-detail span {
  white-space: nowrap;
}

.gen-result {
  position: relative;
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-soft);
}

.gen-video {
  display: block;
  width: 100%;
  max-height: min(62vh, 620px);
  object-fit: contain;
  background: #000;
  border-radius: 12px;
}

.gen-download {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.gen-result:hover .gen-download,
.gen-download:focus-visible {
  opacity: 1;
  transform: none;
}

.gen-download .ic {
  width: 16px;
  height: 16px;
}

/* 生成中 */
.gen-progress {
  aspect-ratio: var(--ar, 16 / 9);
  max-height: min(62vh, 620px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(160deg, #fafafa, #f3f3f5);
  color: var(--text-2);
  border-radius: 12px;
  padding: 20px;
}

.gen-spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #e3e3e6;
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.gen-progress-text {
  font-size: 13px;
}

.gen-progress-bar {
  width: min(240px, 62%);
  height: 4px;
  border-radius: 999px;
  background: #ececee;
  overflow: hidden;
}

.gen-progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a68dff, var(--accent));
  transition: width 0.4s ease;
}

.gen-progress-bar[data-indeterminate="1"] .gen-progress-fill {
  width: 36%;
  animation: indeterminate 1.4s ease-in-out infinite;
}

@keyframes indeterminate {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(320%);
  }
}

.gen-percent {
  color: var(--faint);
  font-size: 12px;
  font-family: var(--mono);
}

/* 失败 */
.gen-error {
  border: 1px solid #f6dcdc;
  border-radius: 12px;
  background: #fff7f7;
  padding: 14px 16px;
  color: #a83a3e;
}

.gen-error-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}

.gen-error-title .ic {
  width: 16px;
  height: 16px;
}

.gen-error-msg {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.65;
  color: #8e4a4d;
  overflow-wrap: anywhere;
}

.gen-error details {
  margin-top: 8px;
  font-size: 12px;
  color: #a86a6d;
}

.gen-error summary {
  cursor: pointer;
}

.gen-error pre {
  margin: 6px 0 0;
  padding: 8px 10px;
  max-height: 160px;
  overflow: auto;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  color: #7a4a4c;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 操作行 */
.gen-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.pill-btn:hover:not(:disabled) {
  background: var(--bg-soft);
}

.pill-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pill-btn .ic {
  width: 14px;
  height: 14px;
  color: var(--text-2);
}

.pill-btn.pill-icon {
  width: 32px;
  padding: 0;
}

.pill-btn.pill-danger {
  color: var(--danger);
}

.pill-btn.pill-danger .ic {
  color: var(--danger);
}

.more-wrap {
  position: relative;
}

.more-menu {
  position: absolute;
  top: auto;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 168px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}

.more-item:hover {
  background: var(--bg-soft);
}

.more-item .ic {
  width: 14px;
  height: 14px;
  color: var(--text-2);
}

.more-item.is-danger {
  color: var(--danger);
}

.more-item.is-danger .ic {
  color: var(--danger);
}

/* ---------- 我的作品 ---------- */
.works-view {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.works-title {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 32px 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: normal;
}

.works-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 32px 40px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.work-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  padding: 0;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.work-card:hover {
  border-color: var(--accent-line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.work-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  overflow: hidden;
}

.work-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.work-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  background: linear-gradient(160deg, #fafafa, #f2f2f4);
}

.work-placeholder .ic {
  width: 22px;
  height: 22px;
}

.work-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-2);
  font-size: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.work-badge[data-status="running"] {
  color: var(--accent-strong);
}

.work-badge[data-status="succeeded"] {
  color: var(--green);
}

.work-badge[data-status="failed"] {
  color: var(--danger);
}

.work-body {
  padding: 10px 12px 12px;
  min-width: 0;
}

.work-prompt {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.work-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--faint);
  font-size: 12px;
}

.work-time,
.work-params {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.works-empty {
  padding: 90px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.works-empty p {
  margin-bottom: 14px;
}

/* ---------- 底部输入条 ---------- */
.composer-dock {
  flex: none;
  padding: 8px 32px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 28%);
}

.composer {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 8px 30px rgba(124, 92, 255, 0.1);
}

.composer-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.refs-col {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 176px;
}

.ref-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ref-tile {
  position: relative;
  width: 52px;
  height: 52px;
  flex: none;
}

.ref-thumb {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  cursor: pointer;
  padding: 0;
  appearance: none;
  font: inherit;
}

.ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ref-thumb--video {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: linear-gradient(160deg, #2c2c44, #1c1c2c);
  color: #d8d3ff;
  font-size: 12px;
}

.ref-thumb--audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: linear-gradient(160deg, #f3f0ff, #e9e3ff);
  color: var(--accent-strong);
  font-size: 12px;
}

.ref-thumb .ic {
  width: 16px;
  height: 16px;
}

.ref-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(20, 20, 24, 0.78);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  z-index: 2;
}

.ref-remove:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.ref-remove .ic {
  width: 9px;
  height: 9px;
}

.ref-add-more {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--text-2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.ref-add-more:hover {
  border-color: var(--accent-line);
  color: var(--accent-strong);
}

.ref-add-more .ic {
  width: 11px;
  height: 11px;
}

.ref-preview {
  position: fixed;
  z-index: 110;
  max-width: min(320px, calc(100vw - 24px));
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.ref-preview img {
  display: block;
  max-width: 240px;
  max-height: 320px;
  width: auto;
  height: auto;
}

.ref-preview video {
  display: block;
  max-width: 280px;
  max-height: 320px;
  background: #000;
}

.ref-preview-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  color: var(--text-2);
  font-size: 12px;
}

.ref-preview-audio .ic {
  width: 26px;
  height: 26px;
  color: var(--accent);
}

.ref-add {
  position: relative;
  width: 52px;
  height: 52px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid #ededed;
  border-radius: 10px;
  background: #f5f5f6;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.ref-add:hover {
  border-color: #e2e2e6;
  background: #f0f0f2;
  color: var(--text-2);
}

.ref-role {
  position: absolute;
  left: 3px;
  bottom: 3px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-2);
  font-size: 12px;
  line-height: 15px;
  z-index: 2;
  pointer-events: none;
}

.help-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.ref-add .ic {
  width: 16px;
  height: 16px;
}

.ref-add input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.ref-add:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.prompt-col {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.prompt-input {
  display: block;
  width: 100%;
  min-height: 52px;
  max-height: 160px;
  padding: 2px 0 22px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.65;
  resize: none;
}

.prompt-input::placeholder {
  color: #a3a3a8;
}

.char-count {
  position: absolute;
  right: 0;
  bottom: 4px;
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.char-warn {
  margin-top: 2px;
  color: var(--danger);
  font-size: 12px;
}

/* 工具条 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.tool-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}

.tool-right {
  margin-left: auto;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-wrap {
  position: relative;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.tool-chip:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.tool-chip[aria-expanded="true"] {
  background: var(--accent-weak);
  color: var(--accent-strong);
}

.tool-chip[aria-pressed="true"] {
  background: var(--accent-weak);
  color: var(--accent-strong);
}

.tool-chip .ic {
  width: 14px;
  height: 14px;
}

.tool-chip .chevron {
  width: 12px;
  height: 12px;
  opacity: 0.65;
}

.tool-chip .sparkle {
  color: var(--accent);
}

.tool-at {
  justify-content: center;
  width: 28px;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
}

.tool-static {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px;
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}

.tool-static .sparkle {
  color: var(--accent);
  width: 14px;
  height: 14px;
}

.credits {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.credits .sparkle {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.submit-btn {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(124, 92, 255, 0.3);
  transition: background 0.12s ease, opacity 0.12s ease;
}

.submit-btn:hover:not(:disabled) {
  background: var(--accent-strong);
}

.submit-btn:disabled {
  background: #ededed;
  color: #b9b9bd;
  box-shadow: none;
  cursor: not-allowed;
}

.submit-btn .ic {
  width: 17px;
  height: 17px;
}

.submit-btn.is-loading .ic {
  animation: spin 0.9s linear infinite;
}

/* ---------- 弹出面板 ---------- */
.menu {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  min-width: 180px;
  max-width: calc(100vw - 72px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-pop);
  animation: menu-in 0.12s ease;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.menu-title {
  margin: 4px 6px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 36px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}

.menu-item:hover:not(:disabled) {
  background: var(--bg-soft);
}

.menu-item.is-active {
  background: var(--accent-weak);
  color: var(--accent-strong);
}

.menu-item:disabled {
  color: #c4c4c8;
  cursor: not-allowed;
}

.menu-item .ic {
  width: 16px;
  height: 16px;
  color: var(--text-2);
}

.menu-item.is-active .ic {
  color: var(--accent);
}

.menu-item:disabled .ic {
  color: #d5d5d8;
}

.menu-item-label {
  flex: 1 1 auto;
  min-width: 0;
}

.menu-item-desc {
  color: var(--faint);
  font-size: 12px;
}

.menu-check {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex: none;
}

.menu-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

.menu-mode {
  width: 236px;
}

.menu-fullref {
  width: 240px;
}

.menu-output {
  width: 320px;
  padding: 12px;
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.ratio-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.ratio-option:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.ratio-option.is-active {
  border-color: var(--accent-line);
  background: #f8f5ff;
  color: var(--accent-strong);
}

.ratio-shape {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.ratio-shape::before {
  content: "";
  display: block;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.ratio-shape.r-21-9::before {
  width: 22px;
  height: 9px;
}

.ratio-shape.r-16-9::before {
  width: 21px;
  height: 12px;
}

.ratio-shape.r-4-3::before {
  width: 18px;
  height: 14px;
}

.ratio-shape.r-1-1::before {
  width: 16px;
  height: 16px;
}

.ratio-shape.r-3-4::before {
  width: 14px;
  height: 18px;
}

.ratio-shape.r-9-16::before {
  width: 12px;
  height: 20px;
}

.seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: #f3f3f5;
}

.seg-item {
  flex: 1 1 0;
  min-width: 0;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
}

.seg-item.is-active {
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.menu-duration {
  width: 340px;
  padding: 14px;
}

.duration-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.duration-control input[type="range"] {
  flex: 1 1 100%;
  width: 100%;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.duration-ticks {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: -4px;
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.duration-input {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.duration-input input {
  width: 42px;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  text-align: right;
}

.menu-hint {
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
}

.menu-at {
  width: 252px;
  padding: 14px;
}

.at-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.at-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}

.at-item:hover {
  background: var(--bg-soft);
}

.at-item .ic {
  width: 15px;
  height: 15px;
  color: var(--text-2);
}

.at-item-tag {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.at-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0 2px;
  text-align: center;
}

.at-empty-icon {
  width: 76px;
  height: 76px;
  color: #dedee2;
}

.at-empty-icon svg {
  width: 100%;
  height: 100%;
}

.at-empty-text {
  color: var(--faint);
  font-size: 12px;
}

.at-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  margin-top: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.at-empty-btn:hover {
  background: var(--bg-soft);
}

.at-empty-btn .ic {
  width: 13px;
  height: 13px;
}

.at-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* 视频 / 音频参考 */
.advanced-refs {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.adv-ref-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ref-file-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border: 1px dashed #d9d9dd;
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
}

.ref-file-chip:hover {
  border-color: var(--accent-line);
  color: var(--accent-strong);
}

.ref-file-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ref-file-chip .ic {
  width: 13px;
  height: 13px;
}

.ref-file-chip:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ref-file-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ref-file-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  height: 26px;
  padding: 0 6px 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-ghost);
  color: var(--text-2);
  font-size: 12px;
}

.ref-file-name {
  max-width: 150px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ref-file-remove {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.ref-file-remove:hover {
  background: #ececef;
  color: var(--danger);
}

.ref-file-remove .ic {
  width: 10px;
  height: 10px;
}

.adv-refs-hint {
  flex: 1 1 100%;
  color: var(--faint);
  font-size: 12px;
}

/* ============================ 规则抽屉 ============================ */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.28);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  width: min(440px, 100vw);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(0, 0, 0, 0.12);
  transition: transform 0.22s ease, visibility 0.22s ease;
}

.drawer[data-open="0"] {
  transform: translateX(102%);
  visibility: hidden;
}

.drawer-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.drawer-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.drawer-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 20px 36px;
}

.drawer-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.drawer-section:last-child {
  border-bottom: none;
}

.drawer-section h3 {
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 600;
}

.drawer-section h4 {
  margin: 12px 0 6px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.drawer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-list > li {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.drawer-list--tight {
  gap: 5px;
}

.drawer-list--tight > li {
  font-size: 12px;
}

.drawer-defs dt {
  display: flex;
  margin-top: 8px;
}

.drawer-defs dd {
  margin: 2px 0 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.drawer-note {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--accent-line);
  border-radius: 8px;
  background: #faf8ff;
  color: #6b5a9e;
  font-size: 12px;
  line-height: 1.6;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-subject {
  color: var(--accent-strong);
  border-color: var(--accent-line);
  background: var(--accent-weak);
}

.tag-picture {
  color: #2563a8;
  border-color: #d4e4f6;
  background: #f2f8fe;
}

.tag-video {
  color: #227a52;
  border-color: #d3ecdf;
  background: #f2fbf6;
}

.tag-audio {
  color: #9a6a12;
  border-color: #f0e2c6;
  background: #fdf9f0;
}

.tag-shot,
.tag-neutral {
  color: var(--text-2);
}

body.drawer-open,
body.modal-open {
  overflow: hidden;
}

/* ============================ 弹层 ============================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  transition: visibility 0.18s ease;
}

.modal[data-open="0"] {
  visibility: hidden;
  pointer-events: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(2px);
}

.modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: min(88vh, 900px);
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.modal-panel--sm {
  width: min(560px, 100%);
}

.modal[data-open="0"] .modal-panel {
  transform: translateY(8px);
  opacity: 0;
}

.modal-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.modal-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 构建器 */
.builder-section {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.builder-section:first-child {
  padding-top: 0;
  border-top: none;
}

.builder-section h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
}

.sec-en {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field-label {
  color: var(--text-2);
  font-size: 12px;
}

.field-hint {
  color: var(--faint);
  font-size: 12px;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input[type="text"]:hover,
input[type="number"]:hover,
textarea:hover,
select:hover {
  border-color: #d5d5da;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

textarea {
  resize: vertical;
  min-height: 54px;
}

select {
  appearance: auto;
  cursor: pointer;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

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

.counts-label {
  color: var(--text-2);
  font-size: 12px;
}

.count-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
}

.count-field input {
  width: 46px;
  padding: 2px 4px;
  border: none;
  background: transparent;
  box-shadow: none;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-ghost);
}

.row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.row-label-input {
  flex: 1 1 120px;
  max-width: 240px;
  padding: 4px 8px;
  border-color: transparent;
  background: transparent;
  font-size: 12px;
}

.row-label-input:hover {
  border-color: var(--line);
}

.row-note {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.row-head .icon-btn {
  margin-left: auto;
}

.dialogue-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}

.check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.dialogue-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.dialogue-text {
  grid-column: span 2;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.chip:hover {
  border-color: #d5d5da;
  color: var(--text);
}

.chip[data-checked="1"] {
  border-color: var(--accent-line);
  background: var(--accent-weak);
  color: var(--accent-strong);
}

.chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chip:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chip-check {
  display: none;
  width: 11px;
  height: 11px;
}

.chip[data-checked="1"] .chip-check {
  display: block;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.builder-report {
  min-height: 42px;
  padding: 10px 11px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--bg-ghost);
  color: var(--muted);
  font-size: 12px;
}

.builder-report:empty {
  display: none;
}

.report-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}

.report-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.report-summary {
  padding: 1px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
}

.report-empty {
  color: var(--muted);
  font-size: 12px;
}

.issue-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.issue {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.issue[data-level="error"] {
  border-color: #f6d4d5;
  background: #fff7f7;
}

.issue[data-level="warn"] {
  border-color: #f0e2c6;
  background: #fdf9f0;
}

.issue-level {
  flex: none;
  padding: 1px 6px;
  border: 1px solid #f6d4d5;
  border-radius: 4px;
  background: #fff;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.issue[data-level="warn"] .issue-level {
  border-color: #f0e2c6;
  color: var(--amber);
}

.issue-body {
  min-width: 0;
}

.issue-msg {
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.issue-hint {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.report-stats {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

/* 通用小按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--bg-soft);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-soft);
  color: var(--text);
}

.btn-sm {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
}

.btn .ic {
  width: 14px;
  height: 14px;
}

/* 使用说明 */
.help-block h3 {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.help-list {
  padding-left: 18px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.8;
}

.help-list li {
  margin-bottom: 3px;
}

.help-list strong {
  color: var(--text);
  font-weight: 600;
}

/* ============================ Toast ============================ */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  pointer-events: auto;
  animation: toast-in 0.16s ease;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast[data-level="success"] {
  border-left-color: var(--green);
}

.toast[data-level="warn"] {
  border-left-color: var(--amber);
}

.toast[data-level="error"] {
  border-left-color: var(--danger);
}

.toast-icon {
  flex: none;
  margin-top: 1px;
  color: var(--accent);
}

.toast[data-level="success"] .toast-icon {
  color: var(--green);
}

.toast[data-level="warn"] .toast-icon {
  color: var(--amber);
}

.toast[data-level="error"] .toast-icon {
  color: var(--danger);
}

.toast-icon .ic {
  width: 14px;
  height: 14px;
}

.toast-msg {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast-close {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
}

.toast-close:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.toast-close .ic {
  width: 11px;
  height: 11px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.noscript {
  max-width: 720px;
  margin: 40px auto;
  padding: 16px;
  border: 1px solid #f0e2c6;
  border-radius: 10px;
  color: var(--amber);
  background: #fdf9f0;
}

/* ============================ 滚动条 ============================ */

.feed-wrap::-webkit-scrollbar,
.works-view::-webkit-scrollbar,
.history-list::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.feed-wrap::-webkit-scrollbar-thumb,
.works-view::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb,
.drawer-body::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: #dcdcdf;
  border-radius: 8px;
}

.feed-wrap::-webkit-scrollbar-track,
.works-view::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track,
.drawer-body::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

/* ============================ 响应式 ============================ */

@media (max-width: 1280px) {
  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .feed {
    max-width: 860px;
  }

  .composer {
    max-width: 860px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    transform: translateX(-104%);
    box-shadow: 18px 0 50px rgba(0, 0, 0, 0.12);
    border-right: 1px solid var(--line);
  }

  .app.is-sidebar-open .sidebar {
    transform: none;
  }

  .app.is-sidebar-collapsed .sidebar {
    width: 260px;
    padding: 12px 10px;
  }

  .app.is-sidebar-collapsed .brand-name,
  .app.is-sidebar-collapsed .nav-label,
  .app.is-sidebar-collapsed .side-entry-label,
  .app.is-sidebar-collapsed .tag-new,
  .app.is-sidebar-collapsed .side-foot-btn span,
  .app.is-sidebar-collapsed .side-foot-btn .ic {
    display: initial;
  }

  .app.is-sidebar-collapsed .history {
    display: flex;
  }

  .app.is-sidebar-collapsed .nav-item,
  .app.is-sidebar-collapsed .side-entry,
  .app.is-sidebar-collapsed .side-foot-btn {
    justify-content: initial;
    padding: 0 10px;
  }

  .app.is-sidebar-collapsed .sidebar-head {
    justify-content: space-between;
    padding: 2px 4px 10px;
  }

  .hamburger {
    display: inline-grid;
  }

  .main-head {
    height: 56px;
    padding: 0 16px;
  }

  .main-title {
    font-size: 17px;
  }

  .key-line {
    margin: 0 16px 2px;
  }

  .feed {
    max-width: none;
    padding: 4px 16px 24px;
  }

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px 16px 32px;
    gap: 12px;
  }

  .composer-dock {
    padding: 6px 16px 14px;
  }

  .composer {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .main-title {
    font-size: 16px;
  }

  .conn {
    padding: 0 8px;
    font-size: 12px;
  }

  .composer-row {
    flex-direction: column;
    gap: 8px;
  }

  .refs-col {
    max-width: none;
    width: 100%;
  }

  .ref-list:empty {
    display: none;
  }

  .prompt-col {
    width: 100%;
  }

  .prompt-input {
    min-height: 46px;
  }

  .toolbar {
    gap: 4px;
  }

  .tool-chip,
  .tool-static {
    height: 26px;
    padding: 0 6px;
    font-size: 12px;
  }

  .tool-left {
    gap: 1px;
  }

  .menu {
    max-width: calc(100vw - 44px);
  }

  .menu-output,
  .menu-duration {
    width: min(340px, calc(100vw - 44px));
  }

  .ratio-grid {
    gap: 2px;
  }

  .ratio-option {
    font-size: 12px;
    padding: 6px 0 4px;
  }

  .works-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gen {
    padding-bottom: 26px;
  }

  .gen-meta {
    white-space: normal;
  }

  .gen-download {
    opacity: 1;
    transform: none;
  }

  .modal {
    padding: 10px;
  }

  .modal-panel {
    max-height: 92vh;
    border-radius: 14px;
  }

  .modal-head,
  .modal-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .drawer {
    width: 100vw;
  }

  .dialogue-text {
    grid-column: auto;
  }

  .toasts {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }
}

@media (max-width: 380px) {
  .main-head {
    padding: 0 10px;
  }

  .feed,
  .works-grid {
    padding-left: 10px;
    padding-right: 10px;
  }

  .composer-dock {
    padding: 4px 8px 10px;
  }

  .composer {
    padding: 10px;
  }

  .tool-chip .chevron {
    display: none;
  }

  .pill-btn span {
    display: none;
  }
}

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

/* ================= 优化提示词 + 提示词悬停浮层 ================= */

.tool-chip.tool-optimize[aria-pressed="true"] {
  color: #6a4bff;
  background: #f1edff;
  border-color: #ddd3ff;
}

.prompt-pop {
  position: fixed;
  z-index: 80;
  padding: 14px 16px 12px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(17, 17, 17, 0.14);
  max-height: 46vh;
  overflow: auto;
  color: #1a1a1a;
}

.prompt-pop-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.72;
}

.prompt-pop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f1f1;
}

.prompt-pop-hint {
  font-size: 12px;
  color: #9a9a9a;
}

.gen-elapsed {
  margin: 6px 0 0;
  font-size: 12px;
  color: #9a9a9a;
}

@media (max-width: 560px) {
  .tool-chip.tool-optimize span {
    display: none;
  }
  .prompt-pop {
    left: 12px !important;
    right: 12px;
    width: auto !important;
  }
}

/* ================================================================
   即梦对齐层（数值来自真实 DOM 采样：docs 见 .tools/jimeng-capture）
   - 字体：CapCut Sans → PingFang SC → Hiragino Sans GB → Microsoft YaHei
   - 主色：蓝 rgb(0,142,229)；正文纯黑；次级 #737373；三级 #8C8C8C
   - 底色 #F8F9FA，内容白；hover rgba(0,0,0,.05)，选中 rgba(0,0,0,.07)
   - 圆角：卡片 12 / 控件 8 / chip 6 / 浮层 16
   ================================================================ */

:root {
  --bg: #f8f9fa;
  --bg-soft: #f2f3f5;
  --bg-ghost: #f7f8f9;
  --line: #ededed;
  --line-strong: #e2e2e2;
  --text: #000000;
  --text-2: #737373;
  --muted: #8c8c8c;
  --faint: #b3b3b3;
  --accent: #008ee5;
  --accent-strong: #0077c2;
  --accent-weak: rgba(0, 142, 229, 0.12);
  --accent-line: rgba(0, 142, 229, 0.28);
  --radius: 12px;
  --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.06);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.12);
  --hover: rgba(0, 0, 0, 0.05);
  --selected: rgba(0, 0, 0, 0.07);
  --sans: "CapCut Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 21px;
  color: var(--text);
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
}

/* 外壳：侧栏浅灰、内容纯白 */
.app {
  background: var(--bg);
}

.main {
  background: #fff;
}

.sidebar {
  width: 240px;
  padding: 12px;
  gap: 2px;
  background: var(--bg);
  border-right: none;
}

.sidebar-head {
  padding: 2px 0 10px;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2ea7ff, #0066e6);
  box-shadow: none;
}

.icon-btn {
  border-radius: 6px;
  color: var(--text-2);
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}

/* 导航：36 高、8 圆角、6/12/6/8 内边距、14/500 */
.nav {
  gap: 4px;
}

.nav-item {
  height: 36px;
  padding: 0 12px 0 8px;
  gap: 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.nav-item .ic {
  width: 18px;
  height: 18px;
  color: var(--text-2);
}

.nav-item:hover {
  background: var(--hover);
}

.nav-item.is-active {
  background: var(--selected);
  color: var(--text);
  font-weight: 500;
  box-shadow: rgba(0, 0, 0, 0.07) 0 0 0 1px inset;
}

.nav-item.is-active .ic {
  color: var(--text);
}

.nav-section-title,
.side-section-title {
  color: var(--text-2);
  font-size: 12px;
  line-height: 20px;
  font-weight: 400;
}

.history-item {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
}

.history-item:hover {
  background: var(--hover);
}

.history-item.is-active {
  background: var(--selected);
  box-shadow: rgba(0, 0, 0, 0.07) 0 0 0 1px inset;
}

/* 主区 */
.main-head {
  height: 56px;
  padding: 0 24px;
}

.main-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
}

.feed {
  max-width: 1000px;
  padding: 4px 24px 24px;
}

.feed-day {
  margin: 16px 0 12px;
  font-size: 13px;
  color: var(--text-2);
}

.gen {
  padding: 4px 0 30px;
}

.gen-prompt {
  font-size: 14px;
  line-height: 21px;
  color: var(--text);
}

.gen-meta {
  font-size: 12px;
  line-height: 20px;
  color: var(--text-2);
}

.gen-detail-btn {
  font-size: 12px;
  color: var(--text-2);
}

.gen-actions {
  margin-top: 10px;
  gap: 8px;
}

/* 结果下方操作：浅灰底、8 圆角、32 高、13/500 */
.pill-btn {
  height: 32px;
  padding: 0 12px;
  gap: 6px;
  border: none;
  border-radius: 8px;
  background: var(--hover);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.pill-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.08);
}

.pill-btn .ic {
  width: 15px;
  height: 15px;
}

/* 输入条 */
.composer-dock {
  padding: 8px 24px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 30%);
}

.composer {
  max-width: 1000px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.composer:focus-within {
  border-color: rgba(0, 0, 0, 0.16);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

#prompt {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 21px;
  color: var(--text);
}

#prompt::placeholder {
  color: var(--faint);
}

/* 工具条 chip：13/500、28 高、6 圆角、悬停浅灰 */
.tool-chip,
.tool-static {
  height: 28px;
  padding: 0 8px;
  gap: 6px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.tool-chip:hover {
  background: var(--hover);
  color: var(--text);
}

.tool-chip[aria-expanded="true"] {
  background: var(--selected);
  color: var(--text);
}

.tool-chip[aria-pressed="true"],
.tool-chip.tool-optimize[aria-pressed="true"] {
  background: var(--accent-weak);
  color: var(--accent-strong);
}

.tool-chip .ic,
.tool-static .ic {
  width: 15px;
  height: 15px;
}

.tool-at {
  width: 28px;
  font-size: 14px;
}

.credits {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  gap: 4px;
}

.credits .sparkle,
.tool-static .sparkle,
.tool-chip .sparkle {
  color: var(--text);
}

/* 提交：32 圆；可用为黑，禁用为浅灰 */
.submit-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  box-shadow: none;
}

.submit-btn:hover:not(:disabled) {
  background: #000;
}

.submit-btn:disabled {
  background: rgba(0, 0, 0, 0.08);
  color: #b3b3b3;
}

.submit-btn .ic {
  width: 16px;
  height: 16px;
}

/* 弹层 / 菜单 */
.menu {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
}

.menu-title {
  font-size: 12px;
  line-height: 20px;
  color: var(--text-2);
}

.seg-item {
  height: 30px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.seg-item:hover {
  background: var(--hover);
  color: var(--text);
}

.seg-item.is-active {
  background: var(--selected);
  color: var(--text);
  box-shadow: rgba(0, 0, 0, 0.12) 0 0 0 1px inset;
}

/* 对话流里的视频块：12 圆角、无边框 */
.gen-video {
  border-radius: 12px;
  border: none;
  background: #f2f3f5;
}

/* 提示词浮层 */
.prompt-pop {
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
}

.prompt-pop-text {
  font-size: 14px;
  line-height: 21px;
  color: var(--text);
}

/* 顶栏状态 */
.conn,
.status-pill {
  font-size: 12px;
  color: var(--text-2);
}

/* 滚动条更接近系统观感 */
.feed-wrap::-webkit-scrollbar,
.history::-webkit-scrollbar {
  width: 8px;
}

.feed-wrap::-webkit-scrollbar-thumb,
.history::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

/* ---------------- 即梦对齐·修正（对照真实会话页逐项量过） ---------------- */
/* 结果下方按钮：白底 + 1px 边框，不是灰底 */
.pill-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
  color: #000;
  font-size: 13px;
  font-weight: 500;
  gap: 6px;
}

.pill-btn:hover:not(:disabled) {
  background: #f7f8f9;
  border-color: #d9d9d9;
}

.pill-btn .ic {
  color: #737373;
}

/* 结果媒体：即梦是方角、浅灰占位 */
.gen-video,
.gen-result {
  border-radius: 0;
}

.gen-video {
  border: none;
  background: #f7f7f8;
}

.gen-progress {
  border-radius: 0;
  background: #f7f7f8;
}

/* 标题更大更黑 */
.main-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  color: #000;
}

/* 侧栏历史：14px、34 高、8 圆角 */
.history-item {
  height: 34px;
  border-radius: 8px;
  font-size: 14px;
  color: #000;
}

.history-item.is-active {
  background: #f2f3f5;
  box-shadow: none;
}

.nav-section-title,
.side-section-title {
  font-size: 13px;
  line-height: 20px;
  color: #8c8c8c;
  padding: 8px;
}

/* 输入条：更像即梦（16 圆角、极浅阴影、占位灰） */
.composer {
  border-radius: 16px;
  border: 1px solid #ededed;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.composer:focus-within {
  border-color: #e0e0e0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

#prompt::placeholder {
  color: #8c8c8c;
}

/* 参考内容方块：48×48、8 圆角、浅灰 */
.ref-add {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid #ededed;
  background: #fafafa;
  color: #8c8c8c;
  font-size: 12px;
}

.ref-add:hover {
  background: #f2f3f5;
}

/* 工具条主模式 chip 用品牌蓝（即梦的「视频生成」就是蓝字蓝图标） */
#mode-trigger {
  color: #008ee5;
}

#mode-trigger .ic {
  color: #008ee5;
}

#mode-trigger[aria-expanded="true"] {
  background: rgba(0, 142, 229, 0.1);
  color: #0077c2;
}

/* 提交按钮：禁用浅灰、可用纯黑 */
.submit-btn {
  width: 34px;
  height: 34px;
  background: #1a1a1a;
}

.submit-btn:disabled {
  background: #e5e5e5;
  color: #8c8c8c;
}

/* 顶部状态点弱化 */
.conn .dot,
.status-dot {
  background: #00b368;
}

.conn {
  font-size: 12px;
  color: #737373;
}

/* ---------------- 即梦对齐·收尾 ---------------- */
/* 参考内容方块：56×56、11px 不换行 */
.ref-add {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 8px;
  gap: 2px;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: 0;
  white-space: nowrap;
  flex-direction: column;
}

.ref-add .ic {
  width: 16px;
  height: 16px;
}

/* 标题与内容列左对齐（即梦的「今天」是和正文同一条左边线） */
.main-title {
  margin-left: max(0px, calc((100% - 1000px) / 2 - 24px));
}

.main-head {
  padding: 0 24px;
}

/* ================= MiSans 本地字体（开源免费商用） ================= */
/* 已在 index.html 引入 ./fonts/misans.css，这里只把字体栈接到最前 */
:root {
  --sans: "MiSans", "CapCut Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

body,
input,
textarea,
button,
select {
  font-family: var(--sans);
}

/* 数字用等宽数字，读数和即梦更像 */
.main-title,
.gen-meta,
.credits,
.usage-pill,
.estimate-yuan {
  font-variant-numeric: tabular-nums;
}

/* ================= 顶栏积分与使用情况 ================= */
.usage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #000;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.usage-pill:hover {
  background: rgba(0, 0, 0, 0.05);
}

.usage-pill[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.07);
}

.usage-pill .ic {
  width: 15px;
  height: 15px;
  color: #008ee5;
}

.usage-pop {
  position: fixed;
  z-index: 70;
  width: 320px;
  padding: 16px;
  border: 1px solid #ededed;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  color: #000;
}

.usage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.usage-title {
  font-size: 14px;
  font-weight: 600;
}

.usage-sub {
  font-size: 12px;
  color: #8c8c8c;
}

.usage-rows {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.usage-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: #737373;
}

.usage-row b {
  font-size: 15px;
  font-weight: 600;
  color: #000;
  font-variant-numeric: tabular-nums;
}

.usage-days {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 64px;
  padding: 8px 0 0;
  margin-bottom: 10px;
}

.usage-day {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.usage-day-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: rgba(0, 142, 229, 0.35);
}

.usage-day[data-today="1"] .usage-day-bar {
  background: #008ee5;
}

.usage-day-label {
  font-size: 12px;
  color: #8c8c8c;
}

.usage-note {
  font-size: 12px;
  line-height: 16px;
  color: #8c8c8c;
}

/* ================= 输入条：无边框 + 高度自适应（对齐即梦） ================= */
.composer {
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.composer:focus-within {
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

#prompt {
  resize: none;
  overflow-y: hidden;
  min-height: 52px;
  max-height: 45vh;
  padding: 0;
  border: none;
  background: transparent;
  outline: none;
}

.composer-row {
  align-items: flex-start;
}

.prompt-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* 字数统计：不压住提交按钮，平时隐藏，接近上限才出现 */
.char-count {
  position: static;
  align-self: flex-end;
  margin: 2px 2px 0 0;
  color: #b3b3b3;
  font-size: 12px;
  line-height: 14px;
}

.char-count[data-warn="1"] {
  color: #e5484d;
}

.char-count[hidden] {
  display: none;
}

/* ================= 交互状态：默认无阴影，悬停/聚焦才有（对齐即梦） ================= */
.composer {
  box-shadow: none;
  transition: box-shadow 0.18s ease, background-color 0.18s ease;
}

.composer:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

.composer:focus-within {
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.1);
}

/* 参考内容方块与缩略图的悬停反馈 */
.ref-add {
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ref-add:hover {
  background: #f2f3f5;
  border-color: #e5e5e5;
}

.ref-item img,
.ref-thumb img {
  transition: transform 0.18s ease;
}

.ref-item:hover img,
.ref-thumb:hover img {
  transform: scale(1.03);
}

/* 侧栏折叠按钮 / 帮助按钮 */
.icon-btn {
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* ================= 清晰度修正（2026-11-04） ================= */
/* 1) 去掉输入框聚焦时的紫色光晕：它就是“字发虚”的元凶之一 */
#prompt:focus,
#prompt:focus-visible,
textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  box-shadow: none;
  border-color: #e5e5e5;
  outline: none;
}

/* 2) 交给系统做字体平滑，避免强制灰度抗锯齿把字变细 */
html,
body,
body * {
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

/* 3) MiSans 的 Regular 实际只有 330 字重，比雅黑细一圈；正文改用 Medium(500) 才清晰 */
body {
  font-weight: 500;
}

.gen-prompt,
.gen-meta,
.history-item,
.nav-item,
#prompt,
.usage-row,
.usage-day-label,
.feed-day,
.pill-btn,
.tool-chip,
.tool-static,
.ref-add,
.composer textarea {
  font-weight: 500;
}

.gen-detail-btn,
.usage-sub,
.usage-note,
.prompt-pop-hint,
.key-line {
  font-weight: 500;
}

/* 标题保持 600 */
.main-title,
.usage-title,
.card-title,
.brand-name {
  font-weight: 600;
}

/* ============ 交互状态：按即梦实测值覆盖（2026-11-04 采自登录态真实页面） ============ */
/* 输入条：默认无阴影；hover 才出现双层柔和阴影；过渡 0.35s cubic-bezier(.15,.75,.3,1) */
.composer {
  box-shadow: none;
  transition: box-shadow 0.35s cubic-bezier(0.15, 0.75, 0.3, 1);
}

.composer:hover,
.composer:focus-within {
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.04), 0 6px 24px rgba(0, 0, 0, 0.03);
}

/* 结果按钮：浅灰底 rgba(0,0,0,.05)，hover .07，8 圆角，无过渡 */
.pill-btn,
.more-menu,
.pill-icon {
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  transition: background-color 0s;
}

.pill-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.07);
  border: none;
}

.pill-btn:active:not(:disabled) {
  background: rgba(0, 0, 0, 0.09);
}

/* 侧栏导航/历史：hover 5%，圆角 8，背景过渡 0.12s ease */
.nav-item,
.history-item {
  border-radius: 8px;
  transition: background-color 0.12s ease;
}

.nav-item:hover,
.history-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav-item.is-active,
.history-item.is-active {
  background: rgba(0, 0, 0, 0.07);
}

/* 文字输入区本身不要任何描边/光晕 */
#prompt,
#prompt:hover,
#prompt:focus,
#prompt:focus-visible {
  box-shadow: none;
  border: none;
  outline: none;
  background: transparent;
}

/* 文字可读性兜底：三级灰提亮（即梦是 #8c8c8c，不是 #b3b3b3） */
:root {
  --faint: #8c8c8c;
}

#prompt::placeholder,
input::placeholder,
textarea::placeholder {
  color: #8c8c8c;
  opacity: 1;
}

/* ============ 字体最终选择（依据 4 组同屏对照，2026-11-04） ============
   对照结论：同一 14px、同一段中文下
   - 即梦（CapCut Sans）：细而清晰
   - MiSans 400：偏软偏灰
   - MiSans 500：发糊（笔画粘连）
   - 微软雅黑 400：边缘最锐利
   因此：系统字体优先（Mac 走苹方、Windows 走雅黑），MiSans 仅作兜底保留。
   ========================================================================= */

:root {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", "MiSans", Arial, sans-serif;
}

body {
  font-family: var(--sans);
  font-weight: 400;
}

/* 正文/摘要回到 400；交互控件维持 500（与即梦一致） */
#prompt,
.gen-prompt,
.gen-meta,
.history-item,
.feed-day,
.usage-row,
.usage-day-label,
.usage-sub,
.usage-note,
.prompt-pop-text,
.ref-add,
.composer textarea {
  font-weight: 400;
}

.nav-item,
.pill-btn,
.tool-chip,
.tool-static {
  font-weight: 500;
}

.main-title,
.usage-title,
.usage-row b,
.brand-name {
  font-weight: 600;
}

/* 输入条阴影只在「鼠标悬停」时出现；聚焦不再保留阴影（对齐即梦的悬停反馈） */
.composer:focus-within {
  box-shadow: none;
}

.composer:hover {
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.04), 0 6px 24px rgba(0, 0, 0, 0.03);
}

/* 缩略图角色徽标：现在是可点击按钮（参考图 → 首帧 → 尾帧） */
.ref-role {
  position: absolute;
  left: 6px;
  bottom: 6px;
  height: 20px;
  padding: 0 7px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.ref-role:hover {
  background: rgba(0, 0, 0, 0.78);
}

.ref-role:focus-visible {
  outline: 2px solid #008ee5;
  outline-offset: 1px;
}

/* 角色徽标必须是可点击的（覆盖旧版 pointer-events:none） */
.ref-tile {
  position: relative;
}

.ref-role {
  pointer-events: auto;
  z-index: 5;
  cursor: pointer;
}

.ref-thumb img {
  pointer-events: none;
}

/* ================= 时长浮层：刻度可点击（对齐即梦） ================= */
.duration-ticks {
  position: relative;
  display: block;
  width: 100%;
  height: 24px;
  margin-top: 4px;
}

.duration-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  min-width: 26px;
  height: 20px;
  padding: 0 6px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.duration-tick:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #000;
}

.duration-tick.is-active {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
  font-weight: 500;
}

/* 右侧数字框：数字大、单位小 */
.duration-input input {
  width: 40px;
  border: none;
  background: transparent;
  color: #000;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.duration-input .duration-unit {
  margin-left: 2px;
  font-size: 12px;
  color: #8c8c8c;
}

/* 时长浮层版式：滑块在上、刻度在下、数字框在右侧垂直居中（对齐即梦） */
.duration-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
}

.duration-control input[type="range"] {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  margin: 0;
  accent-color: #8c8c8c;
}

.duration-ticks {
  grid-column: 1;
  grid-row: 2;
}

.duration-input {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: #f2f3f5;
}

.duration-input input {
  width: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: #000;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.duration-input input::-webkit-outer-spin-button,
.duration-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.duration-input .duration-unit {
  font-size: 12px;
  color: #8c8c8c;
}

.menu-duration {
  width: 380px;
  padding: 16px;
}

/* ================= 时长滑块（照即梦的视觉重画） ================= */
.duration-control {
  grid-template-columns: minmax(0, 1fr) auto;
}

.duration-slider {
  grid-column: 1;
  grid-row: 1;
  padding: 7px 0;
  cursor: pointer;
  touch-action: none;
  outline: none;
}

.duration-slider:focus-visible .ds-thumb {
  box-shadow: 0 0 0 3px rgba(0, 142, 229, 0.18), 0 1px 4px rgba(0, 0, 0, 0.18);
}

.ds-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #f2f3f5;
}

.ds-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #d4d4d4;
}

.ds-tick {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 8px;
  margin-left: -1px;
  transform: translateY(-50%);
  border-radius: 1px;
  background: #dcdcdc;
}

.ds-tick[hidden] {
  display: none;
}

.ds-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  border: 1px solid #dcdcdc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

/* 刻度标签：选中项是灰色胶囊 */
.duration-ticks {
  grid-column: 1;
  grid-row: 2;
  margin-top: 6px;
}

.duration-tick {
  min-width: 24px;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 20px;
  color: #8c8c8c;
}

.duration-tick.is-active {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
}

.duration-tick:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #000;
}


/* ================= 内联画幅选择（不弹层）================= */
.ratio-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ratio-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #737373;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.ratio-chip .ratio-shape {
  width: 14px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  flex: none;
}

.ratio-chip .ratio-shape.r-9-16 {
  width: 8px;
  height: 14px;
}

.ratio-chip .ratio-shape.r-16-9 {
  width: 14px;
  height: 8px;
}

.ratio-chip:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #000;
}

.ratio-chip.is-active {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  color: #000;
}

/* 时长选中刻度收窄 */
.duration-tick {
  min-width: 22px;
  padding: 0 6px;
}


/* 内联画幅：纯文字胶囊，窄；选中浅灰底 */
.ratio-chip {
  gap: 0;
  min-width: 44px;
  justify-content: center;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
}

.ratio-chip.is-active {
  background: rgba(0, 0, 0, 0.07);
  border: none;
  color: #000;
}

/* ================= 参考内容：即梦式堆叠 + 查看全部面板 ================= */
.refs-col {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

/* 空态：浅灰方块 + 加号 + 文案 */
.ref-add {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: #f4f4f5;
  color: #8c8c8c;
  font-size: 11px;
  line-height: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.ref-add .ic {
  width: 16px;
  height: 16px;
}

.ref-add:hover {
  background: #ececee;
  color: #595959;
}

/* 堆叠：旋转卡片 + 右下角圆形加号 */
.ref-stack-inner {
  position: relative;
  width: 68px;
  height: 56px;
}

.ref-stack-item {
  position: absolute;
  top: 4px;
  left: 6px;
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 4px;
  overflow: hidden;
  background: #f2f3f5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.ref-stack-item:nth-child(1) {
  transform: rotate(-6deg);
  z-index: 1;
}

.ref-stack-item:nth-child(2) {
  transform: translateX(6px) translateY(-2px) rotate(4deg);
  z-index: 2;
}

.ref-stack-item:nth-child(3) {
  transform: translateX(10px) translateY(2px) rotate(-2deg);
  z-index: 3;
}

.ref-stack-item:hover {
  transform: rotate(0deg) scale(1.04);
  z-index: 6;
}

.ref-stack-item img,
.ref-stack-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ref-stack-item--audio,
.ref-stack-item--video {
  display: grid;
  place-items: center;
  color: #737373;
}

.ref-add-round {
  position: absolute;
  right: -8px;
  bottom: -2px;
  z-index: 8;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #fff;
  color: #595959;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ref-add-round .ic {
  width: 12px;
  height: 12px;
}

.ref-add-round:hover {
  background: #f2f3f5;
}

/* 「查看全部」小按钮 */
.ref-viewall {
  height: 24px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  color: #000;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.ref-viewall:hover {
  background: rgba(0, 0, 0, 0.09);
}

/* 面板：位于输入条上方 */
.ref-panel {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto 10px;
  padding: 14px 16px 12px;
  border: 1px solid #ededed;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.ref-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ref-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ref-tab {
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #737373;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.ref-tab:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #000;
}

.ref-tab.is-active {
  background: #f2f3f5;
  color: #000;
}

.ref-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ref-clear {
  border: none;
  background: transparent;
  color: #737373;
  font-size: 12px;
  cursor: pointer;
}

.ref-clear:hover {
  color: #000;
}

.ref-collapse {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #737373;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ref-collapse:hover {
  background: rgba(0, 0, 0, 0.05);
}

.ref-collapse .ic {
  width: 14px;
  height: 14px;
}

.ref-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 10px;
}

.ref-grid .ref-tile {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  background: #f2f3f5;
}

.ref-tile-thumb {
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}

.ref-tile-thumb img,
.ref-tile-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ref-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 4;
}

.ref-remove .ic {
  width: 10px;
  height: 10px;
}

.ref-add--grid {
  width: 64px;
  height: 64px;
  border-radius: 6px;
}

.ref-hint {
  margin: 0;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 18px;
}

.ref-hint .ref-at {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin: 0 2px;
  border-radius: 50%;
  background: #f2f3f5;
  color: #595959;
  font-size: 11px;
}

/* 空态方块轻微倾斜，和即梦一致 */
.ref-add {
  transform: rotate(-3deg);
  transition: transform 0.15s ease, background-color 0.12s ease;
}

.ref-add:hover {
  transform: rotate(0deg);
}

/* ================= @ 素材引用面板（即梦式） ================= */
#at-menu {
  width: 292px;
  padding: 10px;
}

.at-title {
  margin: 0 6px 8px;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 18px;
}

.at-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
}

.at-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.at-row:hover,
.at-row.is-active {
  background: rgba(0, 0, 0, 0.05);
}

.at-thumb {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 6px;
  overflow: hidden;
  background: #f2f3f5;
  color: #737373;
  display: grid;
  place-items: center;
}

.at-thumb img,
.at-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.at-thumb .ic {
  width: 16px;
  height: 16px;
}

.at-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.at-row-label {
  font-size: 13px;
  line-height: 18px;
  color: #000;
}

.at-row-name {
  font-size: 11px;
  line-height: 16px;
  color: #8c8c8c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.at-foot {
  margin: 8px 6px 2px;
  font-size: 11px;
  line-height: 16px;
  color: #b3b3b3;
}

.at-preview {
  position: fixed;
  z-index: 90;
  width: 180px;
  height: 180px;
  border: 1px solid #ededed;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.at-preview img,
.at-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.at-preview-audio {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  gap: 8px;
  color: #737373;
  font-size: 12px;
}

/* 「查看全部」改成浮层，不再占布局高度：上传素材前后输入条不会跳动 */
.composer {
  padding-top: 38px;
}

.refs-col {
  position: relative;
}

.ref-viewall {
  position: absolute;
  top: -24px;
  left: 0;
  z-index: 9;
  height: 22px;
  padding: 0 9px;
  font-size: 12px;
  line-height: 22px;
}

.ref-stack-inner {
  margin-top: 0;
}

/* 堆叠缩略图：悬停右上角出现 X，可直接删除 */
.ref-stack-slot {
  position: absolute;
  top: 4px;
  left: 6px;
  width: 46px;
  height: 46px;
  transition: transform 0.15s ease;
}

.ref-stack-slot:nth-child(1) {
  transform: rotate(-6deg);
  z-index: 1;
}

.ref-stack-slot:nth-child(2) {
  transform: translateX(6px) translateY(-2px) rotate(4deg);
  z-index: 2;
}

.ref-stack-slot:nth-child(3) {
  transform: translateX(10px) translateY(2px) rotate(-2deg);
  z-index: 3;
}

.ref-stack-slot:hover,
.ref-stack-slot:focus-within {
  transform: rotate(0deg) scale(1.04);
  z-index: 10;
}

.ref-stack-item {
  position: static;
  width: 100%;
  height: 100%;
  transform: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.ref-stack-item:hover {
  transform: none;
}

.ref-stack-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 12;
  display: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  place-items: center;
  cursor: pointer;
}

.ref-stack-remove .ic {
  width: 9px;
  height: 9px;
}

.ref-stack-slot:hover .ref-stack-remove,
.ref-stack-slot:focus-within .ref-stack-remove {
  display: grid;
}

.ref-stack-remove:hover {
  background: rgba(0, 0, 0, 0.82);
}

/* 覆盖旧的缩略图绝对定位/旋转规则（旋转已移到 .ref-stack-slot） */
.ref-stack-slot .ref-stack-item,
.ref-stack-slot .ref-stack-item:nth-child(1),
.ref-stack-slot .ref-stack-item:nth-child(2),
.ref-stack-slot .ref-stack-item:nth-child(3),
.ref-stack-slot .ref-stack-item:hover {
  position: static;
  transform: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* 查看全部面板：成为输入条的一部分（无独立卡片边界），带展开动画 */
.ref-panel {
  width: 100%;
  max-width: none;
  margin: 0 0 12px;
  padding: 0 0 12px;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  border-radius: 0;
  box-shadow: none;
  animation: refPanelIn 0.18s ease;
}

@keyframes refPanelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 全屏查看 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.82);
  cursor: zoom-out;
}

.lightbox img,
.lightbox video {
  max-width: 88vw;
  max-height: 86vh;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  background: #000;
  cursor: default;
}

.lightbox-audio {
  display: grid;
  place-items: center;
  gap: 12px;
  color: #fff;
  font-size: 14px;
  cursor: default;
}

.lightbox-audio .ic {
  width: 48px;
  height: 48px;
}

/* 输入条外轮廓：极浅描边（对齐即梦），悬停再叠阴影 */
.composer {
  border: 1px solid rgba(0, 0, 0, 0.045);
  box-shadow: none;
}

.composer:hover {
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.04), 0 6px 24px rgba(0, 0, 0, 0.03);
}

.composer:focus-within {
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.04), 0 6px 24px rgba(0, 0, 0, 0.03);
}

/* 修正：聚焦不再保留阴影（上一版加描边时把 :focus-within 的阴影又带回来了） */
.composer:focus-within {
  box-shadow: none;
}

.composer:hover {
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.04), 0 6px 24px rgba(0, 0, 0, 0.03);
}

/* 输入条版式对齐即梦：工具条横跨整卡、更宽的留白、更大的行距 */
.composer {
  max-width: 980px;
  padding: 16px;
}

.composer-row {
  gap: 14px;
}

#prompt {
  font-size: 14px;
  line-height: 26px;
  min-height: 52px;
}

.toolbar {
  width: 100%;
  margin-top: 10px;
  padding: 0;
}

.prompt-col {
  gap: 2px;
}

/* 尺寸再贴一档：留白 18、行距 28、工具条上间距 12 */
.composer {
  padding: 18px;
}

#prompt {
  line-height: 28px;
  min-height: 56px;
}

.toolbar {
  margin-top: 12px;
}

.char-count {
  margin-top: 0;
}

/* 最终微调：留白 24、工具条上间距 16，让卡片高度贴近即梦的 158px */
.composer {
  padding: 24px;
}

.toolbar {
  margin-top: 16px;
}

/* 「查看全部」：平时隐藏，只有鼠标悬停参考内容区域才浮出（深色胶囊，对齐即梦） */
.ref-viewall {
  position: absolute;
  top: -26px;
  left: 0;
  z-index: 9;
  height: 28px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.refs-col:hover .ref-viewall,
.ref-viewall:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.ref-viewall:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* 查看全部再上移一点，避开缩略图右上角的删除按钮 */
.ref-viewall {
  top: -34px;
}

/* 绝对定位按钮会被父容器 56px 宽度截断，显式放开宽度 */
.ref-viewall {
  width: max-content;
  white-space: nowrap;
}

/* 堆叠第三张：展开卡（深色 + 双箭头） */
.ref-stack-expand {
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: background-color 0.15s ease;
}

.ref-stack-expand:hover {
  background: rgba(0, 0, 0, 0.9);
}

.ref-stack-expand .ic {
  width: 18px;
  height: 18px;
}

/* 尺寸与圆角对齐即梦：宽度 1012、圆角 18（像素测量：即梦卡片 1012×157、圆角约 17） */
.feed,
.composer {
  max-width: 1012px;
}

.composer {
  border-radius: 18px;
}

/* 彻底去掉输入条的浅色描边：不再有任何边框，只保留悬停阴影 */
.composer,
.composer:hover,
.composer:focus-within,
.composer:focus {
  border: 0;
  outline: none;
  box-shadow: none;
}

.composer:hover {
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.04), 0 6px 24px rgba(0, 0, 0, 0.03);
}

/* ================= 提升至 2K 确认弹窗 ================= */
.promote-panel {
  width: min(560px, 100%);
}

.promote-prompt {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7f7f8;
  color: #595959;
  font-size: 13px;
  line-height: 20px;
  word-break: break-word;
}

.promote-compare {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
}

.promote-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.promote-side span {
  color: #8c8c8c;
  font-size: 12px;
}

.promote-side b {
  font-size: 24px;
  font-weight: 600;
  line-height: 30px;
  font-variant-numeric: tabular-nums;
}

.promote-side:last-of-type {
  align-items: flex-end;
}

.promote-arrow {
  color: #b3b3b3;
  font-size: 16px;
}

.promote-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.promote-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f7f8;
}

.promote-fact span {
  color: #8c8c8c;
  font-size: 12px;
}

.promote-fact b {
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
}

.promote-fact em {
  color: #b3b3b3;
  font-size: 11px;
  font-style: normal;
}

.promote-note {
  margin: 14px 0 0;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 18px;
}

/* ================= 提升至 2K 确认弹窗（重做，贴合整体浅色风格） ================= */
.promote-panel {
  width: min(460px, 100%);
}

.promote-panel .modal-head {
  padding: 20px 22px 0;
  border-bottom: 0;
}

.promote-panel .modal-head h2 {
  font-size: 16px;
  line-height: 22px;
}

.promote-panel .modal-head p {
  margin-top: 4px;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 18px;
}

.promote-panel .modal-body {
  padding: 12px 22px 16px;
}

.promote-prompt {
  margin: 0 0 14px;
  padding: 0;
  background: none;
  border-radius: 0;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.promote-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 10px;
  margin: 0 0 6px;
  padding: 16px 18px;
  border: 1px solid #efeff0;
  border-radius: 12px;
  background: #fbfbfc;
}

.promote-side {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: none;
}

.promote-side span {
  color: #8c8c8c;
  font-size: 12px;
  line-height: 16px;
}

.promote-side b {
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.promote-side:last-of-type {
  align-items: flex-end;
  text-align: right;
}

.promote-arrow {
  align-self: center;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 2px;
  border: 1px solid #ededee;
  border-radius: 50%;
  background: #fff;
  color: #8c8c8c;
  font-size: 13px;
  line-height: 1;
}

.promote-facts {
  display: flex;
  flex-direction: column;
  margin: 6px 0 0;
}

.promote-fact {
  display: flex;
  align-items: baseline;
  padding: 12px 2px;
  border-bottom: 1px solid #f2f2f3;
}

.promote-fact:last-child {
  border-bottom: 0;
}

.promote-fact span {
  color: #8c8c8c;
  font-size: 13px;
  line-height: 18px;
}

.promote-fact b {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}

.promote-fact em {
  margin-left: 6px;
  color: #8c8c8c;
  font-size: 12px;
  font-style: normal;
  line-height: 18px;
}

.promote-note {
  margin: 12px 0 0;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 18px;
}

.promote-panel .modal-actions {
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 22px 20px;
}

.promote-panel .modal-actions .btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
}

.promote-panel #promote-cancel {
  border: 0;
  background: transparent;
  color: #595959;
}

.promote-panel #promote-cancel:hover {
  background: rgba(0, 0, 0, 0.05);
}

.promote-panel #promote-confirm {
  border: 0;
  background: #111;
  color: #fff;
}

.promote-panel #promote-confirm:hover {
  background: #2b2b2b;
}

/* 修正：信息行恢复成「标签左 / 数值右」的朴素两栏，不再用灰底卡片 */
.promote-fact {
  flex-direction: row;
  align-items: baseline;
  gap: 0;
  padding: 12px 2px;
  border-radius: 0;
  background: transparent;
}

.promote-fact em {
  margin-left: 8px;
}

.promote-prompt {
  margin-top: 10px;
}

/* 修正「更多」菜单：被通用 pill 规则改成半透明黑底，导致文字看不清 */
.more-wrap .more-menu {
  padding: 5px;
  border: 1px solid #ededee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
}

.more-wrap .more-item {
  color: #1f1f1f;
}

.more-wrap .more-item .ic {
  color: #595959;
}

.more-wrap .more-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.more-wrap .more-item.is-danger,
.more-wrap .more-item.is-danger .ic {
  color: #d4380d;
}

/* 「下载视频」是 <a>，去掉链接下划线 */
.more-wrap .more-item {
  text-decoration: none;
}

/* 返回底部悬浮按钮 */
.composer-dock {
  position: relative;
}

.scroll-bottom {
  position: absolute;
  right: 16px;
  bottom: calc(100% + 10px);
  z-index: 20;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #ededee;
  border-radius: 50%;
  background: #fff;
  color: #1f1f1f;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: background-color 0.12s ease, transform 0.12s ease;
}

.scroll-bottom:hover {
  background: #f7f7f8;
}

.scroll-bottom:active {
  transform: translateY(1px);
}

.scroll-bottom .ic {
  width: 16px;
  height: 16px;
}

.scroll-bottom[hidden] {
  display: none;
}

/* @ 面板：固定定位，贴着光标弹出 */
#at-menu {
  position: fixed;
  z-index: 80;
}

/* ================= 富文本提示词编辑器 ================= */
.prompt-editor {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  cursor: text;
  height: auto;
  min-height: 52px;
  max-height: none;
  overflow-y: hidden;
}

.prompt-editor:empty::before {
  content: attr(data-placeholder);
  color: #a3a3a8;
  pointer-events: none;
}

.prompt-editor .mention {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 240px;
  margin: 1px 2px;
  padding: 1px 7px 1px 2px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  color: #1f1f1f;
  font-size: 13px;
  line-height: 20px;
  vertical-align: baseline;
  white-space: nowrap;
  user-select: none;
}

.prompt-editor .mention:hover {
  background: rgba(0, 0, 0, 0.09);
}

.prompt-editor .mention-thumb {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
}

.prompt-editor .mention-ico {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #fff;
  color: #595959;
}

.prompt-editor .mention-ico .ic {
  width: 12px;
  height: 12px;
}

.prompt-editor .mention-label {
  font-weight: 450;
}

/* ================= 分享弹窗 ================= */
.share-modal-panel {
  width: min(520px, 100%);
}

.share-link-row {
  display: flex;
  gap: 8px;
}

#share-link {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #ededee;
  border-radius: 8px;
  background: #f7f7f8;
  color: #1f1f1f;
  font-size: 13px;
  outline: none;
}

#share-link:focus {
  border-color: #d9d9de;
  background: #fff;
}

.share-hint {
  margin: 10px 0 0;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 18px;
}

/* 分享弹窗的复制按钮用深色，和确认弹窗一致 */
.share-modal-panel #share-copy {
  border: 0;
  background: #111;
  color: #fff;
}

.share-modal-panel #share-copy:hover:not(:disabled) {
  background: #2b2b2b;
}

/* ================= 工作区侧边栏 ================= */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.new-session-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  height: 36px;
  margin: 6px 10px 2px;
  border: 1px solid #e9e9ec;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.new-session-btn:hover {
  background: #f7f7f8;
}

.new-session-btn .ic {
  width: 14px;
  height: 14px;
}

.ws-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 12px 6px 16px;
}

.ws-title {
  color: #8c8c8c;
  font-size: 12px;
}

.ws-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ws-icon.icon-btn,
.ws-icon-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #737373;
  cursor: pointer;
}

.ws-icon.icon-btn .ic,
.ws-icon-btn .ic {
  width: 15px;
  height: 15px;
}

.ws-icon.icon-btn:hover,
.ws-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1f1f1f;
}

.ws-search {
  padding: 0 12px 6px;
}

.ws-search input {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #ececee;
  border-radius: 7px;
  background: #fff;
  color: #1f1f1f;
  font-size: 12px;
  outline: none;
}

.ws-search input:focus {
  border-color: #d9d9de;
}

.ws-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 8px 12px;
}

.ws-empty {
  margin: 12px 8px;
  color: #a3a3a8;
  font-size: 12px;
  line-height: 18px;
}

.ws-project {
  position: relative;
  margin-top: 2px;
}

.ws-project-head {
  position: relative;
  display: flex;
  align-items: center;
  height: 30px;
  border-radius: 6px;
  padding-right: 2px;
}

.ws-project-head:hover {
  background: rgba(0, 0, 0, 0.045);
}

.ws-project-toggle {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 6px;
  border: none;
  background: transparent;
  color: #1f1f1f;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.ws-caret {
  width: 12px;
  height: 12px;
  color: #a3a3a8;
  transform: rotate(-90deg);
  transition: transform 0.12s ease;
  flex: none;
}

.ws-project-toggle.is-open .ws-caret {
  transform: rotate(0deg);
}

.ws-folder {
  width: 15px;
  height: 15px;
  color: #8c8c8c;
  flex: none;
}

.ws-project-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.ws-row-actions {
  display: none;
  align-items: center;
  gap: 2px;
  flex: none;
}

.ws-project-head:hover .ws-row-actions {
  display: inline-flex;
}

.ws-conversations {
  padding: 0 0 2px 24px;
}

.ws-conversation {
  position: relative;
  display: flex;
  align-items: center;
  height: 30px;
  border-radius: 6px;
}

.ws-conversation:hover {
  background: rgba(0, 0, 0, 0.045);
}

.ws-conversation.is-active {
  background: rgba(0, 0, 0, 0.06);
}

.ws-conversation-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 6px;
  border: none;
  background: transparent;
  color: #1f1f1f;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.ws-chat {
  width: 14px;
  height: 14px;
  color: #a3a3a8;
  flex: none;
}

.ws-conversation-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-conversation-time {
  flex: none;
  color: #b3b3b3;
  font-size: 11px;
}

.ws-conversation-more {
  display: none;
  margin-right: 4px;
  flex: none;
}

.ws-conversation:hover .ws-conversation-more {
  display: grid;
}

.ws-add-conversation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 6px;
  margin-top: 2px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #a3a3a8;
  font-size: 12px;
  cursor: pointer;
}

.ws-add-conversation:hover {
  background: rgba(0, 0, 0, 0.045);
  color: #1f1f1f;
}

.ws-add-conversation .ic {
  width: 12px;
  height: 12px;
}

.ws-rename {
  width: 100%;
  height: 24px;
  padding: 0 6px;
  border: 1px solid #d9d9de;
  border-radius: 5px;
  background: #fff;
  color: #1f1f1f;
  font-size: 13px;
  outline: none;
}

.ws-menu {
  position: absolute;
  top: 30px;
  right: 4px;
  z-index: 30;
  min-width: 132px;
  padding: 4px;
  border: 1px solid #ededee;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.ws-menu-item {
  display: block;
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #1f1f1f;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.ws-menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.ws-menu-item.is-danger {
  color: #d4380d;
}

.sidebar-foot {
  position: relative;
  flex: none;
  padding: 8px 10px 10px;
  border-top: 1px solid #f2f2f3;
}

.tools-pop {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 46px;
  z-index: 40;
  padding: 4px;
  border: 1px solid #ededee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.tools-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #1f1f1f;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.tools-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.tools-item .ic {
  width: 14px;
  height: 14px;
  color: #8c8c8c;
}

/* 下载按钮靠右 */
.actions-spacer {
  flex: 1 1 auto;
}

.action-download {
  text-decoration: none;
  flex: none;
}

/* 新品牌标识：蓝色渐变圆角方块 + 白色镜头标记 */
.brand-mark {
  background: linear-gradient(145deg, #2f8cff, #0a63e8);
  box-shadow: 0 3px 10px rgba(10, 99, 232, 0.28);
}

/* ================= 视频中心 ================= */
.lib-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 32px;
  margin: 4px 10px 0;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #1f1f1f;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.lib-entry:hover {
  background: rgba(0, 0, 0, 0.045);
}

.lib-entry .ic {
  width: 15px;
  height: 15px;
  color: #8c8c8c;
}

.library-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 30px 30px;
  overflow-y: auto;
}

.library-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.library-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.lib-crumb {
  padding: 2px;
  border: none;
  background: none;
  color: #8c8c8c;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.lib-crumb:hover {
  color: #1f1f1f;
}

.lib-crumb.is-current {
  color: #1f1f1f;
  font-weight: 500;
  cursor: default;
}

.lib-crumb-sep {
  color: #d0d0d2;
  font-size: 12px;
}

.library-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.library-search {
  height: 32px;
  width: 220px;
  padding: 0 10px;
  border: 1px solid #ececee;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 12px;
  outline: none;
}

.library-search:focus {
  border-color: #d9d9de;
}

.library-ratio {
  height: 32px;
  padding: 0 8px;
  border: 1px solid #ececee;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 12px;
  outline: none;
}

.library-body {
  flex: 1 1 auto;
  min-height: 0;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.lib-folder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #efeff0;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.lib-folder:hover {
  border-color: #e2e2e5;
  background: #fbfbfc;
}

.lib-folder-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #f4f4f5;
  color: #8c8c8c;
}

.lib-folder-icon .ic {
  width: 17px;
  height: 17px;
}

.lib-folder-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.lib-folder-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 500;
}

.lib-folder-meta {
  margin-top: 2px;
  color: #8c8c8c;
  font-size: 12px;
}

.lib-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.lib-video {
  position: relative;
  overflow: hidden;
  border: 1px solid #f0f0f1;
  border-radius: 12px;
  background: #fff;
}

.lib-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: none;
  background: #000;
  cursor: pointer;
}

.lib-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lib-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.lib-thumb:hover .lib-play {
  opacity: 1;
}

.lib-play .ic {
  width: 28px;
  height: 28px;
}

.lib-video-info {
  padding: 10px 12px 12px;
}

.lib-video-title {
  margin: 0 0 4px;
  color: #1f1f1f;
  font-size: 13px;
  line-height: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lib-video-meta {
  margin: 0;
  color: #8c8c8c;
  font-size: 11px;
}

.lib-video-download {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.lib-video:hover .lib-video-download {
  opacity: 1;
}

.lib-video-download .ic {
  width: 13px;
  height: 13px;
}

.lib-empty {
  margin: 24px 2px;
  color: #a3a3a8;
  font-size: 13px;
}

@media (max-width: 720px) {
  .library-view {
    padding: 16px;
  }

  .library-search {
    width: 100%;
  }
}

/* 视频中心：导出本层视频按钮 */
.library-export {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e9e9ec;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.library-export:hover {
  background: #f7f7f8;
}

/* 视频中心导出按钮不能被压窄 */
.library-export {
  flex: none;
  white-space: nowrap;
}

/* 视频中心文件夹：hover 出现重命名按钮 */
.lib-folder-wrap {
  position: relative;
}

.lib-folder-wrap .lib-folder {
  width: 100%;
}

.lib-folder-edit {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  color: #595959;
  opacity: 0;
  transition: opacity 0.12s ease;
  cursor: pointer;
}

.lib-folder-wrap:hover .lib-folder-edit {
  opacity: 1;
}

.lib-folder-edit:hover {
  background: rgba(0, 0, 0, 0.09);
  color: #1f1f1f;
}

.lib-folder-edit .ic {
  width: 13px;
  height: 13px;
}

/* 视频中心排序下拉 */
.library-sort {
  height: 32px;
  padding: 0 8px;
  border: 1px solid #ececee;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 12px;
  outline: none;
}

/* 视频中心下载按钮：浅色圆角方块（对齐即梦样式） */
.lib-video .lib-video-download {
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #1f1f1f;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
}

.lib-video .lib-video-download:hover {
  background: #ffffff;
  color: #000000;
}

.lib-video .lib-video-download .ic {
  width: 15px;
  height: 15px;
}

/* ================= 删除项目确认弹窗 ================= */
.delete-modal-panel {
  width: min(440px, 100%);
}

.delete-warning {
  margin: 0 0 14px;
  color: #595959;
  font-size: 13px;
  line-height: 20px;
}

.delete-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f7f7f8;
}

.delete-code-row span {
  color: #8c8c8c;
  font-size: 12px;
}

.delete-code-row b {
  color: #1f1f1f;
  font-size: 22px;
  letter-spacing: 0.22em;
  font-variant-numeric: tabular-nums;
}

.delete-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #e6e6e8;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 16px;
  letter-spacing: 0.3em;
  text-align: center;
  outline: none;
}

.delete-input:focus {
  border-color: #cfcfd4;
}

.delete-error {
  margin: 8px 0 0;
  color: #d4380d;
  font-size: 12px;
}

.delete-confirm {
  border: 0;
  background: #d4380d;
  color: #fff;
}

.delete-confirm:hover:not(:disabled) {
  background: #b52e08;
}

.delete-confirm:disabled {
  background: #f0f0f1;
  color: #b3b3b3;
  cursor: not-allowed;
}

/* 「资产」入口：与新会话按钮同款、左右对齐 */
.lib-entry {
  justify-content: center;
  height: 36px;
  margin: 6px 10px 0;
  padding: 0 12px;
  gap: 6px;
  border: 1px solid #e9e9ec;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 13px;
  font-weight: 500;
}

.lib-entry:hover {
  background: #f7f7f8;
}

.lib-entry .ic {
  width: 14px;
  height: 14px;
  color: #1f1f1f;
}

/* 新会话与资产按钮之间留出统一间距 */
.new-session-btn {
  margin-bottom: 0;
}

/* 返回底部按钮：居中悬浮在输入条正上方（不再靠右） */
.scroll-bottom {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  bottom: calc(100% + 12px);
}

.scroll-bottom:hover {
  transform: translateX(-50%);
}

.scroll-bottom:active {
  transform: translate(-50%, 1px);
}

/* ================= 输入条内的时长滑杆 ================= */
.duration-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.duration-row-label {
  flex: none;
  width: 28px;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 20px;
}

.duration-row .duration-control {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.duration-row .duration-input {
  margin: 0;
}

.duration-row .duration-input input {
  width: 44px;
  height: 28px;
  font-size: 14px;
}

.duration-row .duration-tick {
  height: 18px;
  min-width: 20px;
  font-size: 11px;
  line-height: 18px;
}

/* 时长数值：做成轻量文字，不再用灰底输入框 */
.duration-row .duration-input {
  border: none;
  background: transparent;
  padding-left: 4px;
}

.duration-row .duration-input input {
  width: 32px;
  border: none;
  background: transparent;
  color: #1f1f1f;
  font-size: 15px;
  font-weight: 600;
  text-align: right;
  outline: none;
}

.duration-row .duration-unit {
  color: #8c8c8c;
  font-size: 12px;
}

.duration-row .duration-tick.is-active {
  background: rgba(0, 0, 0, 0.07);
}

/* 时长行刻度：加宽、单行、隐藏多余的数字输入框 */
.duration-row .duration-ticks {
  position: relative;
  height: 20px;
  margin-top: 2px;
}

.duration-row .duration-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 20px;
  white-space: nowrap;
}

.duration-row .duration-input {
  display: none;
}

/* ================= 资产多选 ================= */
.library-selection {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px 12px;
  border: 1px solid #efeff0;
  border-radius: 10px;
  background: #fbfbfc;
}

.lib-selected-count {
  color: #1f1f1f;
  font-size: 12px;
  font-weight: 500;
}

.lib-sel-btn {
  height: 28px;
  padding: 0 12px;
  border: 1px solid #e9e9ec;
  border-radius: 7px;
  background: #fff;
  color: #1f1f1f;
  font-size: 12px;
  cursor: pointer;
}

.lib-sel-btn:hover {
  background: #f4f4f5;
}

.lib-sel-btn--primary {
  border-color: #111;
  background: #111;
  color: #fff;
}

.lib-sel-btn--primary:hover {
  background: #2b2b2b;
}

.lib-sel-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.lib-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.lib-check:hover {
  background: rgba(0, 0, 0, 0.45);
}

.lib-check.is-checked {
  border-color: #111;
  background: #111;
}

.lib-check .ic {
  width: 13px;
  height: 13px;
}

.lib-video.is-selected {
  border-color: #111;
  box-shadow: 0 0 0 1px #111;
}

/* ================= 工作区搜索框（图2样式） ================= */
.ws-search {
  padding: 0 10px 8px;
}

.ws-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e6e6e8;
  border-radius: 10px;
  background: #fff;
}

.ws-search-box:focus-within {
  border-color: #d4d4d8;
}

.ws-search-icon {
  flex: none;
  width: 15px;
  height: 15px;
  color: #a3a3a8;
}

.ws-search-box input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #1f1f1f;
  font-size: 13px;
}

.ws-search-box input::placeholder {
  color: #a3a3a8;
}

/* 去掉浏览器自带的搜索清除图标 */
.ws-search-box input::-webkit-search-cancel-button,
.ws-search-box input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.ws-search-clear {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #8c8c8c;
  cursor: pointer;
}

.ws-search-clear:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1f1f1f;
}

.ws-search-clear .ic {
  width: 12px;
  height: 12px;
}

/* 时长滑杆与画幅同一行 */
.duration-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  padding-left: 12px;
  border-left: 1px solid #efeff0;
}

.duration-inline .duration-row-label {
  flex: none;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 20px;
}

.duration-inline .duration-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.duration-inline .duration-slider {
  flex: none;
  width: 170px;
  padding: 7px 0;
}

.duration-inline .duration-ticks {
  display: none;
}

.duration-inline .duration-input {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.duration-inline .duration-input input {
  width: 30px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: #1f1f1f;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  outline: none;
  appearance: textfield;
}

.duration-inline .duration-input input::-webkit-outer-spin-button,
.duration-inline .duration-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.duration-inline .duration-unit {
  color: #8c8c8c;
  font-size: 12px;
}

/* 时长滑杆样式：对齐参考图（浅灰轨道 + 深灰已完成段 + 白色小圆点 + 细刻度） */
.duration-inline .ds-track {
  height: 8px;
  border-radius: 999px;
  background: #f1f2f4;
}

.duration-inline .ds-fill {
  border-radius: 999px;
  background: #d2d2d4;
}

.duration-inline .ds-thumb {
  width: 14px;
  height: 14px;
  border: 1px solid #d9d9dc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

.duration-inline .ds-tick {
  width: 2px;
  height: 7px;
  background: #e4e4e7;
}

/* 对话框区域整体放大 10%：宽度 1012 → 1113，内边距 24 → 26，输入行距与最小高度同步 */
.feed,
.composer {
  max-width: 1113px;
}

.composer {
  padding: 26px;
}

#prompt {
  font-size: 15px;
  line-height: 30px;
  min-height: 58px;
}

.duration-inline .duration-slider {
  width: 187px;
}

/* 画幅/时长这一行整体下移：缩小底部留白 */
.composer {
  padding: 26px 26px 14px;
}

/* Logo 与新会话按钮左侧对齐（并让右侧收起按钮与按钮右边缘对齐） */
.sidebar-head {
  padding-left: 10px;
  padding-right: 10px;
}

/* Logo：黑白描边，无底色，居中；收起按钮与下方按钮右对齐 */
.sidebar-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 46px;
  padding: 4px 22px 6px;
}

.sidebar-head .brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #1f1f1f;
}

.brand-mark .ic {
  width: 24px;
  height: 24px;
}

.brand-name {
  display: none;
}

.share-brand .share-logo {
  width: 26px;
  height: 26px;
  color: #ffffff;
}

/* 收起按钮与下方按钮右边缘对齐（218） */
.sidebar-head {
  padding: 4px 10px 6px;
}

/* ================= 收起侧边栏：变成窄图标栏 ================= */
.app.is-sidebar-collapsed .sidebar {
  width: 68px;
  padding: 10px 8px 12px;
}

.app.is-sidebar-collapsed .sidebar-head {
  flex-direction: column;
  gap: 10px;
  height: auto;
  padding: 2px 0 12px;
}

.app.is-sidebar-collapsed .sidebar-head .brand {
  position: static;
  transform: none;
}

.app.is-sidebar-collapsed .new-session-btn,
.app.is-sidebar-collapsed .lib-entry {
  width: 44px;
  height: 36px;
  margin: 0 auto;
  padding: 0;
  justify-content: center;
}

.app.is-sidebar-collapsed .new-session-btn span,
.app.is-sidebar-collapsed .lib-entry span {
  display: none;
}

.app.is-sidebar-collapsed .ws-head,
.app.is-sidebar-collapsed .ws-search,
.app.is-sidebar-collapsed .ws-list,
.app.is-sidebar-collapsed .sidebar-foot {
  display: none;
}

/* ================= 资产库日期筛选 ================= */
.library-filter-wrap {
  position: relative;
  flex: none;
}

.library-filter {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #ececee;
  border-radius: 8px;
  background: #fff;
  color: #595959;
  cursor: pointer;
}

.library-filter:hover {
  background: #f7f7f8;
}

.library-filter .ic {
  width: 15px;
  height: 15px;
}

.library-filter-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 300px;
  padding: 14px;
  border: 1px solid #ededee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.lib-date-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.lib-date-field {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f5f5f6;
}

.lib-date-field input {
  width: 100%;
  border: none;
  background: transparent;
  color: #1f1f1f;
  font-size: 12px;
  outline: none;
}

.lib-date-field input::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

.lib-date-sep {
  color: #b3b3b3;
  font-size: 12px;
}

.lib-preset-list {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}

.lib-preset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  padding: 0 6px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #1f1f1f;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.lib-preset:hover {
  background: rgba(0, 0, 0, 0.05);
}

.lib-preset.is-active {
  font-weight: 500;
}

.lib-preset-check {
  width: 15px;
  height: 15px;
  color: #1f1f1f;
}

/* ================= 资产库自定义日历 ================= */
.lib-date-field {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: #f5f5f6;
  color: #a3a3a8;
  font-size: 12px;
  cursor: pointer;
}

.lib-date-field .lib-date-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.lib-date-field.is-filled {
  color: #1f1f1f;
}

.lib-date-field.is-active {
  background: #ededee;
}

.lib-date-field .ic {
  flex: none;
  width: 14px;
  height: 14px;
  color: #8c8c8c;
}

.lib-calendar {
  margin: 8px 0 6px;
  padding: 12px 10px;
  border: 1px solid #efeff0;
  border-radius: 12px;
  background: #fff;
}

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

.lib-cal-nav {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #8c8c8c;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.lib-cal-nav:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1f1f1f;
}

.lib-cal-title {
  flex: 1 1 auto;
  text-align: center;
  color: #1f1f1f;
  font-size: 13px;
  font-weight: 600;
}

.lib-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

.lib-cal-week span {
  text-align: center;
  color: #a3a3a8;
  font-size: 11px;
}

.lib-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.lib-cal-day {
  position: relative;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #1f1f1f;
  font-size: 12px;
  cursor: pointer;
}

.lib-cal-day:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
}

.lib-cal-day.is-out {
  color: #cfcfd2;
}

.lib-cal-day.is-disabled {
  color: #dcdcdf;
  cursor: default;
}

.lib-cal-day.is-selected {
  background: #111;
  color: #fff;
}

.lib-cal-day.is-today::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: #008ee5;
}

.lib-cal-day.is-selected.is-today::after {
  background: #7cc4ff;
}

/* ================= 资产库自定义下拉（参考图样式） ================= */
.lib-select {
  position: relative;
  flex: none;
}

.library-tools .lib-select {
  min-width: 104px;
}

.lib-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #e6e6e8;
  border-radius: 17px;
  background: #fff;
  color: #1f1f1f;
  font-size: 13px;
  cursor: pointer;
}

.lib-select-btn:hover {
  background: #fbfbfc;
}

.lib-select-caret {
  width: 12px;
  height: 12px;
  color: #595959;
  transition: transform 0.12s ease;
}

.lib-select-btn[aria-expanded="true"] .lib-select-caret {
  transform: rotate(180deg);
}

.lib-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 45;
  min-width: 100%;
  padding: 4px;
  border: 1px solid #ededee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

.lib-select-option {
  display: block;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #1f1f1f;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.lib-select-option:hover {
  background: rgba(0, 0, 0, 0.05);
}

.lib-select-option.is-selected {
  background: #1677ff;
  color: #fff;
}

/* 资产库文件夹改名：输入框不重叠、隐藏铅笔按钮 */
.lib-folder-wrap.is-renaming .lib-folder-edit {
  display: none;
}

.lib-rename {
  width: calc(100% - 4px);
  height: 26px;
  padding: 0 8px;
  border: 1px solid #d9d9de;
  border-radius: 6px;
  background: #fff;
  color: #1f1f1f;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 142, 229, 0.1);
}

/* 侧栏底部：积分 + 连接状态 */
.side-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 8px;
}

.side-meta .usage-pill {
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.04);
  font-size: 12px;
}

.side-meta .usage-pill:hover {
  background: rgba(0, 0, 0, 0.07);
}

.side-meta .conn {
  height: 24px;
  padding: 0 8px;
  border: none;
  background: rgba(31, 196, 125, 0.1);
  color: #0f8a52;
  font-size: 11px;
}

.side-meta .conn[data-state="ok"] {
  background: rgba(31, 196, 125, 0.12);
  color: #0f8a52;
}

.side-meta .conn[data-state="warn"] {
  background: rgba(250, 173, 20, 0.14);
  color: #ad6800;
}

.side-meta .conn[data-state="down"] {
  background: rgba(212, 56, 13, 0.1);
  color: #c0390a;
}

/* 工具弹层贴合底部 */
.tools-pop {
  bottom: calc(100% - 4px);
}

/* 资产库工具条：搜索框图标 + 下拉与筛选按钮统一 8px 圆角 */
.library-search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  width: 220px;
  padding: 0 10px;
  border: 1px solid #ececee;
  border-radius: 8px;
  background: #fff;
}

.library-search-wrap:focus-within {
  border-color: #d4d4d8;
}

.library-search-icon {
  flex: none;
  width: 14px;
  height: 14px;
  color: #a3a3a8;
}

.library-search {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  width: auto;
  padding: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
}

.library-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.library-tools .lib-select {
  min-width: 0;
}

.library-tools .lib-select-btn {
  height: 32px;
  padding: 0 10px;
  gap: 6px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.library-tools .lib-select-caret {
  width: 11px;
  height: 11px;
}

/* 移除 logo 后的侧栏头部：只保留收起按钮并右对齐 */
.sidebar-head {
  justify-content: flex-end;
  height: 38px;
  padding: 4px 10px 2px;
}

.app.is-sidebar-collapsed .sidebar-head {
  align-items: center;
  height: auto;
  padding: 6px 0 12px;
}

/* ================= 资产库：上移、卡片更大、一行 5 个 ================= */
.app[data-view="library"] .main-head {
  display: none;
}

.library-view {
  padding: 14px 26px 26px;
}

.library-head {
  margin-bottom: 16px;
}

.lib-grid,
.lib-video-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.lib-folder {
  gap: 14px;
  padding: 18px 16px;
  border-radius: 14px;
}

.lib-folder-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
}

.lib-folder-icon .ic {
  width: 21px;
  height: 21px;
}

.lib-folder-name {
  font-size: 15px;
}

.lib-folder-meta {
  margin-top: 3px;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .lib-grid,
  .lib-video-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .lib-grid,
  .lib-video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .lib-grid,
  .lib-video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-view {
    padding: 12px;
  }
}

/* ================= 对话页悬浮标题 ================= */
.main {
  position: relative;
}

.app[data-view="create"] .main-head {
  display: none;
}

.conv-label {
  position: absolute;
  top: 10px;
  left: 24px;
  z-index: 15;
  max-width: 70%;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  color: #595959;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.app[data-view="create"] .feed-wrap {
  padding-top: 36px;
}

@media (max-width: 720px) {
  .app[data-view="create"] .main-head {
    display: flex;
    height: 48px;
    padding: 0 12px;
  }

  .conv-label {
    top: 6px;
    left: 52px;
    font-size: 11px;
  }

  .app[data-view="create"] .feed-wrap {
    padding-top: 26px;
  }
}

/* 悬浮标题不要阴影 */
.conv-label {
  box-shadow: none;
}

/* 去掉收起按钮后，侧栏顶部与新会话按钮的间距 */
.sidebar {
  padding-top: 12px;
}

/* @ 引用胶囊统一高度与基线，避免图片/音频胶囊参差不齐 */
.prompt-editor .mention {
  height: 22px;
  padding: 0 7px 0 2px;
  line-height: 20px;
  vertical-align: middle;
  box-sizing: border-box;
}

.prompt-editor .mention-thumb,
.prompt-editor .mention-ico {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.prompt-editor .mention-ico .ic {
  width: 11px;
  height: 11px;
}

.prompt-editor .mention-label {
  line-height: 20px;
}

/* 生成结果不再铺满整行：参考即梦的聊天内尺寸 */
.gen-result {
  width: fit-content;
  max-width: 100%;
  margin-top: 12px;
}

.gen-result .gen-video {
  width: auto;
  max-width: min(560px, 100%);
  max-height: min(52vh, 460px);
  margin: 0 auto;
}

.gen-progress {
  max-width: 560px;
}

/* 结果容器固定为聊天内宽度，视频居中（与即梦一致） */
.gen-result {
  width: 560px;
  max-width: 100%;
}

/* ================= 删除项目弹层（简化 + 居中） ================= */
.delete-modal-panel {
  width: min(440px, 100%);
}

.delete-warning {
  margin: 0 0 18px;
  color: #595959;
  font-size: 13px;
  line-height: 20px;
}

.delete-hint {
  margin: 0 0 6px;
  color: #8c8c8c;
  font-size: 12px;
  text-align: center;
}

.delete-code {
  margin: 0 0 16px;
  color: #1f1f1f;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.32em;
  line-height: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  text-indent: 0.32em;
}

.delete-input {
  height: 40px;
  border: 1px solid #e6e6e8;
  border-radius: 8px;
  font-size: 15px;
  letter-spacing: 0.2em;
  text-align: center;
}

/* 弹层按钮统一：居中、同宽、同高 */
.delete-modal-panel .modal-actions,
.modal-actions {
  justify-content: center;
  gap: 12px;
  padding-top: 20px;
}

.delete-modal-panel .modal-actions .btn {
  min-width: 120px;
  height: 38px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 13px;
}

.delete-confirm {
  border: 0;
  background: #d4380d;
  color: #fff;
}

.delete-confirm:hover:not(:disabled) {
  background: #b52e08;
}

.delete-confirm:disabled {
  background: #f2f2f3;
  color: #b3b3b3;
  cursor: not-allowed;
}

/* 取消按钮也做成描边按钮，与红色删除按钮统一 */
.delete-modal-panel #delete-cancel {
  border: 1px solid #e6e6e8;
  background: #fff;
  color: #1f1f1f;
}

.delete-modal-panel #delete-cancel:hover {
  background: #f7f7f8;
}

/* ================= 对话内提示词：灰底内联展示 ================= */
.gen-prompt {
  margin: 2px 0 6px;
  padding: 10px 12px 8px;
  border-radius: 10px;
  background: #f7f7f8;
}

.gen-prompt-text {
  display: block;
  color: #333333;
  font-size: 13px;
  line-height: 22px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 320px;
  overflow-y: auto;
}

.gen-prompt-text::-webkit-scrollbar {
  width: 4px;
}

.gen-prompt-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.gen-use-prompt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #8c8c8c;
  font-size: 12px;
  cursor: pointer;
}

.gen-use-prompt:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1f1f1f;
}

.gen-use-prompt .ic {
  width: 12px;
  height: 12px;
}

/* ================= 删除项目弹层（重新排版） ================= */
.delete-modal-panel {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
}

.delete-modal-panel .modal-head {
  padding: 20px 22px 14px;
}

.delete-modal-panel .modal-body {
  padding: 18px 22px 10px;
}

.delete-warning {
  margin: 2px 0 20px;
  color: #4d4d4d;
  font-size: 13px;
  line-height: 21px;
}

.delete-hint {
  margin: 0 0 8px;
  color: #8c8c8c;
  font-size: 12px;
  text-align: center;
}

.delete-code {
  margin: 0 0 18px;
  color: #1f1f1f;
  font-size: 36px;
  font-weight: 700;
  line-height: 48px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.delete-input {
  width: 100%;
  height: 44px;
  border: 1px solid #e6e6e8;
  border-radius: 9px;
  background: #fff;
  color: #1f1f1f;
  font-size: 15px;
  letter-spacing: 0.24em;
  text-align: center;
  outline: none;
}

.delete-input:focus {
  border-color: #cfcfd4;
}

.delete-error {
  margin: 10px 0 0;
  color: #d4380d;
  font-size: 12px;
  text-align: center;
}

.delete-modal-panel .modal-actions {
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
  padding: 16px 22px 20px;
  border-top: 1px solid #f4f4f5;
}

.delete-modal-panel .modal-actions .btn {
  min-width: 132px;
  height: 40px;
  padding: 0 20px;
  border-radius: 9px;
  font-size: 13px;
}

.delete-modal-panel #delete-cancel {
  border: 1px solid #e6e6e8;
  background: #fff;
  color: #1f1f1f;
}

.delete-modal-panel #delete-cancel:hover {
  background: #f7f7f8;
}

.delete-modal-panel #delete-confirm {
  border: 0;
  background: #d4380d;
  color: #fff;
}

.delete-modal-panel #delete-confirm:hover:not(:disabled) {
  background: #b52e08;
}

.delete-modal-panel #delete-confirm:disabled {
  background: #f2f2f3;
  color: #b3b3b3;
  cursor: not-allowed;
}

/* ================= 删除项目弹层（第二轮调整） ================= */
.delete-modal-panel .modal-head {
  justify-content: center;
  text-align: center;
  padding: 22px 22px 16px;
}

.delete-modal-panel .modal-head h2 {
  font-size: 17px;
}

.delete-modal-panel .modal-body {
  padding: 0 22px 8px;
  text-align: center;
}

.delete-warning {
  margin: 0 0 8px;
  color: #d4380d;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}

.delete-confirm-line {
  margin: 0 0 16px;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.delete-code {
  margin: 0 auto 18px;
  color: #1f1f1f;
  font-size: 38px;
  font-weight: 700;
  line-height: 50px;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.delete-input {
  height: 48px;
  font-size: 20px;
  letter-spacing: 0.24em;
  text-align: center;
}

.delete-error {
  margin: 10px 0 0;
  text-align: center;
}

.delete-modal-panel .modal-actions {
  justify-content: center;
  gap: 12px;
  margin-top: 0;
  padding: 16px 22px 20px;
  border-top: 1px solid #f4f4f5;
}

.delete-modal-panel .modal-actions .btn {
  min-width: 132px;
  height: 40px;
  border-radius: 9px;
  font-size: 13px;
}

.delete-modal-panel #delete-confirm {
  border: 0;
  background: #d4380d;
  color: #fff;
}

.delete-modal-panel #delete-confirm:hover:not(:disabled) {
  background: #b52e08;
}

.delete-modal-panel #delete-confirm:disabled {
  background: #f2f2f3;
  color: #b3b3b3;
  cursor: not-allowed;
}

.delete-modal-panel #delete-cancel {
  border: 1px solid #e6e6e8;
  background: #fff;
  color: #1f1f1f;
}

.delete-modal-panel #delete-cancel:hover {
  background: #f7f7f8;
}

/* 验证码输入框字号（提高优先级，避免被通用 input 规则覆盖） */
.delete-modal-panel .delete-input {
  height: 48px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-align: center;
}

.delete-modal-panel .delete-input::placeholder {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #a3a3a8;
}

/* ================= 删除项目弹层（排版定稿） ================= */
.delete-modal-panel {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
}

.delete-modal-panel .modal-head {
  justify-content: center;
  padding: 26px 24px 6px;
  border-bottom: 0;
}

.delete-modal-panel .modal-head h2 {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.delete-modal-panel .modal-body {
  padding: 14px 24px 4px;
  text-align: center;
}

.delete-warning {
  margin: 0 0 10px;
  color: #d4380d;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}

.delete-confirm-line {
  margin: 0 0 22px;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.delete-code {
  margin: 0 auto 22px;
  color: #1f1f1f;
  font-size: 36px;
  font-weight: 700;
  line-height: 48px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.delete-modal-panel .delete-input {
  height: 46px;
  border: 1px solid #e6e6e8;
  border-radius: 10px;
  font-size: 19px;
  letter-spacing: 0.22em;
  text-align: center;
}

.delete-modal-panel .delete-input::placeholder {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #a3a3a8;
}

.delete-error {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.delete-modal-panel .modal-actions {
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 20px 24px 24px;
  border-top: 1px solid #f4f4f5;
}

.delete-modal-panel .modal-actions .btn {
  min-width: 132px;
  height: 40px;
  padding: 0 20px;
  border-radius: 9px;
  font-size: 13px;
}

.delete-modal-panel #delete-confirm {
  border: 0;
  background: #d4380d;
  color: #fff;
}

.delete-modal-panel #delete-confirm:hover:not(:disabled) {
  background: #b52e08;
}

.delete-modal-panel #delete-confirm:disabled {
  background: #f2f2f3;
  color: #b3b3b3;
  cursor: not-allowed;
}

.delete-modal-panel #delete-cancel {
  border: 1px solid #e6e6e8;
  background: #fff;
  color: #1f1f1f;
}

.delete-modal-panel #delete-cancel:hover {
  background: #f7f7f8;
}

/* ================= 删除项目弹层（收尾） ================= */
.delete-modal-panel .modal-actions {
  border-top: 0;
  padding: 16px 24px 24px;
}

/* 合并后的一句话：前半红色、后半灰色，仍在同一段里 */
.delete-warning {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 21px;
  text-align: center;
}

.delete-warning-danger {
  color: #d4380d;
}

.delete-warning-muted {
  color: #8c8c8c;
}

/* 错误提示预留固定高度，输入时弹窗不会变大 */
.delete-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: #d4380d;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  visibility: hidden;
}

.delete-error.is-visible {
  visibility: visible;
}

/* ================= 资产库：全选移到顶栏 ================= */
.library-head {
  justify-content: flex-start;
}

.library-tools {
  margin-left: auto;
}

.library-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 22px;
}

.lib-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #595959;
  font-size: 12px;
  cursor: pointer;
}

.lib-select-all:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1f1f1f;
}

.lib-checkbox {
  position: relative;
  width: 16px;
  height: 16px;
  border: 1.5px solid #c9c9cf;
  border-radius: 4px;
  background: #fff;
}

.lib-select-all.is-checked .lib-checkbox {
  border-color: #111;
  background: #111;
}

.lib-select-all.is-checked .lib-checkbox::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(42deg);
}

.lib-sel-download {
  height: 28px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: #111;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.lib-sel-download:hover {
  background: #2b2b2b;
}

.lib-sel-clear {
  height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #8c8c8c;
  font-size: 12px;
  cursor: pointer;
}

.lib-sel-clear:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1f1f1f;
}

/* ================= 资产库视频卡片：重新编辑 ================= */
.lib-media {
  position: relative;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.lib-video-reedit {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 7px;
  background: rgba(17, 17, 17, 0.72);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.92;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.lib-video-reedit:hover {
  background: rgba(17, 17, 17, 0.9);
  opacity: 1;
}

.lib-video-reedit .ic {
  width: 13px;
  height: 13px;
}

/* ================= 对话内提示词：对齐即梦（默认平铺 / 悬停浮起卡片） ================= */
.gen-head {
  position: relative;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.gen-head:hover {
  background: #fff;
  border-color: #ededee;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
}

.gen-prompt {
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.gen-prompt-text {
  display: block;
  max-height: none;
  overflow: visible;
  color: #1f1f1f;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gen-prompt-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.gen-use-prompt {
  height: 22px;
  color: #8c8c8c;
  font-size: 12px;
}

.gen-use-prompt:hover {
  background: transparent;
  color: #1f1f1f;
}

.gen-meta-row {
  margin-top: 4px;
}

/* ================= 左上角生成任务队列 ================= */
.gen-queue {
  position: absolute;
  top: 42px;
  left: 24px;
  z-index: 14;
  width: 208px;
  border: 1px solid #ededee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.gen-queue-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: none;
  background: transparent;
  color: #595959;
  font-size: 12px;
  cursor: pointer;
}

.gen-queue-head:hover {
  background: #fafafb;
}

.gen-queue-icon {
  width: 13px;
  height: 13px;
  color: #8c8c8c;
}

.gen-queue-title {
  flex: 1 1 auto;
  text-align: left;
  font-weight: 500;
}

.gen-queue-chevron {
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.gen-queue-chevron .ic {
  width: 12px;
  height: 12px;
  color: #a3a3a8;
}

.gen-queue-head[aria-expanded="false"] .gen-queue-chevron {
  transform: rotate(-90deg);
}

.gen-queue-list {
  display: flex;
  flex-direction: column;
  max-height: 340px;
  overflow-y: auto;
  padding: 2px 0 6px;
}

.gen-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.gen-queue-item:hover {
  background: #f7f7f8;
}

.gq-name {
  color: #1f1f1f;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.gq-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #8c8c8c;
  white-space: nowrap;
}

.gq-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.gq-state--queued {
  color: #a3a3a8;
}

.gq-state--running {
  color: #d48806;
}

.gq-state--running .gq-dot {
  animation: gq-blink 1s ease-in-out infinite;
}

.gq-state--done {
  color: #1aab63;
}

.gq-state--failed {
  color: #d4380d;
}

@keyframes gq-blink {
  0%,
  100% {
    opacity: 0.25;
  }

  50% {
    opacity: 1;
  }
}

.app[data-view="library"] .gen-queue {
  display: none;
}

@media (max-width: 1679px) {
  .gen-queue {
    display: none;
  }
}

/* 提示词恢复为始终平铺（对齐即梦图 1），不再有悬停卡片 */
.gen-head,
.gen-head:hover {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.gen-prompt {
  margin: 2px 0 6px;
  padding: 0;
  background: transparent;
}

.gen-prompt-foot {
  margin-top: 0;
}

/* 提示词：默认 2 行，悬停向下延展全文（对齐即梦） */
.gen-prompt-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gen-prompt:hover .gen-prompt-text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* 生成队列：无外框/阴影，每条单独成块（对齐图 2 的胶囊样式） */
.gen-queue {
  width: 196px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.gen-queue-head {
  height: 30px;
  padding: 0 4px;
  background: transparent !important;
  color: #8c8c8c;
}

.gen-queue-head:hover {
  color: #1f1f1f;
}

.gen-queue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  padding: 2px 0 4px 0;
}

.gen-queue-item {
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  background: #f4f4f5;
}

.gen-queue-item:hover {
  background: #ececee;
}

.gq-name {
  font-size: 12.5px;
}

/* 提示词块：使用提示词贴在最后一行右侧，不再单独占一行 */
.gen-prompt {
  position: relative;
  padding-right: 104px;
}

.gen-prompt-foot {
  position: absolute;
  right: 0;
  bottom: 0;
  margin: 0;
  display: block;
}

.gen-use-prompt {
  height: 20px;
  padding: 0 4px;
  color: #a3a3a8;
}

.gen-use-prompt:hover {
  background: transparent;
  color: #1f1f1f;
}

/* 默认 2 行截断、悬停展开时，使用提示词始终贴住最后一行底部 */
.gen-prompt-text {
  padding-right: 0;
}

/* 提示词块：去掉预留右侧空间，「使用提示词」只在悬停时出现在右下角 */
.gen-prompt {
  position: relative;
  padding-right: 0;
}

.gen-prompt-foot {
  position: absolute;
  right: 0;
  bottom: 0;
  margin: 0;
  display: block;
  padding-left: 10px;
  background: #fff;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.gen-prompt:hover .gen-prompt-foot,
.gen-prompt-foot:focus-within {
  opacity: 1;
}

.gen-use-prompt {
  height: 20px;
  padding: 0 2px;
  color: #8c8c8c;
}

.gen-use-prompt:hover {
  background: transparent;
  color: #1f1f1f;
}

/* 成片统一高度：16:9 与 9:16 同高（16:9 满宽 560 → 315 高） */
.gen-result .gen-video {
  width: auto;
  height: 315px;
  max-width: 100%;
  max-height: none;
  margin: 0 auto;
  object-fit: contain;
}

@media (max-width: 720px) {
  .gen-result .gen-video {
    height: 220px;
  }
}

/* 生成任务列表移到右侧置顶 */
.gen-queue {
  left: auto;
  right: 24px;
  top: 42px;
}

/* 生成任务列表与左上角项目/集数标签齐平 */
.gen-queue {
  top: 8px;
}

/* 视频元素统一黑底：全屏/比例不足时两侧不再是白边 */
.gen-result .gen-video,
.gen-video {
  background: #000;
}

.gen-result .gen-video::-webkit-media-controls-enclosure {
  background-color: transparent;
}

/* 全屏播放：letterbox 一律黑色（含 Chrome ::backdrop） */
.gen-video:fullscreen,
.lightbox video:fullscreen {
  background: #000 !important;
  object-fit: contain;
}

.gen-video::backdrop,
.lightbox video::backdrop {
  background: #000;
}

video::backdrop {
  background: #000;
}

/* 生成中占位与成片同高，避免生成完成时高度跳变 */
.gen-result .gen-progress {
  width: 100%;
  height: 315px;
  max-height: none;
  aspect-ratio: auto;
}

@media (max-width: 720px) {
  .gen-result .gen-progress {
    height: 220px;
  }
}

/* 输入条：无文字开关 */
.no-text-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #a3a3a8;
  font-size: 12px;
  cursor: pointer;
}

.no-text-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #595959;
}

.no-text-toggle.is-on {
  background: rgba(0, 0, 0, 0.05);
  color: #1f1f1f;
}

.nt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9c9cf;
}

.no-text-toggle.is-on .nt-dot {
  background: #111;
}

/* ================= 分享视频弹层（重排） ================= */
.share-modal-panel {
  width: min(500px, 100%);
  overflow: hidden;
}

.share-modal-panel .modal-head {
  padding: 20px 22px 12px;
}

.share-modal-panel .modal-head h2 {
  font-size: 16px;
}

.share-modal-panel .modal-head p {
  margin-top: 4px;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 18px;
}

.share-body {
  padding: 6px 22px 22px;
}

.share-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#share-link {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #ececee;
  border-radius: 9px;
  background: #f7f7f8;
  color: #1f1f1f;
  font-size: 13px;
  outline: none;
}

#share-link:focus {
  border-color: #d9d9de;
  background: #fff;
}

.share-copy-btn {
  flex: none;
  height: 42px;
  padding: 0 18px;
  border-radius: 9px;
  font-size: 13px;
  white-space: nowrap;
}

.share-hint {
  margin: 12px 0 0;
  color: #a3a3a8;
  font-size: 12px;
  line-height: 18px;
}

/* 项目/集数下方：本集累计消耗 */
.conv-cost {
  position: absolute;
  top: 34px;
  left: 26px;
  z-index: 14;
  color: #a3a3a8;
  font-size: 11.5px;
  line-height: 16px;
  pointer-events: none;
}

.app[data-view="library"] .conv-cost {
  display: none;
}

/* 消耗积分：与标题同款半透明底，保证在视频上也清晰 */
.conv-cost {
  top: 36px;
  left: 24px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: #8c8c8c;
  font-size: 11.5px;
  line-height: 16px;
}

/* 提升至 2K：标题居中、按钮居中、取消在右 */
.promote-panel .modal-head {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 22px 24px 10px;
  text-align: center;
}

.promote-panel .modal-head > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.promote-panel .modal-head h2 {
  font-size: 16px;
}

.promote-panel .modal-head p {
  color: #8c8c8c;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.promote-panel .modal-actions {
  justify-content: center;
  gap: 12px;
  padding: 16px 24px 22px;
}

.promote-panel .modal-actions .btn {
  min-width: 128px;
  height: 38px;
  border-radius: 9px;
  font-size: 13px;
}

/* 项目/集数标题大一号，消耗标签分项目与本集 */
.conv-label {
  font-size: 13px;
}

.conv-cost {
  max-width: 320px;
  white-space: nowrap;
}

/* ================= 积分罗盘 ================= */
.usage-pop {
  width: 380px;
  max-height: min(72vh, 640px);
  overflow-y: auto;
  padding: 16px 18px;
}

.usage-head {
  padding-bottom: 10px;
}

.usage-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0 12px;
}

.usage-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #f7f7f8;
}

.usage-metric-label {
  color: #8c8c8c;
  font-size: 11px;
}

.usage-metric-value {
  color: #1f1f1f;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.usage-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f2f2f3;
}

.usage-section-title {
  margin: 0 0 8px;
  color: #8c8c8c;
  font-size: 11px;
}

.usage-project {
  margin-bottom: 10px;
}

.usage-project-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  color: #1f1f1f;
  font-size: 13px;
}

.usage-project-name {
  font-weight: 500;
}

.usage-episode-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0 3px 14px;
  color: #8c8c8c;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* 消耗分两行显示 */
.conv-cost {
  white-space: pre-line;
  line-height: 16px;
  padding: 3px 8px;
}

/* ================= 顶部项目信息卡片 ================= */
.conv-card {
  position: absolute;
  top: 10px;
  left: 24px;
  z-index: 15;
  min-width: 196px;
  padding: 8px 12px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.conv-label {
  position: static;
  max-width: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #1f1f1f;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-cost {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 11.5px;
  line-height: 15px;
  white-space: normal;
}

.conv-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  color: #a3a3a8;
  font-size: 11.5px;
}

.conv-stat b {
  color: #595959;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.app[data-view="library"] .conv-card {
  display: none;
}

.app[data-view="library"] .conv-label {
  display: none;
}

/* ================= 项目素材库 ================= */
.project-assets {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #efeff0;
  border-radius: 12px;
  background: #fbfbfc;
}

.project-assets-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.project-assets-title {
  color: #1f1f1f;
  font-size: 13px;
  font-weight: 600;
}

.project-assets-count {
  color: #a3a3a8;
  font-size: 11.5px;
}

.project-assets-upload {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid #e6e6e8;
  border-radius: 7px;
  background: #fff;
  color: #1f1f1f;
  font-size: 12px;
  cursor: pointer;
}

.project-assets-upload:hover {
  background: #f4f4f5;
}

.project-assets-upload .ic {
  width: 13px;
  height: 13px;
}

.project-assets-empty {
  margin: 0;
  color: #a3a3a8;
  font-size: 12px;
  line-height: 18px;
}

.pa-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pa-card {
  position: relative;
  width: 108px;
}

.pa-thumb {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  padding: 0;
  border: 1px solid #ececee;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
}

.pa-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pa-thumb-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #8c8c8c;
  font-size: 11px;
}

.pa-thumb-audio .ic {
  width: 22px;
  height: 22px;
}

.pa-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 5px;
}

.pa-name {
  color: #1f1f1f;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
}

.pa-kind {
  color: #a3a3a8;
  font-size: 11px;
}

.pa-rename {
  width: 100%;
  height: 22px;
  padding: 0 5px;
  border: 1px solid #d9d9de;
  border-radius: 5px;
  font-size: 12px;
  outline: none;
}

.pa-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.pa-card:hover .pa-remove {
  opacity: 1;
}

.pa-remove .ic {
  width: 11px;
  height: 11px;
}

/* 自动匹配提示 */
.auto-match-hint {
  margin: 0 0 8px;
  color: #8c8c8c;
  font-size: 11.5px;
  line-height: 16px;
}

/* 素材库视图 */
.library-assets-view {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.library-assets-view .project-assets-head {
  margin-bottom: 12px;
}

.library-assets-view .pa-grid {
  gap: 14px;
}

/* 提升至 2K：确认不要黑底，取消做黑底主按钮（防误点） */
.promote-panel #promote-confirm {
  border: 1px solid #e6e6e8;
  background: #fff;
  color: #1f1f1f;
}

.promote-panel #promote-confirm:hover {
  background: #f7f7f8;
}

.promote-panel #promote-cancel {
  border: 0;
  background: #111;
  color: #fff;
}

.promote-panel #promote-cancel:hover {
  background: #2b2b2b;
}

/* 资产库项目页：素材 / 视频 分组 */
.lib-group + .lib-group {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f2f2f3;
}

.lib-group-title {
  margin: 0 0 10px;
  color: #a3a3a8;
  font-size: 12px;
  line-height: 16px;
}

/* 素材卡片：替换按钮 */
.pa-replace {
  position: absolute;
  top: 6px;
  right: 32px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.pa-card:hover .pa-replace {
  opacity: 1;
}

.pa-replace .ic {
  width: 11px;
  height: 11px;
}

/* 素材批量选择 */
.pa-card.is-selected .pa-thumb {
  border-color: #111;
  box-shadow: 0 0 0 1px #111;
}

.pa-check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
}

.pa-check.is-checked {
  border-color: #111;
  background: #111;
}

.pa-check .ic {
  width: 11px;
  height: 11px;
}

.project-assets-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.project-assets-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #e6e6e8;
  border-radius: 7px;
  background: #fff;
  color: #1f1f1f;
  font-size: 12px;
  cursor: pointer;
}

.project-assets-btn:hover {
  background: #f4f4f5;
}

.project-assets-btn--danger {
  border-color: #f0d5cd;
  color: #d4380d;
}

.project-assets-btn--danger:hover {
  background: #fdf3f1;
}

.project-assets-btn--danger.is-disabled,
.project-assets-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 素材上传浮动圆按钮 */
.asset-fab {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #111;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.asset-fab:hover {
  background: #2b2b2b;
  transform: translateY(-1px);
}

.asset-fab .ic {
  width: 20px;
  height: 20px;
}

/* 视频勾选框：仅 hover / 选中时显示 */
.lib-check {
  opacity: 0;
  transition: opacity 0.12s ease;
}

.lib-video:hover .lib-check,
.lib-video.is-selected .lib-check,
.lib-check:focus-visible {
  opacity: 1;
}

/* 选中视频：改用下拉选中项的蓝色 #1677ff */
.lib-video.is-selected {
  border-color: #1677ff;
  box-shadow: 0 0 0 1px #1677ff;
}

.lib-check.is-checked {
  border-color: #1677ff;
  background: #1677ff;
}

/* 视频卡片：镜号徽标 + 重新编辑移到左下 */
.lib-shot {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.lib-video-reedit {
  left: 10px;
  right: auto;
}

/* 面包屑后的数量 */
.lib-count {
  margin-left: 6px;
  color: #a3a3a8;
  font-size: 12px;
  white-space: nowrap;
}

/* 视频视图切换 */
.library-view-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #ececee;
  border-radius: 8px;
  background: #fff;
  color: #595959;
  cursor: pointer;
}

.library-view-toggle:hover {
  background: #f7f7f8;
}

.library-view-toggle .ic {
  width: 15px;
  height: 15px;
}

/* 列表视图 */
.lib-video-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lib-video--row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px;
  border: 1px solid #ececee;
  border-radius: 12px;
  background: #fff;
}

.lib-video--row .lib-check {
  position: static;
  flex: none;
  border-color: #d9d9de;
  background: #fff;
  color: #1f1f1f;
}

.lib-video--row .lib-check.is-checked {
  border-color: #1677ff;
  background: #1677ff;
  color: #fff;
}

.lib-row-thumb {
  position: relative;
  flex: none;
  width: 152px;
  height: 86px;
  border-radius: 8px;
  overflow: hidden;
}

.lib-row-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lib-row-main {
  flex: 1 1 auto;
  min-width: 0;
}

.lib-row-title {
  margin: 0;
  color: #1f1f1f;
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-row-meta {
  margin: 4px 0 0;
  color: #a3a3a8;
  font-size: 11.5px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}

.lib-row-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.lib-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #e6e6e8;
  border-radius: 7px;
  background: #fff;
  color: #1f1f1f;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.lib-row-btn:hover {
  background: #f4f4f5;
}

.lib-row-btn .ic {
  width: 13px;
  height: 13px;
}

/* 排序分段按钮 */
.lib-sort-group {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 2px;
  border-radius: 8px;
  background: #f4f4f5;
}

.lib-sort-btn {
  height: 28px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #8c8c8c;
  font-size: 12px;
  cursor: pointer;
}

.lib-sort-btn.is-active {
  background: #fff;
  color: #1f1f1f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 卡片 meta：时间右对齐 */
.lib-video-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.lib-meta-left {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-meta-time {
  flex: none;
  color: #a3a3a8;
  white-space: nowrap;
}

/* 工具栏间距优化：统一 10px，搜索框略收窄，图标控件视觉更平衡 */
.library-tools {
  gap: 10px;
}

.library-search-wrap {
  width: 240px;
}

.library-tools .lib-sort-group {
  margin: 0;
}

.library-tools .library-filter-wrap,
.library-tools .library-view-toggle {
  margin: 0;
}

/* 面包屑样式参考：项目 > 文件夹 > 分类，统一字色、细箭头分隔 */
.library-crumbs {
  gap: 2px;
  font-size: 13px;
}

.lib-crumb {
  padding: 2px 4px;
  border-radius: 4px;
  color: #3f3f46;
  font-size: 13px;
  font-weight: 400;
}

.lib-crumb:hover {
  color: #111;
  background: #f5f5f6;
}

.lib-crumb.is-current {
  color: #1f1f1f;
  font-weight: 400;
}

.lib-crumb-sep {
  padding: 0 4px;
  color: #c4c4ca;
  font-size: 13px;
  line-height: 1;
}

.lib-count {
  margin-left: 4px;
}

/* 生成记录之间的浅色分割线 */
.gen + .gen {
  position: relative;
  padding-top: 26px;
}

.gen + .gen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #f0f0f2;
}

/* 提示词悬停：浮层覆盖视频，不推动下方内容 */
.gen-head {
  position: relative;
}

.gen.is-prompt-open .gen-head {
  z-index: 30;
}

.gen.is-prompt-open .gen-prompt {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 31;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  max-height: 70vh;
  overflow-y: auto;
}

.gen.is-prompt-open .gen-prompt-text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* 覆盖旧的 hover 展开：保持 2 行截断，只有浮层开启时才展开 */
.gen-prompt:hover .gen-prompt-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gen.is-prompt-open .gen-prompt-text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* 素材操作按钮：删除在左、替换在右，白底 */
.pa-remove {
  left: 6px;
  right: auto;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  color: #1f1f1f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.pa-remove:hover {
  background: #f4f4f5;
}

.pa-replace {
  right: 6px;
  left: auto;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  color: #1f1f1f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.pa-replace:hover {
  background: #f4f4f5;
}

.pa-grid.is-selecting .pa-remove,
.pa-grid.is-selecting .pa-replace {
  display: none;
}

/* 素材网格：两端对齐 + 图片放大 */
.library-assets-view .pa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.library-assets-view .pa-card {
  width: auto;
}

.library-assets-view .pa-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.library-assets-view .pa-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-assets-view .pa-name {
  font-size: 13px;
}

/* 首帧启动：上次停在资产库时，先隐藏对话界面 */
html.boot-library #feed-wrap,
html.boot-library #composer-dock,
html.boot-library #main-title {
  visibility: hidden;
}

html.boot-library #library-view {
  display: flex !important;
}

/* 素材操作按钮加大 */
.pa-remove,
.pa-replace {
  width: 26px;
  height: 26px;
  top: 8px;
}

.pa-remove {
  left: 8px;
}

.pa-replace {
  right: 8px;
}

.pa-remove .ic,
.pa-replace .ic {
  width: 14px;
  height: 14px;
}

/* 项目设置弹层 */
.psettings-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ps-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ps-label {
  color: #1f1f1f;
  font-size: 13px;
  font-weight: 500;
}

.ps-select,
.ps-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e6e6e8;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

.ps-select:focus,
.ps-textarea:focus {
  border-color: #d4d4d8;
}

.ps-textarea {
  min-height: 76px;
  line-height: 20px;
  resize: vertical;
}

.ps-hint {
  color: #a3a3a8;
  font-size: 11.5px;
  font-style: normal;
  line-height: 16px;
}

.ps-note {
  margin: 0;
  color: #a3a3a8;
  font-size: 11.5px;
  line-height: 16px;
}

/* 项目锁定画幅 */
.ratio-chip.is-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============ 项目设置弹层（重做版） ============ */
.psettings-panel {
  width: 440px;
  max-width: calc(100vw - 32px);
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}

.ps-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 12px;
}

.ps-head h2 {
  margin: 0;
  color: #1f1f1f;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.ps-head p {
  margin: 4px 0 0;
  color: #a3a3a8;
  font-size: 12px;
  line-height: 18px;
}

.ps-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #8c8c8c;
  cursor: pointer;
}

.ps-close:hover {
  background: #f4f4f5;
  color: #1f1f1f;
}

.ps-close .ic {
  width: 15px;
  height: 15px;
}

.ps-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 10px 24px 8px;
}

.ps-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ps-row-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 18px;
}

.ps-label {
  flex: none;
  color: #1f1f1f;
  font-size: 13px;
  font-weight: 500;
}

.ps-hint {
  min-width: 0;
  color: #a3a3a8;
  font-size: 11.5px;
  font-style: normal;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ps-seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: #f4f4f5;
}

.ps-seg-btn {
  flex: 1 1 0;
  height: 30px;
  padding: 0 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #8c8c8c;
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.ps-seg-btn:hover {
  color: #1f1f1f;
}

.ps-seg-btn.is-active {
  background: #fff;
  color: #1f1f1f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ps-textarea {
  width: 100%;
  min-height: 78px;
  padding: 10px 12px;
  border: 1px solid #ececee;
  border-radius: 9px;
  background: #fafafa;
  color: #1f1f1f;
  font-size: 12.5px;
  line-height: 20px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.ps-textarea:focus {
  border-color: #d9d9de;
  background: #fff;
}

.ps-textarea::placeholder {
  color: #b8b8bd;
}

.ps-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px 22px;
}

.ps-btn {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.ps-btn--ghost {
  background: transparent;
  color: #8c8c8c;
}

.ps-btn--ghost:hover {
  background: #f4f4f5;
  color: #1f1f1f;
}

.ps-btn--primary {
  padding: 0 20px;
  background: #111;
  color: #fff;
}

.ps-btn--primary:hover {
  background: #2b2b2b;
}

/* 项目设置：画幅/分辨率同一行 + 快捷选项 */
.ps-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ps-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ps-body {
  gap: 16px;
}

.ps-hint {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 16px;
}

.ps-seg-btn {
  padding: 0 4px;
  font-size: 12px;
}

.ps-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.ps-preset {
  height: 28px;
  padding: 0 12px;
  border: 1px solid #ececee;
  border-radius: 999px;
  background: #fff;
  color: #595959;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.ps-preset:hover {
  background: #f7f7f8;
}

.ps-preset.is-active {
  border-color: #111;
  background: #111;
  color: #fff;
}

/* 项目设置：放大弹层、保存按钮居中、去掉取消 */
.psettings-panel {
  width: 560px;
}

.ps-body {
  padding: 12px 28px 10px;
  gap: 18px;
}

.ps-head {
  padding: 24px 28px 12px;
}

.ps-actions {
  justify-content: center;
  padding: 16px 28px 24px;
}

.ps-btn--primary {
  min-width: 132px;
  height: 36px;
  padding: 0 24px;
}

.ps-textarea {
  min-height: 96px;
  font-size: 13px;
}

.ps-seg-btn {
  height: 32px;
  font-size: 12.5px;
}

.ps-label {
  font-size: 13.5px;
}

/* 提示词浮层：位置与原文完全对齐、去掉阴影 */
.gen.is-prompt-open .gen-prompt {
  top: 0;
  left: 0;
  right: 0;
  margin: -12px -12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f7f8;
  box-shadow: none;
}

/* 项目设置快捷选项：选中态改为浅蓝，不用黑底 */
.ps-preset.is-active {
  border-color: #b6d4ff;
  background: #eaf3ff;
  color: #1677ff;
}

.ps-preset.is-active:hover {
  background: #e0edff;
}

/* 快捷选项：不使用颜色，仅用 + 前缀，选中态为浅灰底 */
.ps-preset {
  border-color: #ececee;
  background: #fff;
  color: #595959;
}

.ps-preset:hover {
  background: #f7f7f8;
  color: #1f1f1f;
}

.ps-preset.is-active {
  border-color: #e0e0e3;
  background: #f4f4f5;
  color: #1f1f1f;
}

.ps-preset.is-active:hover {
  background: #ededf0;
}

/* 快捷选项：无边框、圆角与其它控件一致（8px）、浅灰底 */
.ps-preset {
  border: none;
  border-radius: 8px;
  background: #f4f4f5;
  color: #595959;
}

.ps-preset:hover {
  background: #ececee;
  color: #1f1f1f;
}

.ps-preset.is-active {
  border: none;
  background: #e4e4e7;
  color: #1f1f1f;
}

.ps-preset.is-active:hover {
  background: #dcdcdf;
}

/* 详细信息：浮层显示，不占用布局、不向下推内容 */
.gen-head {
  position: relative;
}

.gen-detail {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid #f0f0f2;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

/* 参考图悬停动画 */
.ref-stack-item,
.ref-tile-thumb {
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.ref-stack-slot:hover .ref-stack-item,
.ref-tile-thumb:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

/* 参考图标签显示名称，过长省略 */
.ref-role {
  max-width: calc(100% - 12px);
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 元信息：每项独立浅灰底 chip */
.gen-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  white-space: normal;
}

.gen-meta-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  background: #f4f4f5;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

/* 资产库：删除所选按钮 */
.lib-sel-hide {
  color: #d4380d;
}

.lib-sel-hide.is-danger {
  background: #d4380d;
  color: #fff;
}

/* 顶部信息卡：去阴影、标题面包屑、数字换色 */
.conv-card {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.92);
}

.conv-label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #3f3f46;
  font-size: 13px;
  font-weight: 400;
}

.conv-crumb {
  color: #3f3f46;
  font-size: 13px;
  font-weight: 400;
}

.conv-crumb.is-current {
  color: #1f1f1f;
}

.conv-crumb-sep {
  padding: 0 2px;
  color: #c4c4ca;
  font-size: 13px;
  line-height: 1;
}

.conv-stat b {
  color: #1677ff;
  font-weight: 500;
}

/* 资产库选择栏按钮：文字更清晰，删除不用红色 */
.lib-sel-download,
.lib-sel-hide {
  height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
}

.lib-sel-download:hover,
.lib-sel-hide:hover {
  background: #2b2b2b;
}

.lib-sel-hide,
.lib-sel-hide.is-danger {
  background: #111;
  color: #fff;
}

.lib-sel-hide.is-danger {
  background: #3a3a3a;
}

.lib-sel-clear {
  font-size: 12.5px;
}

/* 删除所选：移到左侧，纯灰字、无按钮无底色 */
.lib-sel-hide,
.lib-sel-hide.is-danger {
  height: auto;
  padding: 0 4px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #8c8c8c;
  font-size: 12.5px;
  font-weight: 500;
}

.lib-sel-hide:hover,
.lib-sel-hide.is-danger:hover {
  background: transparent;
  color: #595959;
}


/* 删除所选链接：左侧纯灰字（覆盖旧按钮样式） */
.lib-sel-hide-link {
  height: auto;
  padding: 0 6px 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #8c8c8c;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.lib-sel-hide-link:hover {
  background: transparent;
  color: #595959;
}

.lib-sel-hide-link.is-danger {
  color: #595959;
  font-weight: 500;
}

/* 匹配资产按钮（秒数后面） */
.match-assets-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid #ececee;
  border-radius: 6px;
  background: #fff;
  color: #595959;
  font-size: 12px;
  cursor: pointer;
}

.match-assets-btn:hover {
  background: #f7f7f8;
  color: #1f1f1f;
}

/* 胶囊内显示名称，过长省略 */
.mention-label {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* 工作区标题与按钮加大 */
.ws-head {
  padding: 18px 12px 8px 16px;
}

.ws-title {
  color: #8c8c8c;
  font-size: 13.5px;
  font-weight: 500;
}

.ws-actions {
  gap: 4px;
}

.ws-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: #595959;
}

.ws-icon-btn .ic {
  width: 17px;
  height: 17px;
}

/* 工作区标题与图标：最终尺寸 */
.ws-head .ws-title {
  color: #8c8c8c;
  font-size: 13.5px;
  font-weight: 500;
}

.ws-head .ws-actions {
  gap: 4px;
}

.ws-head .ws-icon.icon-btn,
.ws-head .ws-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #595959;
}

.ws-head .ws-icon.icon-btn .ic,
.ws-head .ws-icon-btn .ic {
  width: 18px;
  height: 18px;
}

/* 工作区头部：更清爽（标题更轻、图标更细、间距统一） */
.ws-head {
  padding: 16px 12px 8px 16px;
}

.ws-head .ws-title {
  color: #a3a3a8;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

.ws-head .ws-actions {
  gap: 6px;
}

.ws-head .ws-icon.icon-btn,
.ws-head .ws-icon-btn {
  width: 28px;
  height: 28px;
  color: #8c8c8c;
}

.ws-head .ws-icon.icon-btn .ic,
.ws-head .ws-icon-btn .ic {
  width: 16px;
  height: 16px;
}

/* 头部只保留搜索与新建项目两个按钮，避免多余图标 */
.ws-head .ws-actions > .icon-btn:not(#ws-search-toggle):not(#ws-new-project) {
  display: none;
}

/* 工作区头部：放大版（标题 14px / 按钮 32 / 图标 20） */
.ws-head .ws-title {
  color: #8c8c8c;
  font-size: 14px;
  font-weight: 500;
}

.ws-head .ws-actions {
  gap: 6px;
}

.ws-head .ws-icon.icon-btn,
.ws-head .ws-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #737373;
}

.ws-head .ws-icon.icon-btn .ic,
.ws-head .ws-icon-btn .ic {
  width: 20px;
  height: 20px;
}

/* 工作区头部：图标与侧栏图标同尺寸（16px 图标 / 26px 按钮） */
.ws-head .ws-actions {
  gap: 4px;
}

.ws-head .ws-icon.icon-btn,
.ws-head .ws-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: #8c8c8c;
}

.ws-head .ws-icon.icon-btn .ic,
.ws-head .ws-icon-btn .ic {
  width: 16px;
  height: 16px;
}

/* ============ 登录 / 账号 ============ */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: #f7f7f8;
}

.login-card {
  width: 340px;
  padding: 28px 26px;
  border: 1px solid #ececee;
  border-radius: 16px;
  background: #fff;
}

.login-card h1 {
  margin: 0;
  color: #1f1f1f;
  font-size: 20px;
  font-weight: 600;
}

.login-sub {
  margin: 6px 0 20px;
  color: #a3a3a8;
  font-size: 12.5px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  color: #595959;
  font-size: 12.5px;
}

.login-field input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e6e6e8;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 13px;
  outline: none;
}

.login-field input:focus {
  border-color: #d4d4d8;
}

.login-error {
  margin: 0 0 12px;
  color: #d4380d;
  font-size: 12px;
}

.login-submit {
  width: 100%;
  height: 38px;
  border: none;
  border-radius: 9px;
  background: #111;
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.login-submit:hover {
  background: #2b2b2b;
}

.login-open .app {
  visibility: hidden;
}

.tools-user {
  margin: 8px 10px 2px;
  padding-top: 8px;
  border-top: 1px solid #f2f2f3;
  color: #a3a3a8;
  font-size: 11.5px;
}

/* 用户管理 */
.au-create {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.au-input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #e6e6e8;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 12.5px;
  outline: none;
}

.au-input--credits {
  width: 96px;
}

.au-error {
  margin: 4px 0 0;
  color: #d4380d;
  font-size: 12px;
}

.au-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.au-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #f0f0f2;
  border-radius: 10px;
}

.au-name {
  color: #1f1f1f;
  font-size: 13px;
  font-weight: 500;
}

.au-meta {
  color: #a3a3a8;
  font-size: 11.5px;
}

.au-actions {
  display: flex;
  gap: 6px;
}

.au-btn {
  height: 28px;
  padding: 0 8px;
  border: 1px solid #e6e6e8;
  border-radius: 7px;
  background: #fff;
  color: #595959;
  font-size: 11.5px;
  cursor: pointer;
}

.au-btn:hover {
  background: #f7f7f8;
}

.au-btn--danger {
  color: #d4380d;
}

.au-empty {
  margin: 0;
  color: #a3a3a8;
  font-size: 12px;
}

/* 用户管理：创建行一行排列 + 管理员改密 */
.au-create {
  flex-wrap: nowrap;
}

.au-create #au-username {
  width: 130px;
}

.au-create #au-password {
  width: 170px;
}

.au-create #au-credits {
  width: 90px;
}

.au-admin-pass {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f2f2f3;
}

.au-admin-pass .au-input {
  width: 200px;
}

.au-create #au-credits {
  width: 104px;
}

/* ============ 整页用户管理 ============ */
.admin-view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 32px 40px;
}

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-head h1 {
  margin: 0;
  color: #1f1f1f;
  font-size: 20px;
  font-weight: 600;
}

.admin-head p {
  margin: 6px 0 0;
  color: #a3a3a8;
  font-size: 12.5px;
}

.admin-back {
  flex: none;
  height: 32px;
  padding: 0 14px;
  border: 1px solid #e6e6e8;
  border-radius: 8px;
  background: #fff;
  color: #595959;
  font-size: 13px;
  cursor: pointer;
}

.admin-back:hover {
  background: #f7f7f8;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.admin-metric {
  padding: 14px 16px;
  border: 1px solid #f0f0f2;
  border-radius: 12px;
  background: #fff;
}

.admin-metric-label {
  color: #a3a3a8;
  font-size: 11.5px;
}

.admin-metric-value {
  display: block;
  margin-top: 6px;
  color: #1f1f1f;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.admin-create {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #f0f0f2;
  border-radius: 12px;
  background: #fbfbfc;
}

.admin-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1.2fr 130px 90px 90px 180px 300px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid #f0f0f2;
  border-radius: 10px;
  background: #fff;
}

.admin-row--head {
  padding: 0 14px 4px;
  border: none;
  background: transparent;
  color: #a3a3a8;
  font-size: 11.5px;
}

.admin-row.is-disabled {
  opacity: 0.6;
}

.admin-user {
  color: #1f1f1f;
  font-size: 13px;
  font-weight: 500;
}

.admin-cell {
  color: #595959;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.admin-usage {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #f0f0f2;
  overflow: hidden;
}

.admin-bar-fill {
  display: block;
  height: 100%;
  background: #1677ff;
}

.admin-usage em {
  color: #a3a3a8;
  font-size: 11.5px;
  font-style: normal;
}

.admin-pass {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f2f2f3;
  color: #8c8c8c;
  font-size: 12.5px;
}

.admin-empty {
  margin: 0;
  color: #a3a3a8;
  font-size: 12.5px;
}

.app[data-view="admin"] .gen-queue,
.app[data-view="admin"] .conv-cost,
.app[data-view="admin"] .conv-card,
.app[data-view="admin"] .usage-pop {
  display: none;
}

/* 用户管理页布局修正 */
.app[data-view="admin"] .content {
  justify-content: flex-start;
  align-items: stretch;
}

.admin-create .au-input {
  width: 150px;
}

.admin-create #ad-password {
  width: 190px;
}

.admin-create #ad-credits {
  width: 100px;
}

.admin-create .ps-btn--primary {
  min-width: 0;
  width: auto;
  height: 32px;
  padding: 0 16px;
  font-size: 12.5px;
}

.admin-row .au-btn {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.admin-row .au-input--credits {
  width: 110px;
}

.app[data-view="admin"] .main-head {
  display: none;
}

.app[data-view="admin"] .admin-view {
  padding-top: 24px;
}

.app[data-view="admin"] .content {
  display: none;
}

/* 用户管理：任务记录 */
.admin-task-section {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid #f2f2f3;
}

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

.admin-task-head h2 {
  margin: 0;
  color: #1f1f1f;
  font-size: 15px;
  font-weight: 600;
}

.admin-task-search {
  width: 280px;
}

.admin-task-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-task-row {
  display: grid;
  grid-template-columns: 230px 120px 180px 150px 80px 70px 150px;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid #f0f0f2;
  border-radius: 9px;
  background: #fff;
}

.admin-task-row--head {
  padding: 0 14px 2px;
  border: none;
  background: transparent;
  color: #a3a3a8;
  font-size: 11.5px;
}

.admin-task-id {
  color: #1f1f1f;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  user-select: all;
}

.admin-task-status {
  font-size: 12px;
  color: #8c8c8c;
}

.admin-task-status.is-succeeded {
  color: #2f9e44;
}

.admin-task-status.is-failed {
  color: #d4380d;
}

/* 任务记录：提示词与操作 */
.admin-task-row {
  grid-template-columns: 210px 90px 130px minmax(160px, 1fr) 120px 70px 60px 130px 160px;
}

.admin-prompt-cell {
  min-width: 0;
  overflow: hidden;
}

.admin-prompt-btn {
  max-width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: #595959;
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.admin-prompt-btn:hover {
  color: #1677ff;
}

.admin-task-actions {
  display: flex;
  gap: 6px;
}

.admin-task-actions .au-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.admin-prompt-panel {
  width: 560px;
}

.admin-prompt-text {
  margin: 0;
  max-height: 50vh;
  overflow-y: auto;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f7f7f8;
  color: #1f1f1f;
  font-family: inherit;
  font-size: 13px;
  line-height: 22px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 任务编号：去掉全局 code 的蓝底，保持等宽可选中 */
.admin-task-id {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #1f1f1f;
}

/* 任务操作列加宽以容纳 查看/下载/复制链接 */
.admin-task-row {
  grid-template-columns: 210px 90px 130px minmax(160px, 1fr) 120px 70px 60px 130px 230px;
}

/* ============ 自动化批量模式（独立视图） ============ */
.app[data-view="automation"] .content,
.app[data-view="automation"] .main-head {
  display: none;
}

.automation-view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 32px 40px;
}

.auto-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.auto-head h1 {
  margin: 0;
  color: #1f1f1f;
  font-size: 20px;
  font-weight: 600;
}

.auto-head p {
  margin: 6px 0 0;
  color: #a3a3a8;
  font-size: 12.5px;
}

.auto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.auto-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid #f0f0f2;
  border-radius: 12px;
  background: #fff;
}

.auto-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auto-panel-head h2 {
  margin: 0;
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 600;
}

.auto-project,
.auto-stats {
  color: #a3a3a8;
  font-size: 11.5px;
}

.auto-json {
  width: 100%;
  min-height: 420px;
  padding: 12px 14px;
  border: 1px solid #ececee;
  border-radius: 10px;
  background: #fafafa;
  color: #1f1f1f;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 20px;
  resize: vertical;
  outline: none;
}

.auto-json:focus {
  background: #fff;
  border-color: #d9d9de;
}

.auto-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auto-shots {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 62vh;
  overflow-y: auto;
}

.auto-shot {
  padding: 10px 12px;
  border: 1px solid #f0f0f2;
  border-radius: 10px;
  background: #fbfbfc;
}

.auto-shot-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auto-shot-head b {
  color: #1f1f1f;
  font-size: 13px;
}

.auto-shot-head span {
  color: #8c8c8c;
  font-size: 11.5px;
}

.auto-shot-warn {
  color: #d4380d;
  font-size: 11.5px;
  font-style: normal;
}

.auto-shot-prompt {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f4f4f5;
  color: #333;
  font-family: inherit;
  font-size: 12px;
  line-height: 19px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.auto-shot-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.auto-asset {
  padding: 2px 8px;
  border-radius: 6px;
  background: #f0f0f2;
  color: #595959;
  font-size: 11px;
}

.auto-asset--audio {
  background: #eef4ff;
  color: #1677ff;
}

.auto-project-select {
  height: 28px;
  max-width: 220px;
  padding: 0 8px;
  border: 1px solid #ececee;
  border-radius: 7px;
  background: #fff;
  color: #595959;
  font-size: 12px;
  outline: none;
}

/* 自动化批量状态 */
.auto-shot-state {
  padding: 2px 8px;
  border-radius: 6px;
  background: #f0f0f2;
  color: #8c8c8c;
  font-size: 11px;
  font-style: normal;
}

.auto-shot-state.is-succeeded {
  background: #e8f7ee;
  color: #2f9e44;
}

.auto-shot-state.is-failed {
  background: #fdf0eb;
  color: #d4380d;
}

.auto-shot-state.is-running,
.auto-shot-state.is-queued,
.auto-shot-state.is-submitted {
  background: #eef4ff;
  color: #1677ff;
}

.auto-shot-error {
  margin: 4px 0;
  color: #d4380d;
  font-size: 11.5px;
}

.auto-batch-status {
  margin: 0;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 18px;
}

.auto-window {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8c8c8c;
  font-size: 12px;
}

.auto-window input {
  width: 54px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid #ececee;
  border-radius: 7px;
  background: #fff;
  color: #1f1f1f;
  font-size: 12px;
  outline: none;
}

/* 管理员：模型通道 */
.admin-model-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #f2f2f3;
}

.admin-models {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.model-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid #f0f0f2;
  border-radius: 12px;
  background: #fff;
}

.model-card.is-active {
  border-color: #1677ff;
  box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.12) inset;
}

.model-card.is-unavailable {
  background: #fbfbfc;
}

.model-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-card-head b {
  color: #1f1f1f;
  font-size: 13.5px;
}

.model-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d4380d;
}

.model-status-dot.is-ok {
  background: #2f9e44;
}

.model-active-tag {
  margin-left: auto;
  color: #1677ff;
  font-size: 11px;
  font-style: normal;
}

.model-id {
  margin: 0;
  color: #595959;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11.5px;
}

.model-detail,
.model-caps,
.model-warn {
  margin: 0;
  color: #a3a3a8;
  font-size: 11.5px;
  line-height: 17px;
}

.model-warn {
  color: #d4380d;
}

.model-switch {
  margin-top: 6px;
  width: 100%;
}

/* 管理员分页 */
.admin-tabs {
  display: flex;
  gap: 6px;
  margin: 14px 0 20px;
  padding: 4px;
  border-radius: 10px;
  background: #f7f7f8;
  width: fit-content;
}

.admin-tab {
  height: 32px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #8c8c8c;
  font-size: 13px;
  cursor: pointer;
}

.admin-tab:hover {
  color: #1f1f1f;
}

.admin-tab.is-active {
  background: #fff;
  color: #1f1f1f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.admin-page {
  display: block;
}

.admin-page[hidden] {
  display: none;
}

/* 任务记录：日期筛选 / 紧凑排布 / 分页 */
.admin-task-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-task-date {
  width: 140px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.admin-task-date-sep {
  color: #a3a3a8;
  font-size: 12px;
}

.admin-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
}

.admin-pager .au-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.admin-page-num.is-active {
  border-color: #1677ff;
  color: #1677ff;
}

.admin-pager-info {
  margin-left: 6px;
  color: #a3a3a8;
  font-size: 12px;
}

/* 更紧凑的任务行 */
.admin-task-row {
  grid-template-columns: 195px 80px 120px minmax(140px, 1fr) 105px 62px 50px 112px 205px;
  gap: 8px;
  padding: 5px 12px;
  font-size: 12px;
}

.admin-task-row--head {
  padding: 0 12px 2px;
  font-size: 11px;
}

.admin-task-id {
  font-size: 11.5px;
}

.admin-prompt-btn {
  font-size: 12px;
}

.admin-task-actions {
  gap: 4px;
}

.admin-task-actions .au-btn {
  height: 24px;
  padding: 0 8px;
  font-size: 11.5px;
}

.admin-task-status {
  font-size: 11.5px;
}

.admin-tab {
  cursor: pointer;
}

.admin-tab:hover {
  background: rgba(255, 255, 255, 0.7);
}

/* 自动化/管理页隐藏创作页浮层，避免遮挡 */
.app[data-view="automation"] .gen-queue,
.app[data-view="admin"] .gen-queue,
.app[data-view="library"] .gen-queue,
.app[data-view="automation"] .conv-card,
.app[data-view="automation"] .key-line {
  display: none !important;
}

.app[data-view="automation"] .automation-view {
  padding-top: 20px;
}

/* AI 图片生成 */
.lib-ai-gen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  margin-left: 10px;
  border: 1px solid #ececee;
  border-radius: 8px;
  background: #fff;
  color: #595959;
  font-size: 12px;
  cursor: pointer;
}

.lib-ai-gen:hover {
  color: #1677ff;
  border-color: #d6e4ff;
}

.image-gen-panel {
  width: 620px;
}

.ig-prompt {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid #ececee;
  border-radius: 10px;
  background: #fafafa;
  color: #1f1f1f;
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  resize: vertical;
  outline: none;
}

.ig-row {
  display: flex;
  gap: 10px;
}

.ig-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #8c8c8c;
  font-size: 11.5px;
}

.ig-row select,
.ig-row input {
  height: 32px;
  padding: 0 8px;
  border: 1px solid #ececee;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 12.5px;
  outline: none;
}

.ig-grow {
  flex: 1;
}

.ig-refs-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ig-label {
  color: #8c8c8c;
  font-size: 11.5px;
}

.ig-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.ig-refs-empty {
  color: #a3a3a8;
  font-size: 12px;
}

.ig-ref-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  padding: 4px;
  border: 1px solid #ececee;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.ig-ref-chip img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 6px;
}

.ig-ref-chip span {
  max-width: 64px;
  overflow: hidden;
  color: #8c8c8c;
  font-size: 10.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ig-ref-chip.is-active {
  border-color: #1677ff;
  box-shadow: 0 0 0 1px #1677ff inset;
}

.ig-status {
  margin: 0;
  color: #8c8c8c;
  font-size: 12px;
}

.ig-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

/* 绘帧模型卡片 */
.admin-hz-models {
  grid-column: 1 / -1;
  margin-top: 6px;
}

.admin-hz-title {
  margin: 8px 0;
  color: #8c8c8c;
  font-size: 12px;
}

.admin-hz-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ig-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ig-preview-item {
  margin: 0;
}

.ig-preview-item img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 10px;
  background: #fafafa;
}

/* 缺失资产提示 */
.auto-missing {
  padding: 12px;
  border: 1px solid #ffe7ba;
  border-radius: 10px;
  background: #fffbe6;
}

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

.auto-missing-head b {
  color: #ad6800;
  font-size: 12.5px;
}

.auto-missing-generate {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.auto-missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.auto-missing-chip {
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff;
  color: #8c6d1f;
  font-size: 11.5px;
}

.lightbox-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox-audio audio {
  width: min(420px, 80vw);
}

/* 音色卡片内嵌播放器 */
.pa-thumb--audio {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 120px;
  background: #fafafa;
}

.pa-thumb--audio audio {
  width: 100%;
}

/* 提示词：始终两行截断，全文用浮层显示，不再撑开布局 */
.gen-prompt-text {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.gen-prompt:hover .gen-prompt-text,
.gen.is-expanded .gen-prompt-text,
.gen.is-prompt-open .gen-prompt-text {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
}

.feed-prompt-pop {
  position: fixed;
  z-index: 9999;
  width: min(540px, calc(100vw - 40px));
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid #ececee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  color: #1f1f1f;
  font-size: 13px;
  line-height: 21px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  pointer-events: none;
}

/* 详细信息默认展开，紧凑显示 */
.gen-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  padding: 7px 10px;
  border: 1px solid #f0f0f2;
  border-radius: 8px;
  background: #fafafa;
  color: #8c8c8c;
  font-size: 11.5px;
  line-height: 18px;
}

/* 详细信息：悬停浮层，仅生成时间与消耗积分 */
.feed-detail-pop {
  position: fixed;
  z-index: 9999;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid #ececee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  pointer-events: none;
}

.feed-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #8c8c8c;
  font-size: 12px;
  line-height: 24px;
}

.feed-detail-row b {
  color: #1f1f1f;
  font-weight: 500;
}

/* 失败任务：结果区不要沿用成功视频的宽度/灰底，保持紧凑 */
.gen[data-status="failed"] .gen-result {
  width: fit-content;
  max-width: 100%;
  background: transparent;
  border-radius: 0;
}

.gen[data-status="failed"] .gen-error {
  max-width: min(560px, 100%);
}

/* 取消/失败占位如果出现，也不占视频高度 */
.gen-result .gen-cancelled,
.gen-result .gen-empty {
  width: fit-content;
  max-width: min(560px, 100%);
}

.gen[data-status="failed"] .gen-error {
  min-width: min(340px, 100%);
}

.gen[data-status="failed"] .gen-result {
  min-width: min(340px, 100%);
}

/* 置顶项目标记 */
.ws-project-head.is-pinned .ws-project-name {
  color: #1677ff;
}

.ws-pin-badge {
  flex: none;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 5px;
  background: #eef4ff;
  color: #1677ff;
  font-size: 10px;
  line-height: 15px;
}

/* 侧栏三个入口加粗 */
.new-session-btn span,
.lib-entry span {
  font-weight: 600;
}

/* 置顶图标 */
.ws-pin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-left: 5px;
  color: #1677ff;
}

.ws-pin-badge .ws-pin-icon {
  width: 12px;
  height: 12px;
}

/* 侧栏置顶/项目分栏 */
.ws-section-label {
  padding: 8px 10px 4px;
  color: #a3a3a8;
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0.02em;
}

.ws-section-label:first-child {
  padding-top: 2px;
}

/* 置顶项目只分栏，不再用颜色/图标标记 */
.ws-project-head.is-pinned .ws-project-name {
  color: inherit;
}

.ref-role--audio {
  pointer-events: none;
  background: rgba(17, 17, 17, 0.72);
}


/* AutoDL 钱包 / 模型通道卡 */
.admin-autodl { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px; margin-top:14px; }
.admin-autodl-card { background:#fff; border:1px solid rgba(15,23,42,.08); border-radius:14px; padding:16px 18px; min-width:0; }
.admin-autodl-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.admin-autodl-title { font-size:13px; font-weight:600; color:#475569; }
.admin-autodl-tag { font-size:11px; color:#64748b; background:#f1f5f9; border-radius:999px; padding:3px 8px; }
.admin-autodl-balance { margin:10px 0 2px; font-size:30px; font-weight:700; letter-spacing:-.03em; color:#0f172a; }
.admin-autodl-balance.is-low { color:#dc2626; }
.admin-autodl-note { font-size:12px; color:#94a3b8; line-height:1.5; margin:0 0 12px; }
.admin-autodl-actions { display:flex; flex-wrap:wrap; gap:8px; }
.admin-autodl-model { font-size:15px; font-weight:600; color:#0f172a; margin:8px 0 4px; }
.admin-autodl-meta { font-size:12px; color:#64748b; line-height:1.7; margin:0 0 12px; }
.admin-autodl-warn { color:#dc2626; font-weight:600; }
@media (max-width: 900px) { .admin-autodl { grid-template-columns:1fr; } }


/* 原片 / 本地处理结果对比 */
.compare-overlay { position:fixed; inset:0; z-index:4000; background:rgba(8,12,20,.72); display:flex; align-items:center; justify-content:center; padding:24px; }
.compare-panel { position:relative; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px; width:min(1100px, calc(100vw - 48px)); max-height:92vh; overflow-y:auto; overflow-x:hidden; box-sizing:border-box; background:#0f172a; border:1px solid rgba(255,255,255,.12); border-radius:16px; padding:16px; box-shadow:0 24px 80px rgba(0,0,0,.45); }
.compare-col { min-width:0; overflow:hidden; }
.compare-label { margin:0 0 8px; font-size:13px; font-weight:600; color:#e2e8f0; }
.compare-col video { width:100%; max-width:100%; height:auto; max-height:70vh; object-fit:contain; display:block; border-radius:10px; background:#000; }
.compare-close { position:absolute; top:8px; right:8px; width:34px; height:34px; border-radius:50%; border:1px solid rgba(255,255,255,.2); background:#1e293b; color:#fff; font-size:22px; line-height:1; cursor:pointer; }
.compare-close:hover { background:#334155; }
@media (max-width: 760px) { .compare-panel { grid-template-columns:1fr; } .compare-col video { max-height:36vh; } }


.admin-local-tools { margin-top:14px; }
.admin-local-tools .admin-autodl-card { max-width: none; }
.admin-toggle-list { display:grid; gap:10px; margin-top:10px; }
.admin-toggle-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px 12px; border:1px solid #eef2f7; border-radius:10px; }
.admin-toggle-copy { min-width:0; }
.admin-toggle-title { font-size:13px; font-weight:600; color:#0f172a; }
.admin-toggle-note { margin-top:3px; font-size:12px; color:#94a3b8; line-height:1.45; }
.admin-toggle-switch { position:relative; display:inline-flex; width:40px; height:22px; flex:0 0 auto; }
.admin-toggle-switch input { position:absolute; opacity:0; width:0; height:0; }
.admin-toggle-slider { position:absolute; inset:0; border-radius:999px; background:#cbd5e1; transition:background .15s; cursor:pointer; }
.admin-toggle-slider::after { content:""; position:absolute; width:16px; height:16px; left:3px; top:3px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.2); transition:transform .15s; }
.admin-toggle-switch input:checked + .admin-toggle-slider { background:#0ea5e9; }
.admin-toggle-switch input:checked + .admin-toggle-slider::after { transform:translateX(18px); }
.admin-toggle-switch input:disabled + .admin-toggle-slider { opacity:.45; cursor:not-allowed; }


/* AI 对话 */
.ai-chat-panel { width:min(860px, calc(100vw - 32px)); height:min(760px, calc(100vh - 48px)); display:flex; flex-direction:column; padding:0; overflow:hidden; }
.ai-chat-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:18px 20px 14px; border-bottom:1px solid var(--line); }
.ai-chat-head h2 { margin:0; font-size:18px; letter-spacing:-.02em; }
.ai-chat-head p { margin:4px 0 0; font-size:12px; color:#94a3b8; }
.ai-chat-head-actions { display:flex; align-items:center; gap:8px; }
.ai-chat-messages { flex:1; overflow-y:auto; padding:18px 20px; display:flex; flex-direction:column; gap:12px; background:#fbfcfd; }
.ai-chat-msg { max-width:86%; padding:10px 13px; border-radius:12px; white-space:pre-wrap; word-break:break-word; font-size:14px; line-height:1.6; }
.ai-chat-msg.is-user { align-self:flex-end; background:#0ea5e9; color:#fff; border-bottom-right-radius:4px; }
.ai-chat-msg.is-assistant { align-self:flex-start; background:#fff; color:#0f172a; border:1px solid #e8eef5; border-bottom-left-radius:4px; }
.ai-chat-msg.is-pending { color:#64748b; font-style:italic; }
.ai-chat-composer { display:flex; align-items:flex-end; gap:10px; padding:12px 16px 16px; border-top:1px solid var(--line); background:#fff; }
.ai-chat-composer textarea { flex:1; resize:none; min-height:48px; max-height:160px; border:1px solid #dbe5ef; border-radius:12px; padding:12px 14px; font:inherit; font-size:14px; line-height:1.5; outline:none; }
.ai-chat-composer textarea:focus { border-color:#0ea5e9; box-shadow:0 0 0 3px rgba(14,165,233,.1); }
.ai-chat-send { height:44px; padding:0 22px; flex:0 0 auto; }
.ai-chat-empty { margin:auto; color:#94a3b8; font-size:14px; text-align:center; line-height:1.8; }
@media (max-width: 620px) { .ai-chat-panel { width:100vw; height:100dvh; border-radius:0; } .ai-chat-msg { max-width:92%; } }


.ai-chat-model-row { display:flex; align-items:center; gap:10px; margin-top:8px; }
.ai-chat-model-row select { max-width:320px; height:30px; border:1px solid #dbe5ef; border-radius:8px; padding:0 8px; background:#fff; font-size:12px; color:#0f172a; }
.ai-chat-model-row span { font-size:12px; color:#94a3b8; }


/* 管理后台开关/节点紧凑两列 */
.admin-local-tools .admin-toggle-list,
.admin-multichat .admin-toggle-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-local-tools .admin-toggle-row,
.admin-multichat .admin-toggle-row { min-height: 62px; }
@media (max-width: 900px) {
  .admin-local-tools .admin-toggle-list,
  .admin-multichat .admin-toggle-list { grid-template-columns: 1fr; }
}


/* 管理后台卡片间距微调 */
.admin-local-tools,
.admin-multichat { margin-top: 16px; }
.admin-local-tools .admin-autodl-card,
.admin-multichat .admin-autodl-card { padding: 18px 20px; border-radius: 16px; }
.admin-local-tools .admin-toggle-list,
.admin-multichat .admin-toggle-list { gap: 12px; margin-top: 12px; }
.admin-local-tools .admin-toggle-row,
.admin-multichat .admin-toggle-row { padding: 12px 14px; border-radius: 12px; background: #fbfcfe; min-height: 58px; }
.admin-multichat .admin-toggle-row { background: #fff; min-height: 56px; }
.admin-toggle-title { font-size: 13px; letter-spacing: .01em; }
.admin-toggle-note { color: #8a9bb0; line-height: 1.5; }
.admin-multichat .admin-autodl-actions { margin-top: 14px; }
@media (max-width: 900px) {
  .admin-local-tools .admin-toggle-list,
  .admin-multichat .admin-toggle-list { gap: 10px; }
}


.admin-omega-video { margin-top:16px; }
.admin-omega-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }
.admin-omega-model { border:1px solid #eef2f7; border-radius:10px; padding:10px 12px; background:#fbfcfe; }
.admin-omega-model-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.admin-omega-model-name { font-size:13px; font-weight:600; color:#0f172a; }
.admin-omega-model-code { margin-top:4px; font-size:11px; color:#94a3b8; word-break:break-all; }
.admin-omega-model-meta { margin-top:6px; font-size:12px; color:#64748b; line-height:1.5; }
@media (max-width:900px){ .admin-omega-grid { grid-template-columns:1fr; } }


/* 模型通道：平台总览 */
.admin-platforms { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; margin:4px 0 18px; }
.admin-platform-card { background:#fff; border:1px solid rgba(15,23,42,.08); border-radius:14px; padding:14px 16px; min-width:0; }
.admin-platform-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.admin-platform-name { font-size:14px; font-weight:700; color:#0f172a; }
.admin-platform-badge { font-size:11px; padding:3px 8px; border-radius:999px; white-space:nowrap; }
.admin-platform-badge.is-active { color:#0369a1; background:#e0f2fe; }
.admin-platform-badge.is-ok { color:#047857; background:#d1fae5; }
.admin-platform-badge.is-warn { color:#b45309; background:#fef3c7; }
.admin-platform-badge.is-muted { color:#64748b; background:#f1f5f9; }
.admin-platform-rate { margin:10px 0 2px; font-size:22px; font-weight:700; letter-spacing:-.02em; color:#0f172a; }
.admin-platform-rate small { font-size:12px; font-weight:500; color:#94a3b8; letter-spacing:0; }
.admin-platform-meta { font-size:12px; color:#64748b; line-height:1.6; }
.admin-platform-note { margin-top:6px; font-size:11px; color:#94a3b8; line-height:1.5; }
.admin-channel-title { margin:2px 0 10px; font-size:13px; font-weight:600; color:#475569; }
@media (max-width:900px){ .admin-platforms { grid-template-columns:1fr; } }

.model-price { margin-top:6px; font-size:12px; font-weight:600; color:#0f172a; }


/* 模型目录：单行列表 */
.admin-model-section-card { margin-top: 12px; }
.admin-model-list { margin-top: 10px; border: 1px solid #eef2f7; border-radius: 10px; overflow-x: auto; }
.admin-model-list-head,
.admin-model-row { display: grid; grid-template-columns: minmax(190px,1.35fr) minmax(170px,1.45fr) 78px 112px 118px 72px; gap: 10px; align-items: center; padding: 8px 12px; min-width: 820px; }
.admin-model-list-head { background: #f8fafc; color: #94a3b8; font-size: 11px; letter-spacing: .04em; }
.admin-model-row { border-top: 1px solid #f1f5f9; background: #fff; }
.admin-model-row:nth-child(even) { background: #fcfdff; }
.admin-model-name-cell { display: flex; flex-direction: column; min-width: 0; }
.admin-model-name { font-size: 12.5px; font-weight: 600; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-model-group { margin-top: 2px; font-size: 10px; color: #94a3b8; }
.admin-model-code { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-model-spec { font-size: 11.5px; color: #475569; white-space: nowrap; }
.admin-model-refs { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.admin-model-rate { font-size: 12px; font-weight: 600; color: #0f172a; white-space: nowrap; }
.admin-model-status { justify-self: start; font-size: 11px; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.admin-model-status.is-ok { color: #047857; background: #d1fae5; }
.admin-model-status.is-off { color: #b45309; background: #fef3c7; }


/* 模型目录：左右两列紧凑列表 */
.admin-model-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:10px; }
.admin-model-columns .admin-model-list { margin-top:0; }
.admin-model-columns .admin-model-list-head,
.admin-model-columns .admin-model-row { grid-template-columns:minmax(0,1fr) auto auto; gap:10px; min-width:0; padding:7px 10px; }
.admin-model-columns .admin-model-list-head span:last-child { text-align:right; }
.admin-model-main { min-width:0; }
.admin-model-name-line { display:flex; align-items:center; gap:6px; min-width:0; }
.admin-model-name-line .admin-model-name { min-width:0; }
.admin-model-name-line .admin-model-group { flex:0 0 auto; margin-top:0; padding:1px 5px; border-radius:4px; background:#f1f5f9; }
.admin-model-sub { margin-top:2px; font-size:10.5px; color:#94a3b8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.admin-model-columns .admin-model-rate { justify-self:end; }
.admin-model-columns .admin-model-status { justify-self:end; }
@media (max-width:1100px){ .admin-model-columns { grid-template-columns:1fr; } }


/* 任务记录：双列紧凑列表 */
.admin-task-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.admin-task-column { border:1px solid #eef2f7; border-radius:10px; overflow:hidden; background:#fff; }
.admin-task-item { padding:9px 12px; border-top:1px solid #f1f5f9; background:#fff; }
.admin-task-item:first-child { border-top:0; }
.admin-task-item-head { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.admin-task-id { min-width:0; font-size:11px; color:#0f172a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.admin-task-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:4px; flex:0 0 auto; }
.admin-task-actions .au-btn { height:24px; padding:2px 7px; font-size:11px; }
.admin-task-item-meta { display:flex; justify-content:space-between; gap:10px; margin-top:5px; font-size:11px; color:#94a3b8; }
.admin-task-project { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.admin-task-sub { flex:0 0 auto; white-space:nowrap; }
@media (max-width:1100px){ .admin-task-columns { grid-template-columns:1fr; } }


/* 宽屏任务记录四列 */
@media (min-width:1700px) {
  .admin-task-columns.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-task-columns.is-4 .admin-task-item { padding: 8px 10px; }
  .admin-task-columns.is-4 .admin-task-actions { gap: 3px; }
  .admin-task-columns.is-4 .admin-task-actions .au-btn { height: 22px; padding: 1px 5px; font-size: 10px; }
  .admin-task-columns.is-4 .admin-task-id { font-size: 10px; }
  .admin-task-columns.is-4 .admin-task-item-meta { font-size: 10px; }
}


/* 模型显示开关 */
.admin-model-columns .admin-model-list-head,
.admin-model-columns .admin-model-row { grid-template-columns:minmax(0,1fr) auto auto 34px; }
.admin-model-toggle { position:relative; display:inline-flex; width:32px; height:18px; flex:0 0 auto; justify-self:end; }
.admin-model-toggle-input { position:absolute; opacity:0; width:0; height:0; }
.admin-model-toggle-slider { position:absolute; inset:0; border-radius:999px; background:#cbd5e1; cursor:pointer; transition:background .15s; }
.admin-model-toggle-slider::after { content:""; position:absolute; width:14px; height:14px; left:2px; top:2px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.2); transition:transform .15s; }
.admin-model-toggle-input:checked + .admin-model-toggle-slider { background:#0ea5e9; }
.admin-model-toggle-input:checked + .admin-model-toggle-slider::after { transform:translateX(14px); }
.admin-model-toggle-input:disabled + .admin-model-toggle-slider { opacity:.5; cursor:wait; }
.admin-model-row.is-off { opacity:.58; }


/* 模型目录：按计费方式分列 */
.admin-model-columns.is-single { grid-template-columns: 1fr; }
.admin-model-column { display: flex; flex-direction: column; min-width: 0; }
.admin-model-list-caption { margin: 0 2px 6px; font-size: 11px; font-weight: 600; color: #64748b; letter-spacing: .03em; }


/* 任务记录：两列，每条一行 */
.admin-task-columns.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-task-columns.is-1 { grid-template-columns: 1fr; }
.admin-task-item { display:grid; grid-template-columns: 170px minmax(0,1fr) auto auto; align-items:center; gap:10px; padding:7px 10px; }
.admin-task-item .admin-task-id { min-width:0; font-size:10.5px; }
.admin-task-item .admin-task-project { min-width:0; font-size:11px; color:#475569; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.admin-task-item .admin-task-sub { font-size:10.5px; color:#94a3b8; white-space:nowrap; }
.admin-task-item .admin-task-actions { flex-wrap:nowrap; }
.admin-task-item .admin-task-actions .au-btn { height:23px; padding:2px 6px; font-size:10px; }
@media (max-width:1100px){
  .admin-task-item { grid-template-columns: minmax(0,1fr) auto; }
  .admin-task-item .admin-task-project { display:none; }
  .admin-task-item .admin-task-sub { display:none; }
}


/* 后台刷新首帧：先隐藏对话，避免闪到对话页 */
html.boot-admin #feed-wrap,
html.boot-admin #composer-dock,
html.boot-admin #main-title,
html.boot-admin #library-view {
  visibility: hidden;
}


/* 输入条模型选择 */
.model-inline { display:inline-flex; align-items:center; gap:5px; min-width:0; max-width:280px; }
.model-row-label { font-size:11px; color:#94a3b8; white-space:nowrap; }
.model-inline select { max-width:245px; height:30px; border:1px solid #dbe5ef; border-radius:8px; padding:0 7px; background:#fff; color:#0f172a; font-size:11px; }
@media (max-width:900px){ .model-inline { max-width:190px; } .model-inline select { max-width:155px; } }


/* 模型卡片顶部单行工具栏 */
.admin-model-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 8px; min-width:0; }
.admin-model-toolbar-main { display:flex; align-items:baseline; gap:10px; min-width:0; flex:1 1 auto; overflow:hidden; }
.admin-model-toolbar-title { flex:0 0 auto; font-size:13px; font-weight:600; color:#475569; white-space:nowrap; }
.admin-model-toolbar-note { min-width:0; font-size:11.5px; color:#94a3b8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.admin-model-toolbar-actions { display:flex; align-items:center; gap:7px; flex:0 0 auto; }
.admin-model-toolbar-buttons { display:flex; align-items:center; gap:7px; }
.admin-model-toolbar .admin-autodl-tag { white-space:nowrap; }
@media (max-width:900px){ .admin-model-toolbar { flex-wrap:wrap; } .admin-model-toolbar-main { flex-basis:100%; } }


/* 后台顶栏固定 */
.admin-sticky { position:sticky; top:-24px; z-index:30; margin:-24px -32px 0; padding:24px 32px 0; background:#fff; }
.admin-title-row { display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; min-width:0; }
.admin-title-row h1 { flex:0 0 auto; margin:0; }
.admin-title-row p { min-width:0; margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.admin-head { align-items:center; margin-bottom:10px; }
.admin-tabs { margin:8px 0 16px; }
@media (max-width:900px){ .admin-sticky { margin:-24px -18px 0; padding:24px 18px 0; } }


/* 任务记录：字号加大、每页 20 条 */
.admin-task-item { padding: 10px 12px; gap: 12px; }
.admin-task-item .admin-task-id { font-size: 12px; }
.admin-task-item .admin-task-project { font-size: 12.5px; }
.admin-task-item .admin-task-sub { font-size: 12px; }
.admin-task-item .admin-task-actions .au-btn { height: 28px; padding: 3px 8px; font-size: 11.5px; }
.admin-task-columns .admin-task-column { border-radius: 12px; }

.admin-platform-ratio { margin-top:2px; font-size:11px; color:#0369a1; }


/* 输入条自定义模型选择面板 */
.model-inline { position:relative; max-width:260px; }
.model-select-native { display:none; }
.model-select-trigger { display:flex; align-items:center; gap:6px; max-width:235px; height:32px; border:1px solid #dbe5ef; border-radius:8px; padding:0 8px; background:#fff; color:#0f172a; font-size:13px; font-weight:500; cursor:pointer; }
.model-select-trigger > span { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.model-select-trigger .ic { flex:0 0 auto; color:#94a3b8; }
.model-select-trigger:hover { border-color:#b9d4ea; }
.model-menu { position:absolute; left:0; bottom:calc(100% + 8px); z-index:80; width:min(760px, calc(100vw - 80px)); max-height:min(460px, 70vh); overflow:auto; background:#fff; border:1px solid #e4ebf3; border-radius:12px; box-shadow:0 18px 48px rgba(15,23,42,.18); padding:10px; }
.model-menu[data-open="0"] { display:none; }
.model-menu-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.model-menu-group-title { margin:0 0 6px 2px; font-size:12px; font-weight:700; color:#64748b; }
.model-menu-item { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; padding:9px 10px; border:1px solid transparent; border-radius:8px; background:#fff; color:#0f172a; text-align:left; cursor:pointer; font-size:13px; }
.model-menu-item:hover { background:#f6fbfe; border-color:#e0eef8; }
.model-menu-item.is-selected { background:#eaf7ff; border-color:#bae3f7; }
.model-menu-item-name { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:600; }
.model-menu-item-rate { flex:0 0 auto; color:#64748b; font-size:11.5px; }
.model-menu-empty { padding:8px; color:#94a3b8; font-size:12px; }
@media (max-width:900px){ .model-inline { max-width:210px; } .model-select-trigger { max-width:185px; font-size:12px; } .model-menu { width:min(94vw, calc(100vw - 32px)); } .model-menu-columns { grid-template-columns:1fr; } }


/* 模型选择触发器去掉边框 */
.model-select-trigger { border:0; background:transparent; padding:2px 4px; }
.model-select-trigger:hover { border:0; background:#f5f9fc; }


/* 模型菜单：三列、无滚动、虚线分组 */
.model-menu { width:min(1080px, calc(100vw - 80px)); max-height:none; overflow:visible; }
.model-menu-columns.is-three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.model-menu-columns.is-three .model-menu-group.is-billing-split { border-left:1px dashed #e6edf5; padding-left:12px; }
.model-menu-columns.is-three .model-menu-item { padding:8px 9px; }
.model-menu-columns.is-three .model-menu-item-name { font-size:13px; }
.model-menu-columns.is-three .model-menu-item-rate { font-size:12px; }
@media (max-width:900px){ .model-menu { width:min(94vw, calc(100vw - 32px)); max-height:min(460px,70vh); overflow:auto; } .model-menu-columns.is-three { grid-template-columns:1fr; } .model-menu-columns.is-three .model-menu-group.is-billing-split { border-left:0; padding-left:0; } }


/* 模型参考数量标签 */
.model-menu-item-main { display:flex; align-items:center; gap:6px; min-width:0; }
.model-menu-refs { display:flex; align-items:center; gap:3px; flex:0 0 auto; }
.model-menu-ref { padding:1px 4px; border-radius:4px; font-size:9.5px; font-weight:600; line-height:1.5; }
.model-menu-ref.is-image { color:#0369a1; background:#e0f2fe; }
.model-menu-ref.is-video { color:#047857; background:#d1fae5; }
.model-menu-ref.is-audio { color:#b45309; background:#fef3c7; }


/* 按次计费合并为一个标题 */
.model-menu-columns.is-peruse-layout { grid-template-columns:minmax(0,1fr) minmax(0,2fr); }
.model-menu-group--peruse { border-left:1px dashed #e6edf5; padding-left:12px; }
.model-menu-use-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 12px; }
.model-menu-use-column + .model-menu-use-column { border-left:1px dashed #e6edf5; padding-left:12px; }
@media (max-width:900px){
  .model-menu-columns.is-peruse-layout { grid-template-columns:1fr; }
  .model-menu-group--peruse { border-left:0; padding-left:0; }
  .model-menu-use-columns { grid-template-columns:1fr; }
  .model-menu-use-column + .model-menu-use-column { border-left:0; padding-left:0; }
}


/* 模型状态点 */
.model-status-dot { width:7px; height:7px; flex:0 0 auto; border-radius:50%; }
.model-status-dot.is-green { background:#22c55e; }
.model-status-dot.is-yellow { background:#f59e0b; }
.model-status-dot.is-red { background:#ef4444; }
.model-status-dot.is-gray { background:#9ca3af; }
.model-menu-item.is-failed { opacity:.52; cursor:not-allowed; }
.model-menu-item.is-failed:hover { background:#fff; border-color:transparent; }


/* 参考数量标签加大，分隔线改实线 */
.model-menu-ref { font-size:11px; padding:2px 5px; border-radius:5px; }
.model-menu-group--peruse { border-left:1px solid #e6edf5; }
.model-menu-use-column + .model-menu-use-column { border-left:1px solid #e6edf5; }

.ps-pair .ps-field:only-child { grid-column:1 / -1; }


/* 模型触发器固定宽度，避免名称长短导致布局跳动 */
.model-inline { max-width:none; }
.model-select-trigger { width:200px; max-width:200px; flex:0 0 200px; }
.model-select-trigger > span { flex:1 1 auto; }
@media (max-width:900px){ .model-select-trigger { width:165px; max-width:165px; flex-basis:165px; } }


/* 概览：模型运行状态 */
.admin-model-health { margin-top:16px; }
.admin-health-card { padding:16px 20px; }
.admin-health-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:12px; }
.admin-health-item { display:flex; align-items:center; gap:7px; padding:8px 10px; border:1px solid #eef2f7; border-radius:8px; background:#fbfcfe; font-size:12px; color:#64748b; }
.admin-health-label { min-width:0; flex:1 1 auto; }
.admin-health-item b { color:#0f172a; font-size:14px; }
.admin-autodl.is-single { grid-template-columns:1fr; }
@media (max-width:900px){ .admin-health-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }


/* 后台模型参考能力标签 */
.admin-model-support { display:flex; align-items:center; gap:4px; margin-top:4px; flex-wrap:wrap; }
.admin-support { padding:1px 5px; border-radius:4px; font-size:10.5px; font-weight:600; line-height:1.6; }
.admin-support.is-image { color:#0369a1; background:#e0f2fe; }
.admin-support.is-video { color:#047857; background:#d1fae5; }
.admin-support.is-audio { color:#b45309; background:#fef3c7; }
.admin-support.is-none { color:#b91c1c; background:#fee2e2; }


/* 模型参考标签固定对齐 */
.model-menu-item-main { display:flex; align-items:center; gap:12px; flex:1 1 auto; min-width:0; }
.model-menu-item-label { display:flex; align-items:center; gap:6px; width:108px; min-width:108px; flex:0 0 108px; }
.model-menu-item-label .model-menu-item-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.model-menu-refs { display:flex; align-items:center; gap:3px; flex:0 0 auto; }
.model-menu-refs.is-empty { width:1px; }
@media (max-width:900px){ .model-menu-item-label { width:100px; flex-basis:100px; } .model-menu-item-main { gap:8px; } }

.admin-health-head-actions { display:flex; align-items:center; gap:8px; }


/* 工作流列表双列 */
.admin-model-columns.is-plain { grid-template-columns:repeat(2,minmax(0,1fr)); }
.admin-model-columns.is-plain .admin-model-list { margin-top:0; }
@media (max-width:1100px){ .admin-model-columns.is-plain { grid-template-columns:1fr; } }

.admin-model-columns.is-plain { grid-template-columns:repeat(2,minmax(0,1fr)); }
.admin-model-columns.is-plain .admin-model-list { margin-top:0; }
@media (max-width:1100px){ .admin-model-columns.is-plain { grid-template-columns:1fr; } }


/* 参考数量标签统一灰色描边样式 */
.model-menu-ref,
.model-menu-ref.is-image,
.model-menu-ref.is-video,
.model-menu-ref.is-audio {
  color:#4b5563;
  background:#f4f5f7;
  border:1px solid #e5e7eb;
}
.admin-support.is-image,
.admin-support.is-video,
.admin-support.is-audio {
  color:#4b5563;
  background:#f4f5f7;
  border:1px solid #e5e7eb;
}


/* 使用说明横版 */
.modal-panel.help-panel { width:min(1040px, calc(100vw - 48px)); max-width:1040px; }
.help-panel .modal-head { padding-bottom:12px; }
.help-panel .modal-body {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0 30px;
  align-items:start;
  max-height:calc(88vh - 96px);
  overflow:auto;
}
.help-panel .help-block { break-inside:avoid; }
.help-panel .help-block:last-child { grid-column:1 / -1; }
@media (max-width:760px) {
  .modal-panel.help-panel { width:calc(100vw - 24px); }
  .help-panel .modal-body { grid-template-columns:1fr; gap:0; }
}

.model-menu-ref.is-combined { font-variant-numeric: tabular-nums; letter-spacing:.2px; }


/* H3 / Wan3 单独一行；选中只换底色 */
.model-menu-item, .model-menu-item:hover, .model-menu-item.is-selected {
  border:0;
  box-shadow:none;
}
.model-menu-item:hover { background:#f6fbfe; }
.model-menu-item.is-selected { background:#eaf7ff; }
.model-menu-columns > .model-menu-special {
  grid-column:1 / -1;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  border-top:1px solid #eef2f7;
  margin-top:2px;
  padding-top:8px;
}
.model-menu-special .model-menu-item { flex:1 1 0; min-width:0; width:auto; }
@media (max-width:900px){ .model-menu-special .model-menu-item { flex:1 1 100%; } }


/* 用户组 */
.admin-group-panel { margin:10px 0 14px; padding:14px 16px; border:1px solid #e5e7eb; border-radius:12px; background:#fff; }
.admin-group-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.admin-group-create { display:flex; gap:8px; margin-bottom:10px; }
.admin-group-create .au-input { max-width:260px; }
.admin-group-row { display:flex; align-items:center; gap:12px; padding:8px 0; border-top:1px solid #f1f5f9; font-size:13px; }
.admin-group-name { min-width:140px; font-weight:600; color:#0f172a; }
.admin-group-count { color:#64748b; font-size:12px; }
.admin-group-share { display:flex; align-items:center; gap:8px; color:#475569; }
.admin-group-row .au-btn { margin-left:auto; }
.admin-group-select { width:140px; }

.admin-row { grid-template-columns:1.1fr 150px 110px 90px 90px 300px; }
.admin-group-select { width:130px; height:30px; }


/* 模型菜单上下排列，每行等长 */
.model-menu { width:min(640px, calc(100vw - 80px)); max-height:min(72vh, 620px); overflow:auto; }
.model-menu-columns.is-stacked { display:flex; flex-direction:column; gap:10px; grid-template-columns:none; }
.model-menu-columns.is-stacked .model-menu-group { border-left:0; padding-left:0; }
.model-menu-columns.is-stacked .model-menu-group-title { margin-bottom:2px; }
.model-menu-columns.is-stacked .model-menu-item { width:100%; }
@media (max-width:900px){ .model-menu { width:min(94vw, calc(100vw - 32px)); max-height:70vh; overflow:auto; } }


/* 使用说明分页 */
.help-panel .modal-body {
  display:block;
  grid-template-columns:none;
  min-height:420px;
  max-height:calc(88vh - 170px);
  overflow:auto;
}
.help-panel .help-block { display:none; grid-column:auto; }
.help-panel .help-block.is-current { display:block; max-width:780px; margin:0 auto; }
.help-pager { display:flex; align-items:center; justify-content:center; gap:14px; padding:12px 20px 16px; border-top:1px solid #eef2f7; }
.help-page-indicator { min-width:54px; text-align:center; color:#64748b; font-size:12px; font-variant-numeric:tabular-nums; }
.help-pager .au-btn:disabled { opacity:.4; cursor:default; }


/* 上下分组，组内两列 */
.model-menu-columns.is-stacked .model-menu-two-columns {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:2px 8px;
}
.model-menu-columns.is-stacked .model-menu-two-columns .model-menu-item { width:100%; }
@media (max-width:700px) {
  .model-menu-columns.is-stacked .model-menu-two-columns { grid-template-columns:1fr; }
}


/* 上下分组，组内三列 */
.model-menu { width:min(920px, calc(100vw - 80px)); }
.model-menu-columns.is-stacked .model-menu-two-columns { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media (max-width:1100px) {
  .model-menu-columns.is-stacked .model-menu-two-columns { grid-template-columns:repeat(2,minmax(0,1fr)); }
}


/* 每个模型浅色底 */
.model-menu-item { background:#f7f9fc; }
.model-menu-item:hover { background:#eef6fb; }
.model-menu-item.is-selected { background:#eaf7ff; }
.model-menu-columns.is-stacked .model-menu-two-columns { gap:4px 8px; }

.feed-task-id { font-family:ui-monospace,Consolas,monospace; font-size:10.5px; overflow-wrap:anywhere; }


/* ================= 暗色主题 ================= */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1016;
  --bg-soft: #141821;
  --bg-ghost: #1a1f2a;
  --line: #262c38;
  --line-strong: #343c4b;
  --text: #e7eaf0;
  --muted: #9aa4b5;
  --faint: #6f7a8b;
  --hover: rgba(255,255,255,.06);
  --selected: rgba(255,255,255,.09);
  --accent: #62a7ff;
  --accent-strong: #4b93ef;
  --accent-weak: rgba(98,167,255,.14);
  --accent-line: rgba(98,167,255,.35);
  --shadow-card: 0 8px 28px rgba(0,0,0,.35);
  --shadow-pop: 0 16px 42px rgba(0,0,0,.45);
}
html[data-theme="dark"] body { background:var(--bg); color:var(--text); }
html[data-theme="dark"] .app,
html[data-theme="dark"] .main,
html[data-theme="dark"] .work,
html[data-theme="dark"] .create-view,
html[data-theme="dark"] .library-view,
html[data-theme="dark"] .admin-view,
html[data-theme="dark"] .automation-view { background:var(--bg); color:var(--text); }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .main-head,
html[data-theme="dark"] .sidebar-foot,
html[data-theme="dark"] .composer,
html[data-theme="dark"] .composer-dock,
html[data-theme="dark"] .usage-pop,
html[data-theme="dark"] .tools-pop,
html[data-theme="dark"] .model-menu,
html[data-theme="dark"] .ref-panel,
html[data-theme="dark"] .modal-panel,
html[data-theme="dark"] .menu,
html[data-theme="dark"] .help-panel { background:var(--bg-soft); color:var(--text); border-color:var(--line); }
html[data-theme="dark"] .model-menu-item,
html[data-theme="dark"] .gen,
html[data-theme="dark"] .gen-result,
html[data-theme="dark"] .prompt-input,
html[data-theme="dark"] .ws-search,
html[data-theme="dark"] .ref-add,
html[data-theme="dark"] .ref-stack-item,
html[data-theme="dark"] .usage-metric,
html[data-theme="dark"] .admin-metric,
html[data-theme="dark"] .admin-platform-card,
html[data-theme="dark"] .admin-autodl-card,
html[data-theme="dark"] .admin-group-panel,
html[data-theme="dark"] .admin-model-row,
html[data-theme="dark"] .admin-health-item,
html[data-theme="dark"] .admin-group-row,
html[data-theme="dark"] .admin-create,
html[data-theme="dark"] .admin-table,
html[data-theme="dark"] .admin-row,
html[data-theme="dark"] .lib-card,
html[data-theme="dark"] .lib-select,
html[data-theme="dark"] .ps-seg,
html[data-theme="dark"] .ps-textarea { background-color:var(--bg-ghost); color:var(--text); border-color:var(--line); }
html[data-theme="dark"] .model-menu-item:hover { background:#1e2634; }
html[data-theme="dark"] .model-menu-item.is-selected { background:#17324a; }
html[data-theme="dark"] .model-menu-ref { background:#232a36; color:#b8c1d0; border-color:#333c4b; }
html[data-theme="dark"] .model-menu-special { border-top-color:var(--line); }
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .prompt-editor,
html[data-theme="dark"] .ps-textarea { background:var(--bg-ghost); color:var(--text); border-color:var(--line-strong); }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder,
html[data-theme="dark"] .prompt-editor:empty:before { color:var(--faint); }
html[data-theme="dark"] .btn,
html[data-theme="dark"] .ps-btn,
html[data-theme="dark"] .au-btn,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .side-foot-btn,
html[data-theme="dark"] .ws-btn { background:var(--bg-ghost); color:var(--text); border-color:var(--line-strong); }
html[data-theme="dark"] .ps-btn--primary,
html[data-theme="dark"] .btn-primary { background:var(--accent); color:#fff; border-color:var(--accent); }
html[data-theme="dark"] .main-title,
html[data-theme="dark"] .ws-section,
html[data-theme="dark"] .model-menu-group-title,
html[data-theme="dark"] .gen-prompt-text,
html[data-theme="dark"] .admin-autodl-title,
html[data-theme="dark"] .admin-platform-name,
html[data-theme="dark"] .admin-model-name,
html[data-theme="dark"] .admin-user,
html[data-theme="dark"] .help-block h3 { color:var(--text); }
html[data-theme="dark"] .gen-meta,
html[data-theme="dark"] .ws-item-meta,
html[data-theme="dark"] .model-menu-item-rate,
html[data-theme="dark"] .admin-model-sub,
html[data-theme="dark"] .admin-platform-meta,
html[data-theme="dark"] .admin-platform-note,
html[data-theme="dark"] .usage-note,
html[data-theme="dark"] .help-list,
html[data-theme="dark"] .admin-autodl-note { color:var(--muted); }
html[data-theme="dark"] .main-head { border-bottom-color:var(--line); }
html[data-theme="dark"] .sidebar { border-right-color:var(--line); }
html[data-theme="dark"] .conv-item:hover,
html[data-theme="dark"] .ws-item:hover,
html[data-theme="dark"] .admin-row:hover { background:var(--hover); }
html[data-theme="dark"] .theme-toggle .theme-dot { background:#f3c969; border-color:#f3c969; }
.theme-toggle .theme-dot { width:11px; height:11px; flex:0 0 11px; border-radius:50%; background:linear-gradient(90deg,#f3c969 50%,#273142 50%); border:1px solid #d8dde6; }


/* 暗色主题补充：侧栏入口、标题、输入区 */
html[data-theme="dark"] .new-session-btn,
html[data-theme="dark"] .lib-entry {
  background:var(--bg-ghost);
  color:var(--text);
  border-color:var(--line-strong);
}
html[data-theme="dark"] .new-session-btn:hover,
html[data-theme="dark"] .lib-entry:hover { background:#202735; }
html[data-theme="dark"] .main-title,
html[data-theme="dark"] .main-title .conv-crumb,
html[data-theme="dark"] .ws-title,
html[data-theme="dark"] .ws-section-title { color:var(--text); background:transparent; }
html[data-theme="dark"] .prompt-editor,
html[data-theme="dark"] #prompt,
html[data-theme="dark"] .composer .prompt-input,
html[data-theme="dark"] .composer-row,
html[data-theme="dark"] .prompt-col,
html[data-theme="dark"] .refs-col { background:transparent; color:var(--text); }
html[data-theme="dark"] .duration-number,
html[data-theme="dark"] #duration-number { background:var(--bg-ghost); color:var(--text); }
html[data-theme="dark"] .gen-prompt-text,
html[data-theme="dark"] .feed-empty,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .lib-empty,
html[data-theme="dark"] .admin-empty { color:var(--muted); }
html[data-theme="dark"] .ref-add,
html[data-theme="dark"] .ref-stack-item { border-color:var(--line-strong); }
html[data-theme="dark"] .modal-panel,
html[data-theme="dark"] .ps-body,
html[data-theme="dark"] .modal-body { background:var(--bg-soft); color:var(--text); }
html[data-theme="dark"] .modal-head { border-bottom-color:var(--line); }
html[data-theme="dark"] .ps-hint,
html[data-theme="dark"] .ps-label,
html[data-theme="dark"] .help-page-indicator { color:var(--muted); }


/* 暗色：顶部会话卡片、模型触发器 */
html[data-theme="dark"] .conv-card { background:rgba(20,24,33,.94); border:1px solid var(--line); color:var(--text); }
html[data-theme="dark"] .conv-label { color:var(--text); }
html[data-theme="dark"] .conv-stat,
html[data-theme="dark"] .conv-cost { color:var(--muted); }
html[data-theme="dark"] .model-select-trigger,
html[data-theme="dark"] #model-select-label { color:var(--text); background:transparent; }
html[data-theme="dark"] .model-select-trigger:hover { background:#1e2634; }
html[data-theme="dark"] .model-select-trigger .ic { color:var(--muted); }
html[data-theme="dark"] .theme-toggle { color:var(--text); }


/* 暗色：任务结果与错误 */
html[data-theme="dark"] .gen-result,
html[data-theme="dark"] .gen-progress,
html[data-theme="dark"] .gen-video { background:#11151d; color:var(--text); }
html[data-theme="dark"] .gen-progress-bar { background:#2a3140; }
html[data-theme="dark"] .gen-progress-text,
html[data-theme="dark"] .gen-percent { color:var(--muted); }
html[data-theme="dark"] .gen-error { background:#2a1719; border-color:#5b2d31; color:#ffb4b8; }
html[data-theme="dark"] .gen-error-title { color:#ff9aa0; }
html[data-theme="dark"] .gen-error-msg { color:#e0a6aa; }
html[data-theme="dark"] .gen-error details,
html[data-theme="dark"] .gen-error summary { color:#d29a9e; }
html[data-theme="dark"] .gen-error pre { background:#201316; color:#e0b5b7; }
html[data-theme="dark"] .gen-meta-chip { background:#252c39; color:#aeb8c8; }
html[data-theme="dark"] .gen-detail,
html[data-theme="dark"] .gen-detail span { color:var(--muted); background:transparent; }


/* 左下角：费用滚动 + 明暗切换 */
.side-meta { display:flex; align-items:center; gap:8px; flex-wrap:nowrap; }
.side-meta .side-usage { flex:1 1 auto; min-width:0; padding:0 8px; }
.side-meta .side-theme { width:auto; flex:0 0 auto; height:30px; padding:0 8px; }
.usage-roll { display:inline-block; height:16px; overflow:hidden; vertical-align:middle; min-width:0; }
.usage-roll-track { display:flex; flex-direction:column; transition:transform .45s cubic-bezier(.2,.7,.25,1); }
.usage-roll-line { height:16px; line-height:16px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.usage-roll[data-index="1"] .usage-roll-track { transform:translateY(-16px); }
@media (max-width:700px) { .usage-roll-line { font-size:11px; } }


/* ================= 暗色可读性修正 ================= */
html[data-theme="dark"] .conv-card,
html[data-theme="dark"] .gen-queue,
html[data-theme="dark"] .gen-queue-item,
html[data-theme="dark"] .gen-result,
html[data-theme="dark"] .gen-result .gen-progress,
html[data-theme="dark"] .gen-video {
  background: #11151d !important;
  color: #e7eaf0 !important;
  border-color: #2a3140 !important;
}
html[data-theme="dark"] .conv-label,
html[data-theme="dark"] .conv-label *,
html[data-theme="dark"] .conv-stat,
html[data-theme="dark"] .conv-stat b { color:#e7eaf0 !important; }
html[data-theme="dark"] .gen-queue-title,
html[data-theme="dark"] .gen-queue-item,
html[data-theme="dark"] .gen-queue-item * { color:#dfe5ee !important; }
html[data-theme="dark"] .gen-queue-item:hover { background:#1d2532 !important; }
html[data-theme="dark"] .gen-error {
  background:#2a1719 !important;
  border-color:#5b2d31 !important;
}
html[data-theme="dark"] .gen-error * { color:#f0c0c4 !important; }
html[data-theme="dark"] .gen-error-title { color:#ff9aa0 !important; }
html[data-theme="dark"] .gen-progress,
html[data-theme="dark"] .gen-progress-text,
html[data-theme="dark"] .gen-progress-text *,
html[data-theme="dark"] .gen-percent { color:#aeb8c8 !important; }
html[data-theme="dark"] .sidebar .ws-project-name,
html[data-theme="dark"] .sidebar .ws-conversation-name,
html[data-theme="dark"] .sidebar .ws-title,
html[data-theme="dark"] .sidebar .ws-section-label,
html[data-theme="dark"] .sidebar .history-name,
html[data-theme="dark"] .sidebar .history-title { color:#e7eaf0 !important; }
html[data-theme="dark"] .sidebar .ws-conversation-time,
html[data-theme="dark"] .sidebar .history-time,
html[data-theme="dark"] .sidebar .ws-empty,
html[data-theme="dark"] .sidebar .ws-section-label { color:#9aa4b5 !important; }
html[data-theme="dark"] .sidebar .ws-project-toggle,
html[data-theme="dark"] .sidebar .ws-folder,
html[data-theme="dark"] .sidebar .ws-caret,
html[data-theme="dark"] .sidebar .ws-chat { color:#aeb8c8 !important; }
html[data-theme="dark"] .toast { background:#1b222e !important; color:#e7eaf0 !important; border-color:#343c4b !important; }
html[data-theme="dark"] .toast.error { background:#2a1719 !important; border-color:#5b2d31 !important; }

.admin-group-select { width:150px; height:62px; }
.admin-group-leader { width:120px; height:30px; }


/* 公共资产库 */
.lib-public-btn { margin-left:8px; }
.public-library-panel { width:min(1180px, calc(100vw - 48px)); max-width:1180px; }
.public-group-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:16px; align-items:start; }
.public-group-column { border:1px solid var(--line); border-radius:12px; padding:14px; background:var(--bg-soft); }
.public-group-head { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.public-group-head h3 { margin:0 0 4px; font-size:15px; color:var(--text); }
.public-group-head p { margin:0; color:var(--muted); font-size:12px; }
.public-group-sync { display:flex; gap:8px; margin:12px 0; }
.public-project-select { min-width:0; flex:1 1 auto; height:32px; }
.public-asset-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.public-asset-card { border:1px solid var(--line); border-radius:10px; padding:8px; background:var(--bg-ghost); }
.public-asset-thumb { aspect-ratio:1/1; border-radius:8px; overflow:hidden; display:flex; align-items:center; justify-content:center; background:var(--bg); color:var(--muted); }
.public-asset-thumb img { width:100%; height:100%; object-fit:cover; }
.public-asset-audio { display:flex; flex-direction:column; align-items:center; gap:6px; font-size:11px; padding:8px; text-align:center; }
.public-asset-meta { display:flex; flex-direction:column; gap:2px; margin:7px 0; font-size:12px; color:var(--muted); }
.public-asset-meta b { color:var(--text); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.public-asset-actions { display:flex; gap:4px; }
.public-asset-actions .au-btn { flex:1 1 auto; height:26px; font-size:11px; padding:0 4px; }


/* 暗色：全站文字可读性兜底 */
html[data-theme="dark"] .app :where(h1,h2,h3,h4,h5,h6,p,span,div,b,strong,em,small,label,a,button,input,textarea,select,option,li,summary,details,kbd,code,pre) {
  color: var(--text) !important;
}
html[data-theme="dark"] .app .gen-error * { color:#f0c0c4 !important; }
html[data-theme="dark"] .app .gen-error-title { color:#ff9aa0 !important; }
html[data-theme="dark"] .app .toast.error * { color:#ffc4c8 !important; }
html[data-theme="dark"] .app .ps-btn--primary,
html[data-theme="dark"] .app .btn-primary,
html[data-theme="dark"] .app .delete-confirm,
html[data-theme="dark"] .app .assistant-send { color:#fff !important; }
html[data-theme="dark"] .app .gen-meta,
html[data-theme="dark"] .app .gen-meta *,
html[data-theme="dark"] .app .gen-meta-row,
html[data-theme="dark"] .app .gen-time,
html[data-theme="dark"] .app .gen-detail-btn,
html[data-theme="dark"] .app .conv-stat,
html[data-theme="dark"] .app .conv-stat *,
html[data-theme="dark"] .app .conv-cost,
html[data-theme="dark"] .app .gen-queue-title,
html[data-theme="dark"] .app .lib-crumb,
html[data-theme="dark"] .app .lib-folder-meta,
html[data-theme="dark"] .app .project-assets-count,
html[data-theme="dark"] .app .ws-conversation-time,
html[data-theme="dark"] .app .history-time,
html[data-theme="dark"] .app .usage-note,
html[data-theme="dark"] .app .ps-hint,
html[data-theme="dark"] .app .admin-platform-meta,
html[data-theme="dark"] .app .admin-platform-note,
html[data-theme="dark"] .app .admin-model-sub,
html[data-theme="dark"] .app .help-page-indicator,
html[data-theme="dark"] .app .public-group-head p,
html[data-theme="dark"] .app .public-asset-meta,
html[data-theme="dark"] .app .public-asset-meta * { color:var(--muted) !important; }
html[data-theme="dark"] .app .gen-queue-item.is-failed,
html[data-theme="dark"] .app .gen-queue-item.is-failed * { color:#ff9aa0 !important; }
html[data-theme="dark"] .app .gen-queue-item.is-succeeded,
html[data-theme="dark"] .app .gen-queue-item.is-succeeded * { color:#8fe0b4 !important; }
html[data-theme="dark"] .app input::placeholder,
html[data-theme="dark"] .app textarea::placeholder { color:var(--faint) !important; }


/* 暗色：资产库卡片与工具栏 */
html[data-theme="dark"] .lib-folder,
html[data-theme="dark"] .lib-ai-gen,
html[data-theme="dark"] .lib-public-btn,
html[data-theme="dark"] .library-filter,
html[data-theme="dark"] .library-view-toggle,
html[data-theme="dark"] .project-assets-btn,
html[data-theme="dark"] .lib-select,
html[data-theme="dark"] .lib-video-card,
html[data-theme="dark"] .lib-video-row,
html[data-theme="dark"] .pa-thumb,
html[data-theme="dark"] .library-filter-pop,
html[data-theme="dark"] .lib-calendar,
html[data-theme="dark"] .project-assets {
  background:#141821 !important;
  color:var(--text) !important;
  border-color:#2a3140 !important;
}
html[data-theme="dark"] .lib-folder:hover,
html[data-theme="dark"] .lib-ai-gen:hover,
html[data-theme="dark"] .lib-public-btn:hover,
html[data-theme="dark"] .library-filter:hover,
html[data-theme="dark"] .library-view-toggle:hover,
html[data-theme="dark"] .project-assets-btn:hover { background:#1d2532 !important; }
html[data-theme="dark"] .lib-folder-icon { background:#232a36 !important; color:#c6d0df !important; }
html[data-theme="dark"] .lib-folder-name,
html[data-theme="dark"] .lib-folder-meta,
html[data-theme="dark"] .lib-crumb,
html[data-theme="dark"] .lib-group-title,
html[data-theme="dark"] .project-assets-title { color:var(--text) !important; }
html[data-theme="dark"] .lib-folder-meta,
html[data-theme="dark"] .project-assets-count { color:var(--muted) !important; }
html[data-theme="dark"] .lib-folder-edit { color:var(--muted) !important; }
html[data-theme="dark"] .lib-folder-edit:hover { background:#2a3140 !important; color:var(--text) !important; }
html[data-theme="dark"] .library-search { background:#141821 !important; color:var(--text) !important; border-color:#2a3140 !important; }


/* 暗色：资产库顶部工具按钮 */
html[data-theme="dark"] .lib-select-all,
html[data-theme="dark"] .lib-sel-hide-link,
html[data-theme="dark"] .lib-sel-download,
html[data-theme="dark"] .lib-sel-clear,
html[data-theme="dark"] .library-filter,
html[data-theme="dark"] .library-view-toggle,
html[data-theme="dark"] .lib-date-field,
html[data-theme="dark"] .lib-select {
  background:#141821 !important;
  color:var(--text) !important;
  border-color:#2a3140 !important;
}
html[data-theme="dark"] .lib-select-all:hover,
html[data-theme="dark"] .lib-sel-hide-link:hover,
html[data-theme="dark"] .lib-sel-download:hover,
html[data-theme="dark"] .lib-sel-clear:hover { background:#1d2532 !important; }
html[data-theme="dark"] .lib-checkbox { border-color:#8b97a8 !important; }


/* 暗色：资产库排序 */
html[data-theme="dark"] .lib-sort-group {
  background:#141821 !important;
  border-color:#2a3140 !important;
}
html[data-theme="dark"] .lib-sort-btn { color:var(--muted) !important; }
html[data-theme="dark"] .lib-sort-btn.is-active {
  background:#2a3140 !important;
  color:var(--text) !important;
}
