:root {
  --bg-deep: #050810;
  --bg-panel: rgba(12, 20, 40, 0.85);
  --border: rgba(0, 255, 200, 0.25);
  --accent: #00ffc8;
  --accent2: #3d8bff;
  --text: #e8f4ff;
  --text-muted: #9eb4d4;
  --fw-body: 500;
  --fw-ui: 600;
  --fw-title: 650;
  --danger: #ff4d6d;
  --success: #00e676;
  --radius: 12px;
  --font: "Segoe UI", "Microsoft YaHei", sans-serif;
  --shell-pad-x: 2rem;
  --shell-pad-y: 1.35rem;
  --ui-fs: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 暗色主题滚动条（避免系统默认白条突兀） */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 150, 180, 0.45) rgba(255, 255, 255, 0.04);
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(110, 140, 170, 0.42);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(46, 230, 166, 0.5);
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

/* 全局 * 的 margin:0 会盖掉 UA 对 dialog 的 margin:auto，导致弹窗贴左上角 */
dialog {
  margin: auto;
}

html {
  height: 100%;
  font-size: var(--ui-fs);
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 1rem;
  font-weight: var(--fw-body);
  line-height: 1.55;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 200, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 200, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  top: -200px;
  right: -100px;
  background: radial-gradient(circle, rgba(61, 139, 255, 0.15), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.top-nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 8, 16, 0.9);
  backdrop-filter: blur(12px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.logo-icon {
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.auth-brand h1 {
  margin: 0;
}

.auth-brand__mark {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  display: block;
}

.top-nav nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 1rem;
  transition: color 0.2s;
}

.top-nav nav a:hover { color: var(--accent); }

.user-badge {
  color: var(--accent);
  margin-right: 1rem;
  font-size: 0.9rem;
}

/* —— App shell：左侧导航 + 主内容区 —— */
:root {
  --app-sidebar-w: 264px;
  --app-sidebar-w-collapsed: 80px;
  --app-header-h: 60px;
}

.app-shell-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

body.app-shell {
  flex-direction: row;
  align-items: stretch;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.app-shell .bg-grid {
  opacity: 0.35;
}

body.app-shell .app-shell-main {
  height: 100%;
  overflow: auto;
  background: transparent;
}

body.app-shell.studio-workbench-page .app-shell-main {
  overflow: hidden;
}

body.app-shell .app-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  z-index: 20;
  width: var(--app-sidebar-w);
  height: 100vh;
  height: 100dvh;
  flex: 0 0 var(--app-sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0 0 1rem;
  box-sizing: border-box;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 11, 18, 0.98);
  overflow: hidden;
  transition: width 0.2s ease, flex-basis 0.2s ease;
}

body.app-shell.is-sidebar-collapsed .app-sidebar {
  width: var(--app-sidebar-w-collapsed);
  flex-basis: var(--app-sidebar-w-collapsed);
}

body.app-shell .app-sidebar-top {
  position: relative;
  height: var(--app-header-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 0.55rem 0 1.15rem;
}

body.app-shell .app-sidebar-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}

body.app-shell .app-sidebar-logo .logo-icon {
  width: 1.5rem;
  height: 1.5rem;
}

body.app-shell .app-sidebar-collapse {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.app-shell .app-sidebar-collapse:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

body.app-shell .app-sidebar-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1rem;
  overflow: auto;
  scrollbar-width: thin;
}

body.app-shell .app-nav-new {
  appearance: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  height: 2.85rem;
  padding: 0 0.85rem;
  border-radius: 12px;
  background: var(--accent);
  color: #041018;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

body.app-shell .app-nav-new:hover {
  filter: brightness(1.06);
}

body.app-shell .app-nav-new .app-nav-ico {
  color: inherit;
}

body.app-shell .app-nav-primary,
body.app-shell .app-nav-secondary,
body.app-shell .app-nav-more-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex-shrink: 0;
}

body.app-shell .app-nav-secondary {
  padding-top: 0.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 0.15rem;
  padding-top: 0.75rem;
}

body.app-shell .app-nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.65rem;
  height: 2.65rem;
  padding: 0 0.75rem;
  border-radius: 11px;
  color: rgba(220, 230, 245, 0.88);
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: var(--fw-ui);
  line-height: 1.35;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  font: inherit;
}

body.app-shell .app-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

body.app-shell .app-nav-item.is-on {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.app-shell .app-nav-item.is-sub {
  min-height: 1.9rem;
  height: auto;
  padding-left: 2.1rem;
  font-size: 0.92rem;
  font-weight: var(--fw-ui);
  color: var(--text-muted);
}

body.app-shell .app-nav-ico {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.92;
}

body.app-shell .app-nav-ico svg {
  display: block;
}

body.app-shell .app-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-shell .app-nav-more {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.55rem;
}

body.app-shell .app-nav-more-sum {
  list-style: none;
}

body.app-shell .app-nav-more-sum::-webkit-details-marker {
  display: none;
}

body.app-shell .app-sidebar-foot {
  flex-shrink: 0;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
  z-index: 30;
}

body.app-shell .app-help-promo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  text-decoration: none;
  color: #e8f4ff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(58, 160, 255, 0.28), transparent 55%),
    linear-gradient(135deg, rgba(18, 42, 48, 0.95), rgba(12, 28, 36, 0.98));
  border: 1px solid rgba(46, 230, 166, 0.18);
  transition: border-color 0.15s, transform 0.15s;
}

body.app-shell .app-help-promo:hover {
  border-color: rgba(46, 230, 166, 0.4);
  transform: translateY(-1px);
}

body.app-shell .app-help-promo-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

body.app-shell .app-help-promo-text strong {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

body.app-shell .app-help-promo-text span {
  font-size: 0.78rem;
  color: rgba(180, 198, 220, 0.82);
}

body.app-shell .app-help-promo-ico {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #3aa0ff, #2ee6a6);
  color: #041018;
}

body.app-shell .app-help-wrap {
  position: relative;
}

body.app-shell .app-help-btn {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(220, 230, 245, 0.92);
  width: 100%;
  min-height: 2.65rem;
  height: 2.65rem;
  padding: 0 0.75rem;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  box-sizing: border-box;
  transition: background 0.15s, color 0.15s;
}

body.app-shell .app-help-btn:hover,
body.app-shell .app-help-btn.is-on {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.app-shell .app-help-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.45rem);
  width: 100%;
  min-width: 10.5rem;
  padding: 0.45rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1a1f28;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

body.app-shell .app-help-menu[hidden] {
  display: none !important;
}

body.app-shell .app-help-menu-item {
  appearance: none;
  border: none;
  background: transparent;
  color: #e8eef6;
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1.3;
}

body.app-shell .app-help-menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

body.app-shell .app-help-dialog {
  width: min(400px, 92vw);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: #121820;
  color: var(--text);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

body.app-shell .app-help-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

body.app-shell .app-help-dialog-inner {
  padding: 1.15rem 1.25rem 1.25rem;
}

body.app-shell .app-help-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

body.app-shell .app-help-dialog-head strong {
  font-size: 1.1rem;
}

body.app-shell .app-help-dialog-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(210, 222, 238, 0.92);
}

body.app-shell .app-help-dialog-body img {
  display: block;
  max-width: 220px;
  width: 100%;
  margin: 0.75rem auto 0;
  border-radius: 12px;
  background: #fff;
  padding: 0.5rem;
}

body.app-shell .app-help-dialog-body a {
  color: var(--accent);
}

body.app-shell.is-sidebar-collapsed .app-help-promo {
  justify-content: center;
  padding: 0.55rem;
}

body.app-shell.is-sidebar-collapsed .app-help-promo-text {
  display: none;
}

body.app-shell.is-sidebar-collapsed .app-help-btn {
  justify-content: center;
  padding: 0;
  width: 2.45rem;
  margin: 0 auto;
}

body.app-shell.is-sidebar-collapsed .app-help-menu {
  left: calc(100% + 0.55rem);
  bottom: 0;
  width: 11.5rem;
}

body.app-shell .app-sidebar-fab {
  display: none;
}

/* 顶栏工具（参考首页右上角快捷区） */
body.app-shell .app-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  min-height: var(--app-header-h);
  padding: 0.55rem var(--shell-pad-x);
  background: rgba(5, 8, 16, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.app-shell .app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.app-shell .app-topbar-chip {
  display: inline-flex;
  align-items: center;
  height: 2.1rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: var(--fw-ui);
}

body.app-shell .app-topbar-chip:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

body.app-shell .app-topbar-chip.is-accent {
  color: #e8c56a;
  border-color: rgba(232, 197, 106, 0.35);
}

body.app-shell .app-topbar-balance {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 650;
  padding: 0 0.4rem;
}

body.app-shell .app-topbar-balance::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(0, 255, 200, 0.45);
}

body.app-shell .app-topbar-user {
  position: relative;
  display: inline-flex;
  align-items: center;
}

body.app-shell .app-topbar-user-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.35rem 0.2rem 0.2rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

body.app-shell .app-topbar-user-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.app-shell .app-topbar-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(0, 255, 200, 0.16);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

body.app-shell .app-topbar-avatar.is-lg {
  width: 2.55rem;
  height: 2.55rem;
  font-size: 1rem;
  border-radius: 12px;
}

body.app-shell .app-topbar-name {
  font-size: 0.98rem;
  font-weight: var(--fw-ui);
  color: var(--text-muted);
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-shell .app-topbar-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: min(300px, calc(100vw - 1.5rem));
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #121a28;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

body.app-shell .app-topbar-panel[hidden] {
  display: none !important;
}

body.app-shell .app-topbar-panel-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

body.app-shell .app-topbar-panel-id {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

body.app-shell .app-topbar-panel-id strong {
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-shell .app-topbar-panel-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

body.app-shell .app-topbar-panel-wallet {
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.app-shell .app-topbar-panel-wallet-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

body.app-shell .app-topbar-panel-wallet-row strong {
  color: var(--accent);
  font-size: 1.15rem;
}

body.app-shell .app-topbar-panel-wallet-actions {
  display: flex;
  gap: 0.55rem;
}

body.app-shell .app-topbar-panel-wallet-actions a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-size: 0.78rem;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 200, 0.28);
  color: var(--accent);
  background: rgba(0, 255, 200, 0.08);
}

body.app-shell .app-topbar-panel-wallet-actions a:last-child {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

body.app-shell .app-topbar-panel-links {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

body.app-shell .app-topbar-panel-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  padding: 0.5rem 0.45rem;
  border-radius: 8px;
}

body.app-shell .app-topbar-panel-links a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* Agent 页保留右上角用户区（与参考创作页一致） */
body.app-shell.studio-workbench-page .app-topbar {
  display: flex;
  flex-shrink: 0;
  background: rgba(5, 8, 16, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.04);
  min-height: 46px;
  padding: 0.35rem 1rem;
}

body.app-shell.studio-workbench-page .app-topbar-chip:not(.is-accent) {
  display: none;
}

@media (min-width: 1200px) {
  body.app-shell.studio-workbench-page .app-topbar-chip {
    display: inline-flex;
  }
}

body.app-shell .main-content {
  max-width: none;
  margin: 0;
  padding: var(--shell-pad-y) var(--shell-pad-x) 2.75rem;
  width: 100%;
  box-sizing: border-box;
}

body.app-shell.app-home-page .main-content {
  max-width: none;
  margin: 0;
  padding: 1rem var(--shell-pad-x) 3rem;
  width: 100%;
}

body.app-shell.app-home-page .app-topbar {
  padding-left: var(--shell-pad-x);
  padding-right: var(--shell-pad-x);
}

body.app-shell .main-content-studio {
  max-width: none;
  margin: 0;
  padding: 0.35rem 0.55rem 0.4rem;
}

body.app-shell .site-icp-footer {
  padding: 0.55rem 1rem 0.75rem;
  border-top-color: rgba(255, 255, 255, 0.06);
}

body.app-shell.studio-workbench-page .site-icp-footer,
body.app-shell.app-home-page .site-icp-footer {
  display: none;
}

body.app-shell.app-home-page .bg-grid,
body.app-shell.app-home-page .bg-glow {
  opacity: 0.18;
}

/* 收窄侧栏 */
body.app-shell.is-sidebar-collapsed .app-nav-label,
body.app-shell.is-sidebar-collapsed .app-nav-more-list {
  display: none;
}

body.app-shell.is-sidebar-collapsed .app-sidebar-body {
  padding: 0 0.65rem;
  align-items: center;
}

body.app-shell.is-sidebar-collapsed .app-nav-new,
body.app-shell.is-sidebar-collapsed .app-nav-item {
  justify-content: center;
  padding: 0;
  width: 2.25rem;
}

body.app-shell.is-sidebar-collapsed .app-sidebar-top {
  padding: 0.55rem 0 0;
  justify-content: center;
  height: auto;
  flex-direction: column;
  gap: 0.25rem;
}

body.app-shell.is-sidebar-collapsed .app-sidebar-collapse {
  position: static;
  transform: rotate(180deg);
  margin: 0 auto;
}

/* 首页：大横幅 + 创作入口 + 最近项目 + 底栏（拉满版心） */
.app-home {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.app-home-hero {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  min-height: 240px;
  background: #0a0e16;
}

.app-home-hero-track {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 5;
  min-height: 220px;
  max-height: min(38vh, 360px);
}

.app-home-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.app-home-hero-slide.is-on {
  opacity: 1;
  pointer-events: auto;
}

.app-home-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-home-hero-fallback {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(80% 120% at 80% 20%, rgba(0, 255, 200, 0.18), transparent 55%),
    linear-gradient(120deg, #0c1524, #070b12);
}

.app-home-hero-copy {
  position: absolute;
  left: 2rem;
  bottom: 1.6rem;
  max-width: min(560px, 72%);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.app-home-hero-copy h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.app-home-hero-copy p {
  margin: 0;
  color: rgba(232, 240, 255, 0.88);
  font-size: clamp(0.95rem, 1.15vw, 1.12rem);
  line-height: 1.45;
}

.app-home-hero-dots {
  position: absolute;
  right: 1.25rem;
  bottom: 1.1rem;
  display: flex;
  gap: 0.4rem;
}

.app-home-hero-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0;
}

.app-home-hero-dot.is-on {
  background: #fff;
}

.app-home-entries {
  display: grid;
  grid-template-columns: minmax(240px, 0.38fr) minmax(0, 0.62fr);
  gap: 1rem;
  min-height: 280px;
}

.app-home-stage {
  width: 100%;
  margin: 0;
  display: block;
}

.app-home-compose-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-sizing: border-box;
}

.app-home-prompt-composer {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: #1a1f28;
  overflow: visible;
  position: relative;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.app-home-prompt-composer > textarea {
  display: block;
  width: 100%;
  min-height: 5.5rem;
  max-height: 10rem;
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 1rem 1.1rem 0.35rem;
  line-height: 1.55;
  resize: none;
  color: #e8eef5;
  font: inherit;
  font-size: 0.98rem;
  margin: 0;
  outline: none;
}

.app-home-prompt-composer > textarea::placeholder {
  color: rgba(150, 166, 186, 0.72);
}

.app-home-composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem 0.55rem;
  min-height: 2.7rem;
  position: relative;
  overflow: visible;
}

.app-home-composer-tools {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}

.app-home-composer-tool-wrap {
  position: relative;
  flex: 0 0 auto;
}

.app-home-composer-icon-btn {
  appearance: none;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(200, 210, 225, 0.88);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.app-home-composer-icon-btn svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

.app-home-composer-icon-btn:hover,
.app-home-composer-icon-btn.is-on {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.06);
}

.app-home-composer-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.45rem);
  min-width: 14rem;
  max-width: min(22rem, 92vw);
  padding: 0.4rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1e2430;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  z-index: 60;
  display: none;
}

.app-home-composer-pop.is-open {
  display: block;
}

.app-home-composer-pop-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #e8eef6;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.app-home-composer-pop-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.app-home-composer-pop-item.is-on {
  background: rgba(46, 230, 166, 0.1);
}

.app-home-composer-pop-ico {
  width: 1.6rem;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.9;
}

.app-home-composer-pop-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.app-home-composer-pop-title {
  font-weight: 650;
  color: #f2f6fc;
}

.app-home-composer-pop-desc {
  font-size: 0.78rem;
  color: rgba(150, 166, 186, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-home-composer-pop-check {
  opacity: 0;
  color: var(--accent, #2ee6a6);
  flex-shrink: 0;
}

.app-home-composer-pop-item.is-on .app-home-composer-pop-check {
  opacity: 1;
}

.app-home-model-pop {
  min-width: 16rem;
}

.app-home-model-head {
  padding: 0.45rem 0.55rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: rgba(200, 212, 228, 0.95);
}

.app-home-model-tabs {
  display: flex;
  gap: 0.2rem;
  padding: 0 0.35rem 0.55rem;
}

.app-home-model-tab {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(180, 194, 214, 0.95);
  font: inherit;
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
}

.app-home-model-tab.is-on {
  background: rgba(46, 230, 166, 0.16);
  color: #2ee6a6;
}

.app-home-model-hint {
  margin: 0;
  padding: 0.35rem 0.55rem 0.55rem;
  font-size: 0.8rem;
  color: rgba(150, 166, 186, 0.9);
}

.app-home-skill-pop {
  min-width: 18rem;
  max-height: 20rem;
  overflow: hidden;
  display: none;
  flex-direction: column;
}

.app-home-skill-pop.is-open {
  display: flex;
}

.app-home-skill-pop-list {
  overflow-y: auto;
  max-height: 14rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.15rem;
}

.app-home-skill-pop-row {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.55rem;
  border-radius: 10px;
  cursor: pointer;
}

.app-home-skill-pop-row:hover,
.app-home-skill-pop-row.is-on {
  background: rgba(255, 255, 255, 0.06);
}

.app-home-skill-pop-more {
  display: block;
  padding: 0.55rem 0.65rem;
  color: var(--accent, #2ee6a6);
  text-decoration: none;
  font-size: 0.85rem;
}

.app-home-compose-send {
  appearance: none;
  border: none;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: rgba(200, 210, 224, 0.28);
  color: rgba(18, 22, 30, 0.55);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.app-home-compose-send.is-ready {
  background: var(--accent, #2ee6a6);
  color: #041018;
}

.app-home-compose-send.is-ready:hover {
  filter: brightness(1.06);
}

.app-home-skill-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  width: 100%;
}

.app-home-skill-scroll {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.05rem 0;
  scrollbar-width: thin;
}

/* legacy pill / textarea variants */
.app-home-compose-box,
.app-home-compose-bar,
.app-home-compose-tools,
.app-home-tool-btn,
.app-home-compose-pill,
.app-home-compose-plus {
  display: none !important;
}

.app-home-create {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 280px;
  border-radius: 18px;
  border: 0.5px solid rgba(0, 255, 200, 0.4);
  background:
    radial-gradient(circle at 20px 20px, rgba(255, 255, 255, 0.05) 1px, transparent 1.5px) 0 0 / 20px 20px,
    linear-gradient(180deg, rgba(4, 202, 246, 0.08), rgba(255, 255, 255, 0.03));
  color: inherit;
  cursor: pointer;
  appearance: none;
  font: inherit;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.app-home-create:hover {
  border-color: rgba(0, 255, 200, 0.65);
  transform: translateY(-1px);
}

.app-home-create-mark {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 18px;
  border: 1.5px solid rgba(44, 44, 44, 0.9);
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.88));
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.12);
}

.app-home-create-mark svg {
  width: 28px;
  height: 28px;
}

.app-home-create-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-home-caps {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.app-home-skill-chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  border-radius: 999px;
  padding: 0.35rem 0.85rem 0.35rem 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  flex: 0 0 auto;
  text-decoration: none;
  font: inherit;
  max-width: 16rem;
}

.app-home-skill-chip:hover,
.app-home-skill-chip.is-on {
  border-color: rgba(46, 230, 166, 0.35);
  background: rgba(46, 230, 166, 0.08);
}

.app-home-skill-avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  background: linear-gradient(145deg, #2ee6a6, #3aa0ff);
  color: #041018;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.app-home-skill-text {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.app-home-skill-text strong {
  font-size: 0.9rem;
  font-weight: 650;
  color: #f2f6fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 8.5rem;
}

.app-home-skill-text em {
  font-style: normal;
  font-size: 0.78rem;
  color: rgba(150, 166, 186, 0.9);
  white-space: nowrap;
}

.app-home-skill-more {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(200, 212, 228, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.app-home-skill-more:hover {
  border-color: rgba(46, 230, 166, 0.35);
  color: #2ee6a6;
}

.app-home-cap {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 128px;
  padding: 1.15rem 1.2rem;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.app-home-cap:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.app-home-cap-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.app-home-cap-ico {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.app-home-cap-ico svg {
  width: 22px;
  height: 22px;
}

.app-home-cap-name {
  font-size: 1.05rem;
  font-weight: 650;
}

.app-home-cap-tag {
  display: inline-flex;
  align-items: center;
  height: 1.25rem;
  padding: 0 0.42rem;
  border-radius: 5px;
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  color: var(--text-muted);
  font-size: 0.74rem;
}

.app-home-cap-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
  margin: 0;
}

.app-home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.app-home-section-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.app-home-section-head a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.app-home-section-head a:hover {
  color: var(--accent);
}

.app-home-recent-row {
  display: flex;
  gap: 1.15rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}

.app-home-project-card {
  flex: 0 0 220px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #161b24;
  min-height: 4.5rem;
  box-sizing: border-box;
}

.app-home-project-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: #1a2130;
}

.app-home-project-thumb {
  position: relative;
  width: 2.4rem;
  height: 2.4rem;
  flex-shrink: 0;
  aspect-ratio: auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: rgba(170, 184, 204, 0.85);
}

.app-home-project-cover {
  display: none;
}

.app-home-project-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.app-home-project-body strong {
  font-size: 1.02rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-home-project-body span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.app-home-gallery {
  margin-top: 1.35rem;
}

.app-home-gallery-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  margin-bottom: 1.05rem;
  min-width: 0;
}

.app-home-gallery-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  flex: 0 0 auto;
  white-space: nowrap;
}

.app-home-gallery-tabs {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-home-gallery-tabs::-webkit-scrollbar {
  display: none;
}

.app-home-gallery-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(160, 176, 196, 0.95);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

.app-home-gallery-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.app-home-gallery-tab.is-on {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.app-home-gallery-search {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 1 220px;
  min-width: 160px;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(160, 176, 196, 0.9);
}

.app-home-gallery-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.app-home-gallery-search input::placeholder {
  color: rgba(150, 166, 186, 0.75);
}

.app-home-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
}

.app-home-gallery-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.app-home-gallery-card.is-hidden {
  display: none;
}

.app-home-gallery-media {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #121820;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.app-home-gallery-overlay {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.85rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
  letter-spacing: 0.02em;
  pointer-events: none;
}

.app-home-gallery-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-home-gallery-ph {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #1a2230, #0d121a);
}

.app-home-gallery-meta {
  min-width: 0;
}

.app-home-gallery-user {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.app-home-gallery-meta p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 旧版底部悬浮输入条已弃用，首页改用 .app-home-compose-shell */
.app-home-composer {
  display: none !important;
}

/* Agent Skill plaza */
.app-agent {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.35rem 0 2.75rem;
}

.app-agent-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.35rem 0 2rem;
  text-align: center;
}

.app-agent-hero-title {
  margin: 0 0 1.65rem;
  font-size: clamp(1.55rem, 2.6vw, 1.95rem);
  font-weight: 650;
  line-height: 1.4;
  color: var(--text);
  letter-spacing: 0.01em;
}

.app-agent-hero-title span {
  color: var(--accent);
}

.app-agent-composer {
  width: min(1040px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.95rem 1.15rem 0.9rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(22, 28, 38, 0.96);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.app-agent-composer-label {
  display: block;
  margin: 0;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 500;
  color: rgba(150, 166, 186, 0.92);
  letter-spacing: 0.02em;
}

.app-agent-composer-input {
  width: 100%;
  min-height: 5.25rem;
  resize: vertical;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.55;
  outline: none;
}

.app-agent-composer-input::placeholder {
  color: rgba(150, 166, 186, 0.85);
}

.app-agent-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.app-agent-composer-hint {
  font-size: 0.88rem;
  color: var(--muted);
}

.app-agent-composer-send {
  appearance: none;
  border: none;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--accent);
  color: #041018;
  transition: filter 0.15s, opacity 0.15s;
}

.app-agent-composer-send:hover:not(:disabled) {
  filter: brightness(1.06);
}

.app-agent-composer-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.app-agent-composer-send.is-ready {
  opacity: 1;
}

.app-agent-plaza {
  margin-top: 0.5rem;
}

.app-agent-sticky {
  position: sticky;
  top: calc(var(--app-header-h, 52px) + 0.35rem);
  z-index: 20;
  padding: 0.35rem 0 0.85rem;
  background: linear-gradient(
    180deg,
    rgba(10, 14, 20, 0.98) 70%,
    rgba(10, 14, 20, 0)
  );
}

.app-agent-tabs {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.85rem;
}

.app-agent-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 1.18rem;
  font-weight: 650;
  color: rgba(150, 166, 186, 0.85);
}

.app-agent-tab:hover {
  color: var(--text);
}

.app-agent-tab.is-on {
  color: var(--text);
}

.app-agent-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.app-agent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
}

.app-agent-chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--muted);
  border-radius: 0.55rem;
  padding: 0.42rem 0.9rem;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
}

.app-agent-chip:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.app-agent-chip.is-on {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
}

.app-agent-search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: min(320px, 100%);
  height: 2.35rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.app-agent-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}

.app-agent-search input::placeholder {
  color: rgba(150, 166, 186, 0.8);
}

.app-agent-search-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  padding: 0;
  cursor: pointer;
}

.app-agent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.05rem;
}

.app-agent-card {
  position: relative;
  display: flex;
  gap: 0.85rem;
  min-height: 9rem;
  padding: 0.95rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(26, 32, 42, 0.92);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-agent-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.app-agent-card-cover {
  position: relative;
  width: 11rem;
  flex-shrink: 0;
  aspect-ratio: 16 / 10;
  border-radius: 0.65rem;
  overflow: hidden;
  background: linear-gradient(145deg, #1a3340 0%, #0f1a24 55%, #16352c 100%);
}

.app-agent-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-agent-card-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 1;
  padding: 0.2rem 0.45rem;
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.2;
}

.app-agent-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-right: 4.5rem;
}

.app-agent-card-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-agent-card-desc {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-agent-card-meta {
  margin-top: auto;
  padding-top: 0.55rem;
  font-size: 0.8rem;
  color: rgba(150, 166, 186, 0.9);
}

.app-agent-card-actions {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.app-agent-card:hover .app-agent-card-actions,
.app-agent-card:focus-within .app-agent-card-actions {
  opacity: 1;
}

.app-agent-fav {
  appearance: none;
  border: none;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
}

.app-agent-fav.is-on,
.app-agent-fav:hover {
  color: var(--accent);
}

.app-agent-use {
  appearance: none;
  border: none;
  height: 1.9rem;
  padding: 0 0.85rem;
  border-radius: 0.45rem;
  background: var(--text);
  color: #0a0e14;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}

.app-agent-use:hover {
  background: #fff;
}

.app-agent-empty,
.app-agent-end {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

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

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

@media (max-width: 768px) {
  .app-agent {
    padding: 0.25rem 0.85rem 2.5rem;
  }
  .app-agent-hero {
    padding: 1.25rem 0 1.25rem;
  }
  .app-agent-grid {
    grid-template-columns: 1fr;
  }
  .app-agent-card-cover {
    width: 7.5rem;
  }
  .app-agent-card-body {
    padding-right: 0;
  }
  .app-agent-card-actions {
    opacity: 1;
    position: static;
    margin-top: 0.45rem;
    justify-content: flex-end;
  }
  .app-agent-card {
    flex-wrap: wrap;
  }
  .app-agent-search {
    width: 100%;
  }
}

body.app-shell .projects-header h1 {
  font-size: 1.65rem;
}

@media (max-width: 1200px) {
  .app-home-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .app-home-entries {
    grid-template-columns: 1fr;
  }
  .app-home-caps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .app-home-create {
    min-height: 180px;
  }
  .app-home-hero-track {
    aspect-ratio: 16 / 5;
    max-height: none;
  }
}

@media (max-width: 900px) {
  body.app-shell .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    box-shadow: 16px 0 40px rgba(0, 0, 0, 0.5);
  }
  body.app-shell.is-sidebar-open .app-sidebar {
    transform: translateX(0);
  }
  body.app-shell .app-sidebar-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 0.75rem;
    top: 0.75rem;
    z-index: 25;
    appearance: none;
    border: 1px solid rgba(0, 255, 200, 0.28);
    background: rgba(8, 14, 26, 0.92);
    color: var(--accent);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
  }
  body.app-shell.is-sidebar-open .app-sidebar-fab {
    display: none;
  }
  body.app-shell .main-content {
    padding: 1rem 1.15rem 1.75rem;
  }
  body.app-shell.app-home-page .main-content {
    padding: 0.85rem 1.1rem 2.5rem;
  }
  body.app-shell .app-topbar {
    padding-left: 4.2rem;
  }
  body.app-shell.is-sidebar-collapsed .app-sidebar {
    width: var(--app-sidebar-w);
    flex-basis: var(--app-sidebar-w);
  }
  body.app-shell.is-sidebar-collapsed .app-nav-label {
    display: initial;
  }
  body.app-shell.is-sidebar-collapsed .app-nav-new,
  body.app-shell.is-sidebar-collapsed .app-nav-item {
    justify-content: flex-start;
    width: 100%;
    padding: 0 0.5rem;
  }
  body.app-shell.is-sidebar-collapsed .app-sidebar-collapse {
    display: inline-flex;
  }
  .app-home-stage {
    width: 100%;
  }
  .app-home-gallery-toolbar {
    gap: 0.55rem;
    flex-wrap: wrap;
  }
  .app-home-gallery-search {
    flex: 1 1 100%;
    max-width: none;
  }
  .app-home-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-home-caps {
    grid-template-columns: 1fr;
  }
  .app-home-gallery-grid {
    grid-template-columns: 1fr;
  }
  body.app-shell .app-topbar-name {
    display: none;
  }
}


.main-content {
  position: relative;
  z-index: 1;
  padding: 1.75rem var(--shell-pad-x, 2rem) 3rem;
  max-width: none;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  flex: 1 0 auto;
}

/* Auth */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-stack {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.change-password-card {
  margin: 0 auto;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 0 40px rgba(0, 255, 200, 0.08);
}

.auth-mp-panel {
  width: 100%;
  max-width: 420px;
  padding: 1rem 1rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid rgba(46, 230, 166, 0.22);
  background: linear-gradient(160deg, rgba(14, 28, 42, 0.96), rgba(8, 14, 26, 0.94));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.auth-mp-head {
  margin-bottom: 0.75rem;
}

.auth-mp-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #041018;
  background: linear-gradient(135deg, #2ee6a6, #3aa0ff);
}

.auth-mp-title {
  margin: 0.55rem 0 0.2rem;
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--text);
}

.auth-mp-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.auth-mp-banner {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 480px) {
  .auth-mp-panel {
    padding: 0.85rem;
  }
  .auth-mp-title {
    font-size: 0.92rem;
  }
}

.auth-card h1 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.auth-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.auth-tab.is-active {
  color: var(--text);
  background: rgba(0, 220, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 220, 255, 0.25);
}

.auth-panel.is-hidden { display: none; }

.form-hint {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-hint.is-error { color: #ff8f8f; }

.form-group.captcha-passed label::after {
  content: " · 已通过";
  color: #2ee6a6;
  font-weight: 500;
}
.form-group.captcha-passed input:disabled {
  opacity: 0.75;
  cursor: default;
}

.sms-send-btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 7.5rem;
  height: 52px;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-group input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
}

.remember-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 0;
}

.remember-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 255, 200, 0.15);
}

.captcha-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.captcha-row input { flex: 1; }

.captcha-img {
  height: 52px;
  width: auto;
  min-width: 120px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  object-fit: contain;
  background: #0c1223;
}

.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.35rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #00c9a0);
  color: #041018;
  font-weight: 600;
}

/* 登录后壳层页：主按钮勿默认撑满一行（管理台/列表/工具栏） */
body.app-shell .main-content .btn-primary,
body.app-shell .app-topbar .btn-primary,
body.app-shell .page-header .btn-primary {
  width: auto;
}

.auth-page .btn-primary,
.auth-stack .btn-primary {
  width: 100%;
}

.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-secondary {
  background: rgba(0, 220, 255, 0.1);
  border: 1px solid rgba(0, 220, 255, 0.35);
  color: var(--accent2);
}

.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.94rem; font-weight: var(--fw-ui); }

.btn-danger { background: var(--danger); color: #fff; }

.btn-success { background: rgba(0, 230, 118, 0.2); border: 1px solid var(--success); color: var(--success); }

.auth-links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
}

.auth-links a { color: var(--accent2); text-decoration: none; }

.legal-agree-row {
  margin: 0.25rem 0 0.75rem;
}

.legal-agree-label {
  align-items: flex-start;
  line-height: 1.55;
}

.legal-agree-label a {
  color: var(--accent2);
  text-decoration: underline;
}

.legal-agree-label a:hover {
  color: var(--accent);
}

.legal-page .legal-document-card {
  max-width: 760px;
  width: 100%;
  text-align: left;
}

.legal-document-meta {
  margin-top: -0.75rem;
}

.legal-document-body {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.75;
  max-height: min(70vh, 640px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.legal-document-body h1,
.legal-document-body h2,
.legal-document-body h3 {
  color: var(--text);
  margin: 1.25rem 0 0.65rem;
  font-size: 1rem;
}

.legal-document-body p,
.legal-document-body li {
  color: var(--text-muted);
}

.legal-document-body a {
  color: var(--accent2);
}

.legal-document-back {
  margin-top: 1.5rem;
}

.site-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.78rem;
}

.site-legal-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-legal-links a:hover {
  color: var(--accent2);
}

.site-footer-sep {
  color: var(--text-muted);
  opacity: 0.55;
  user-select: none;
}

.flash-container { margin-bottom: 1rem; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.flash-error { background: rgba(255, 77, 109, 0.15); border: 1px solid var(--danger); }
.flash-success { background: rgba(0, 230, 118, 0.12); border: 1px solid var(--success); }
.flash-info { background: rgba(61, 139, 255, 0.12); border: 1px solid var(--accent2); }

/* Dashboard */
.page-header { margin-bottom: 2.25rem; }

.page-header h1 { font-size: 1.95rem; margin-bottom: 0.55rem; letter-spacing: -0.02em; }

.page-header p { color: var(--text-muted); font-size: 1.02rem; line-height: 1.55; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.45rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(0, 255, 200, 0.1);
}

.card h3 { margin-bottom: 0.5rem; }

.card-meta { font-size: 0.85rem; color: var(--text-muted); }

.hero-actions { margin-top: 1.5rem; display: flex; gap: 1rem; flex-wrap: wrap; }

/* Workflow */
.workflow-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; min-height: calc(100vh - 120px); }

.step-sidebar {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.project-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.project-actions .btn {
  width: 100%;
}

.sidebar-model {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.sidebar-model label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-model-name {
  margin: 0.25rem 0 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent, #3dd6c6);
}

.sidebar-select {
  width: 100%;
  margin-top: 0.25rem;
}

.model-step-hint {
  margin: 0.75rem 0 1rem;
}

.workflow-progress {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 255, 200, 0.35);
  background: rgba(0, 255, 200, 0.06);
  animation: progress-fade-in 0.25s ease;
  max-width: 100%;
}

.workflow-progress.hidden {
  display: none;
}

.workflow-progress:not(.hidden) {
  position: sticky;
  top: 0.75rem;
  z-index: 30;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
}

.workflow-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

#workflow-progress-pct {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  opacity: 0.9;
}

.workflow-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.workflow-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00c896, var(--accent), #7affec);
  background-size: 200% 100%;
  transition: width 0.6s ease;
  animation: progress-shimmer 1.8s linear infinite;
  box-shadow: 0 0 12px rgba(0, 255, 200, 0.45);
}

.workflow-progress-hint {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.parse-episode-plan-panel {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 255, 200, 0.15);
}

.parse-episode-plan-panel.hidden {
  display: none;
}

.parse-episode-plan-summary {
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
}

.parse-episode-plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.parse-episode-plan-list li {
  display: flex;
  gap: 0.35rem;
  align-items: baseline;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.parse-episode-plan-list li.is-active {
  background: rgba(0, 255, 200, 0.12);
  color: var(--accent);
}

.parse-episode-plan-list .ep-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.episode-plan-panel {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 255, 200, 0.22);
  background: rgba(0, 0, 0, 0.18);
}

.episode-plan-panel.hidden {
  display: none;
}

.episode-plan-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.episode-plan-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.65rem 0;
}

.episode-plan-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.episode-plan-item.is-parsed {
  opacity: 0.82;
}

.episode-plan-item-body {
  flex: 1;
  min-width: 0;
}

.episode-plan-item-title {
  font-weight: 600;
  font-size: 0.88rem;
}

.episode-plan-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.episode-plan-actions {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
  align-items: center;
}

.episode-plan-item .episode-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  min-width: 5.5rem;
  padding: 0.4rem 0.85rem;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #00c9a0);
  color: #041018;
}

.episode-plan-item .episode-parse-dl-btn {
  background: transparent;
  color: var(--accent, #2dd4bf);
  border: 1px solid rgba(45, 212, 191, 0.55);
  box-shadow: none;
}

.episode-plan-item .episode-parse-dl-btn:hover {
  background: rgba(45, 212, 191, 0.12);
}

.episode-workflow-card {
  margin-top: 0.75rem;
}

.episode-workflow-card .episode-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.65rem;
  min-width: 6.75rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  width: auto !important;
  max-width: none;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #00c9a0);
  color: #041018;
  transition: filter 0.2s, transform 0.2s;
}

.episode-workflow-card .episode-action-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.episode-workflow-card .episode-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.episode-step-toolbar {
  display: flex;
  margin-bottom: 0.65rem;
}

.episode-step-toolbar .episode-action-btn {
  width: 100% !important;
  min-height: 2.85rem;
  font-size: 0.92rem;
}

.episode-action-btn .episode-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.18);
}

.episode-action-btn.is-loading {
  opacity: 0.72;
  cursor: wait;
}

.episode-plan-hint {
  margin: 0 0 0.5rem;
}

.episode-plan-hint.is-error {
  color: #ffb4b4;
}

.episode-plan-hint.is-ok {
  color: #7dffd9;
}

.episode-plan-hint.is-busy {
  color: var(--accent);
}

.episode-workflow-summary {
  margin: 0 0 0.5rem;
}

.episode-plan-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.episode-status-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
  white-space: nowrap;
}

.episode-status-badge.is-done {
  border-color: rgba(0, 255, 200, 0.35);
  color: #7dffd9;
}

.step2-generate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.step2-gen-block .param-card-title {
  margin-bottom: 0.35rem;
}

.step2-asset-plan {
  margin: 0.55rem 0 0.85rem;
  max-height: 280px;
  overflow: auto;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.step2-asset-plan-head {
  font-size: 0.82rem;
  color: var(--muted, #a8b4c0);
  margin-bottom: 0.45rem;
}

.step2-asset-plan-section h5 {
  margin: 0.55rem 0 0.3rem;
  font-size: 0.86rem;
}

.step2-asset-plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.step2-asset-plan-item {
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.step2-asset-plan-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.step2-asset-plan-main strong {
  font-size: 0.88rem;
  font-weight: 600;
}

.step2-asset-status {
  flex: 0 0 auto;
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.step2-asset-status.is-pending {
  color: #e0b35a;
  border-color: rgba(224, 179, 90, 0.45);
}

.step2-asset-status.is-ok {
  color: #5dcea2;
  border-color: rgba(93, 206, 162, 0.4);
}

.step2-asset-status.is-bad {
  color: #e57373;
  border-color: rgba(229, 115, 115, 0.4);
}

.step2-asset-aliases,
.step2-asset-summary,
.step2-asset-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.76rem;
  color: var(--muted, #9aabba);
  line-height: 1.35;
}

.step2-asset-note {
  color: #e0b35a;
}

.episode-asset-group {
  margin: 0.65rem 0 1rem;
}

.episode-asset-group-title {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.episode-asset-badge {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 255, 200, 0.12);
  color: #9bffe8;
  vertical-align: middle;
}

.workflow-progress-actions {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#btn-cancel-parse:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#btn-cancel-parse.parse-cancel-active:not(:disabled) {
  opacity: 1;
  font-weight: 600;
}

.workflow-progress-actions.hidden {
  display: none;
}

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

@keyframes progress-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.step-item.active {
  background: rgba(0, 255, 200, 0.08);
  border-color: var(--accent);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(61, 139, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-item.active .step-num { background: var(--accent); color: #041018; }

.step-item.done .step-num { background: var(--success); color: #041018; }

.workflow-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.panel-title { font-size: 1.25rem; margin-bottom: 0.5rem; }

.panel-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: rgba(61, 139, 255, 0.08);
  border-left: 3px solid var(--accent2);
  border-radius: 0 6px 6px 0;
}

.result-block { margin-top: 1.5rem; }

.result-block h4 {
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.info-cell {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.info-cell .label { font-size: 0.75rem; color: var(--text-muted); }
.info-cell .value { font-size: 0.9rem; margin-top: 0.25rem; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tag {
  padding: 0.35rem 0.65rem;
  background: rgba(0, 255, 200, 0.1);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.preview-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.preview-card img,
.preview-card video {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

/* 角色定妆为三视图横版，不能用 cover 裁切 */
.preview-card.character .character-preview-media img,
.preview-card.character .character-preview-media video {
  aspect-ratio: unset;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: left top;
  background: #0a0c10;
}

.preview-card.scene img,
.preview-card.scene video { aspect-ratio: 16/9; }

.preview-grid-characters {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
}

.character-preview-media {
  display: block;
  width: 100%;
  overflow: auto;
  background: #0a0c10;
  cursor: zoom-in;
}

.image-preview-dialog {
  margin: auto;
  max-width: min(1280px, 98vw);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  background: var(--surface, #121820);
  color: var(--text);
}

.image-preview-form {
  padding: 0.85rem 1rem 1rem;
}

.image-preview-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.image-preview-header .prompt-edit-title {
  margin: 0;
  flex: 1 1 200px;
}

.image-preview-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.image-preview-stage {
  width: 100%;
  max-height: min(78vh, 820px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a0c10;
}

.image-preview-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.preview-card-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed var(--border);
}

.preview-card-failed {
  border: 1px dashed rgba(255, 120, 120, 0.45);
  background: rgba(80, 20, 20, 0.2);
}

.preview-card-failed .failed-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  color: #ff9a9a;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.2);
}

.preview-card-failed .error-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #ffcc88;
  line-height: 1.35;
  max-height: 3.2em;
  overflow: hidden;
}

.prompt-edit-dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  max-width: min(720px, 92vw);
  width: 100%;
  background: var(--surface, #121820);
  color: var(--text);
  margin: auto;
}

.prompt-edit-dialog[open] {
  display: flex;
  flex-direction: column;
}

.prompt-edit-dialog.is-workshop {
  width: min(1480px, 98vw);
  max-width: 98vw;
  height: min(96vh, 1100px);
  max-height: 96vh;
  margin: 2vh auto;
}

.prompt-edit-dialog.is-workshop .prompt-edit-form {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 0;
}

.prompt-edit-dialog.is-workshop .prompt-edit-textarea {
  min-height: 0;
  max-height: none;
  margin: 0.35rem 0 0;
  resize: vertical;
}

.prompt-edit-dialog.is-workshop .prompt-edit-source {
  min-height: 0;
  max-height: none;
  resize: none;
}

.prompt-edit-dialog.is-workshop .prompt-edit-toolbar {
  margin: 0 0 0.45rem;
}

.prompt-edit-dialog.is-workshop .prompt-edit-chat-log {
  min-height: 100px;
  max-height: min(28vh, 280px);
}

.prompt-edit-dialog.is-workshop .prompt-edit-duration {
  margin: 0 0 0.2rem;
}

.prompt-edit-dialog.is-workshop .prompt-edit-counter {
  margin: 0 0 0.45rem;
}

.prompt-edit-dialog.is-workshop .prompt-edit-workshop {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(420px, 1.2fr);
  gap: 0.75rem;
  align-items: stretch;
  overflow: hidden;
  padding: 0 1.1rem 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
}

.prompt-edit-dialog.is-workshop .prompt-edit-ops {
  position: static;
  z-index: auto;
  overflow: auto;
  min-height: 0;
  margin: 0;
  padding: 0.2rem 0.65rem 0.35rem 0;
  border-bottom: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

.prompt-edit-dialog.is-workshop .prompt-edit-refs {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.prompt-edit-dialog.is-workshop .prompt-edit-workshop-grid {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.prompt-edit-dialog.is-workshop .prompt-edit-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.prompt-edit-dialog.is-workshop .prompt-edit-panel .prompt-edit-textarea {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.prompt-edit-dialog.is-workshop .prompt-edit-top {
  padding: 0.85rem 1.1rem 0.25rem;
}

.prompt-edit-dialog.is-workshop .prompt-edit-footer {
  padding: 0.45rem 1.1rem 0.75rem;
}

@media (max-width: 1100px) {
  .prompt-edit-dialog.is-workshop .prompt-edit-workshop {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 0.48fr) minmax(180px, 0.52fr);
  }

  .prompt-edit-dialog.is-workshop .prompt-edit-refs {
    order: -1;
  }

  .prompt-edit-dialog.is-workshop .prompt-edit-ops {
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.45rem 0 0.2rem;
  }

  .prompt-edit-dialog.is-workshop .prompt-edit-workshop-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .prompt-edit-dialog.is-workshop .prompt-edit-workshop-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, 1fr) minmax(140px, 1.1fr);
  }
}

.prompt-edit-top {
  flex: 0 0 auto;
  padding: 1.1rem 1.35rem 0.35rem;
}

.prompt-edit-progress {
  margin: 0.55rem 0 0.25rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 200, 0.4);
  background: rgba(0, 255, 200, 0.08);
}

.prompt-edit-progress.hidden {
  display: none;
}

.prompt-edit-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent, #5dcea2);
}

#prompt-edit-progress-pct {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--muted, #a8b4c0);
}

.prompt-edit-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.prompt-edit-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2bb673, #5dcea2, #7ef0c8);
  transition: width 0.25s ease;
}

.prompt-edit-workshop {
  flex: 1 1 auto;
  overflow: auto;
  padding: 0 1.35rem;
  min-height: 0;
}

.prompt-edit-ops {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0.35rem 0 0.55rem;
  margin-bottom: 0.35rem;
  background: linear-gradient(
    to bottom,
    var(--surface, #121820) 70%,
    rgba(18, 24, 32, 0.92)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.prompt-edit-refs {
  margin: 0.35rem 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.65rem 0.65rem;
  background: rgba(0, 0, 0, 0.14);
}

.prompt-edit-refs-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.1rem 0.05rem 0.15rem;
}

.prompt-edit-refs-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text, #e8eef4);
}

.prompt-edit-refs-summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.35rem 0.15rem;
  color: var(--muted, #a8b4c0);
  list-style: none;
}

.prompt-edit-refs-summary::-webkit-details-marker {
  display: none;
}

.prompt-edit-refs-summary::before {
  content: "▸ ";
  color: #5dcea2;
}

.prompt-edit-refs[open] > .prompt-edit-refs-summary::before {
  content: "▾ ";
}

.prompt-edit-footer {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding: 0.55rem 1.35rem 0.95rem;
  background: linear-gradient(
    to top,
    var(--surface, #121820) 75%,
    rgba(18, 24, 32, 0.94)
  );
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -8px 18px rgba(0, 0, 0, 0.25);
}

.prompt-edit-workshop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.prompt-edit-workshop-grid.is-single,
.prompt-edit-workshop-grid:has(#prompt-edit-source-panel[hidden]) {
  grid-template-columns: 1fr;
}

@media (max-width: 860px) {
  .prompt-edit-workshop-grid {
    grid-template-columns: 1fr;
  }
}

.prompt-edit-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem 0.75rem;
  background: rgba(0, 0, 0, 0.18);
}

.prompt-edit-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.prompt-edit-panel-head h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.btn-tiny {
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1.3;
}

.prompt-edit-source {
  min-height: 140px;
  max-height: 220px;
  background: rgba(0, 0, 0, 0.32);
  color: var(--muted, #b7c2cc);
}

.prompt-edit-alias-panel {
  margin: 0.45rem 0 0;
}

.prompt-edit-alias-hint {
  margin: 0;
  font-size: 0.78rem;
}

.prompt-edit-alias-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.prompt-edit-alias-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}

.prompt-edit-alias-result {
  font-size: 0.9rem;
  line-height: 1.45;
  min-height: 1.4em;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.prompt-edit-alias-result.is-miss {
  color: #e57373;
}

.prompt-edit-alias-result.is-hit {
  color: #5dcea2;
}

.prompt-edit-alias-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 88px;
  overflow: auto;
}

.prompt-edit-alias-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted, #b7c2cc);
  font-size: 0.78rem;
  cursor: pointer;
}

.prompt-edit-alias-chip:hover {
  border-color: #5dcea2;
  color: var(--text);
}

.prompt-edit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.75rem 0;
}

.prompt-edit-qc-panel {
  margin-bottom: 0.75rem;
}

.prompt-edit-qc-body {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

.prompt-edit-qc-score {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 0.35rem;
}

.prompt-edit-qc-score.is-good {
  color: #5dcea2;
}

.prompt-edit-qc-score.is-mid {
  color: #e0b35a;
}

.prompt-edit-qc-score.is-bad {
  color: #e57373;
}

.prompt-edit-chat-panel {
  margin-bottom: 0.5rem;
}

.prompt-edit-chat-log {
  min-height: 140px;
  max-height: 220px;
  overflow: auto;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
  margin-bottom: 0.55rem;
}

.prompt-edit-chat-msg {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.prompt-edit-chat-msg strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted, #8899aa);
}

.prompt-edit-chat-msg.is-user strong {
  color: #7eb8ff;
}

.prompt-edit-chat-msg.is-assistant strong {
  color: #5dcea2;
}

.prompt-edit-chat-compose {
  display: grid;
  gap: 0.45rem;
}

.prompt-edit-chat-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.4;
  resize: vertical;
}

.prompt-edit-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.baseline-grid-editor-dialog {
  margin: auto;
  max-width: min(1280px, 98vw);
}

.baseline-grid-editor-form {
  max-height: min(92vh, 960px);
  overflow: auto;
}

.baseline-grid-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}

.baseline-grid-editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.baseline-grid-editor-tabs .is-active {
  border-color: #e44;
  color: #f88;
}

.baseline-grid-editor-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.baseline-grid-editor-toolbar-actions .btn {
  width: auto;
  min-width: 6.5rem;
  font-weight: 600;
  opacity: 1;
}

.baseline-grid-editor-toolbar-actions .btn-secondary {
  background: #243044;
  border: 1.5px solid #7eb6ff;
  color: #f0f6ff;
}

.baseline-grid-editor-toolbar-actions .btn-danger-outline {
  background: #3a1c1c;
  border: 1.5px solid #ef4444;
  color: #ffe0e0;
}

.baseline-grid-editor-toolbar-actions .baseline-grid-editor-btn-cancel {
  background: #2a3140;
  border: 1.5px solid #8b93a7;
  color: #e8eaed;
}

.baseline-grid-editor-toolbar-actions .baseline-grid-editor-btn-save {
  width: auto;
  min-width: 7rem;
  box-shadow: 0 0 0 1px rgba(46, 230, 166, 0.35);
}

.baseline-grid-editor-stage {
  position: relative;
  width: 100%;
  max-height: min(70vh, 720px);
  min-height: 120px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a0c10;
  touch-action: none;
  cursor: crosshair;
}

.baseline-grid-editor-canvas {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
}

.baseline-grid-editor-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--muted, #8899aa);
  font-size: 0.92rem;
  background: rgba(10, 12, 16, 0.72);
}

.baseline-grid-editor-loading.hidden,
.baseline-grid-editor-img.is-hidden {
  display: none;
}

.baseline-grid-editor-img.is-loading {
  opacity: 0.4;
  filter: blur(1px);
}

.baseline-grid-editor-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.baseline-grid-editor-svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.shot-prev-frame-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0.5rem 0 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.shot-prev-frame-thumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.shot-prev-frame-thumb img {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #111;
}

.shot-prev-frame-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.shot-prev-frame-status {
  font-size: 0.78rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

.shot-prev-ready {
  color: #8dffb0;
  background: rgba(40, 120, 70, 0.25);
}

.shot-prev-pending {
  color: #ffcc88;
  background: rgba(120, 90, 40, 0.25);
}

.prompt-edit-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.prompt-edit-form {
  padding: 1.25rem 1.35rem 1rem;
  margin: 0;
}

.prompt-edit-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.char-upload-label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.char-upload-select,
.char-upload-file {
  width: 100%;
  margin-bottom: 0.25rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.prompt-edit-textarea {
  width: 100%;
  min-height: 220px;
  margin: 0.75rem 0 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  resize: vertical;
}

.prompt-edit-duration {
  margin: -0.5rem 0 0.35rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.prompt-edit-counter.text-danger {
  color: #ff6b6b;
}

.shot-duration-badge {
  color: #7ec8ff;
  font-weight: 500;
}

.prompt-edit-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.prompt-edit-actions-right {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

.prompt-edit-deepseek-btn:not([hidden]) {
  flex-shrink: 0;
}

.preview-card .caption {
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
}

.episode-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }

.ep-tab {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.ep-tab.active { background: var(--accent); color: #041018; border-color: var(--accent); }

.shot-list { display: flex; flex-direction: column; gap: 1rem; }

.shot-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}

.shot-pagination .pagination-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 10rem;
  text-align: center;
}

.shot-pagination .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.shot-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.shot-item.shot-failed {
  border-color: rgba(255, 100, 100, 0.45);
  background: rgba(255, 60, 60, 0.06);
}

.shot-item.shot-highlight {
  box-shadow: 0 0 0 2px var(--accent, #3dd6c6);
  transition: box-shadow 0.3s ease;
}

.shot-item video {
  width: 100%;
  max-height: 160px;
  border-radius: 6px;
  background: #000;
}

.storyboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.shot-candidate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.shot-candidate-card {
  width: 140px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.25);
}

.shot-candidate-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.shot-candidate-card video {
  width: 100%;
  max-height: 90px;
  border-radius: 4px;
  background: #000;
}

.shot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.shot-compose-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0.35rem 0 0.5rem;
}

.shot-compose-pick {
  margin: 0;
  flex: 0 0 auto;
}

.shot-trim-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  flex: 1 1 auto;
}

.shot-trim-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.trim-frames-input {
  width: 3.25rem;
  padding: 0.2rem 0.35rem;
  font-size: 0.85rem;
  border-radius: 4px;
  border: 1px solid rgba(140, 200, 220, 0.35);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  text-align: center;
}

.trim-frames-input:focus {
  outline: none;
  border-color: rgba(120, 220, 200, 0.65);
}

.shot-trim-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.shot-status-none { color: var(--text-muted); }
.shot-status-success { color: #8fecd0; }
.shot-status-pending-regen { color: #e0b35a; }
.shot-pending-regen-hint { color: #e0b35a !important; margin: 0.25rem 0 0.15rem !important; }
.shot-item.shot-pending-regen {
  border-color: rgba(224, 179, 90, 0.45);
}
.shot-status-failed { color: #ffaaaa; }

.shot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  border-radius: 6px;
  border: 1px dashed rgba(255, 100, 100, 0.5);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem;
}

.shot-badge-fail {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 80, 80, 0.25);
  color: #ffaaaa;
  vertical-align: middle;
}

.download-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.preview-card .card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem 0.65rem;
}

.preview-card .card-actions-wrap {
  gap: 0.3rem;
}

.preview-card .card-actions-wrap .btn {
  flex: 1 1 auto;
  min-width: 4.5rem;
}

.preview-card .btn-upload-replace {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.preview-details {
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.preview-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}

.preview-text {
  white-space: pre-wrap;
  font-size: 0.85rem;
  max-height: 240px;
  overflow: auto;
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}

.preview-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

.preview-shot {
  margin: 0.35rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.episode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.episode-tab {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
}

.episode-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 220, 200, 0.08);
}

.btn-regenerate-shot {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface, #0f1a22);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.modal-card-warn {
  border-color: rgba(255, 180, 80, 0.45);
}

.fail-shot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.fail-shot-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.82rem;
  background: rgba(255, 80, 80, 0.2);
  color: #ffaaaa;
  border: 1px solid rgba(255, 100, 100, 0.4);
}

.modal-tip-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.modal-tip-list li + li {
  margin-top: 0.35rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.candidate-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.candidate-item video {
  width: 100%;
  border-radius: 6px;
  background: #000;
}

.shot-badge-ok {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(80, 200, 160, 0.2);
  color: #8fecd0;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .workflow-layout { grid-template-columns: 1fr; }
  .shot-item { grid-template-columns: 1fr; }
}

.loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

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

.hidden { display: none !important; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data-table th,
table.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data-table th { color: var(--text-muted); font-weight: 500; }

.wallet-balance-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.table-actions form {
  margin: 0;
  display: inline;
}

.btn-danger-outline {
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn-danger-outline:hover {
  background: rgba(255, 82, 82, 0.12);
}

.search-bar { display: flex; gap: 0.75rem; margin-bottom: 1rem; }

.search-bar input {
  flex: 1;
  max-width: 320px;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.ids-box {
  font-family: monospace;
  font-size: 0.85rem;
  padding: 0.75rem;
  background: rgba(0, 255, 200, 0.06);
  border: 1px dashed var(--accent);
  border-radius: 6px;
  margin: 1rem 0;
  word-break: break-all;
}

.param-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.param-card-title {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  color: var(--accent);
}

.param-card-title small {
  color: var(--text-muted);
  font-weight: normal;
  margin-left: 0.35rem;
}

.session-ids-card {
  margin-bottom: 1.25rem;
  border-color: rgba(0, 255, 200, 0.35);
  background: rgba(0, 255, 200, 0.04);
}

.param-grid {
  display: grid;
  gap: 0.85rem 1rem;
}

.param-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.param-grid.cols-3 { grid-template-columns: 2fr 1fr; }

.param-grid .span-2 { grid-column: span 2; }

@media (max-width: 768px) {
  .param-grid.cols-2,
  .param-grid.cols-3 { grid-template-columns: 1fr; }
  .param-grid .span-2 { grid-column: span 1; }
}

.workflow-panel select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.workflow-panel select option {
  background: #152238;
  color: #e8f4ff;
}

.radio-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

.radio-row label { cursor: pointer; }

.req { color: #ff6b8a; font-size: 0.75rem; }
.opt { color: var(--text-muted); font-size: 0.75rem; }
.mt-sm { margin-top: 0.5rem; }

.step-panel .btn-primary { margin-top: 0.25rem; }

.project-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.project-status.is-ok { color: var(--success); }

.status-banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.status-banner.status-ok {
  background: rgba(0, 255, 160, 0.1);
  border: 1px solid rgba(0, 255, 160, 0.35);
  color: var(--success);
}

.status-banner.status-warn {
  background: rgba(255, 180, 60, 0.1);
  border: 1px solid rgba(255, 180, 60, 0.35);
  color: #ffc870;
}

.step2-redgrid-steps {
  display: block;
  margin-top: 0.45rem;
  opacity: 0.92;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s;
}

.choice-chip:has(input:checked) {
  border-color: var(--accent);
  background: rgba(0, 255, 200, 0.1);
}

.choice-chip input { accent-color: var(--accent); }

.advanced-details {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.advanced-details summary {
  cursor: pointer;
  color: var(--accent2);
  user-select: none;
}

.advanced-details[open] summary { margin-bottom: 0.25rem; }

.field-hint {
  margin-top: 0.35rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  font-family: monospace;
  word-break: break-all;
}

.param-card code {
  font-size: 0.8rem;
  color: var(--accent2);
}


/* 项目页：卡片网格 */
body.app-projects-page .main-content {
  padding-top: 1.15rem;
}
.proj-page {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.45rem;
}
.proj-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.proj-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.proj-toolbar-left h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.proj-back {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.98rem;
}
.proj-back:hover { color: var(--accent); }
.proj-toolbar-sep {
  color: rgba(255,255,255,0.18);
}
.proj-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.proj-search {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.45rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  min-width: min(340px, 70vw);
}
.proj-search-ico { color: var(--text-muted); display: inline-flex; }
.proj-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  outline: none;
}
.proj-search input::placeholder { color: rgba(150,166,186,0.85); }
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.35rem 1.2rem;
}
.proj-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  color: inherit;
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  min-width: 0;
}
.proj-card-thumb {
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: rgba(180,198,220,0.75);
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.proj-card-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  display: block;
}
.proj-card-cover.is-missing {
  display: none;
}
.proj-card-ph {
  position: relative;
  z-index: 0;
  flex-shrink: 0;
}
.proj-card:hover .proj-card-thumb {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}
.proj-card-thumb-create {
  border-style: solid;
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
}
.proj-card-plus {
  font-size: 2.1rem;
  line-height: 1;
  color: rgba(220,230,245,0.9);
  font-weight: 300;
}
.proj-card-create-label {
  font-size: 1.05rem;
  color: rgba(220,230,245,0.92);
  font-weight: 550;
}
.proj-card-meta strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 550;
  color: var(--text-muted);
}
.proj-card-meta-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.proj-card-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 1.02rem;
}
.proj-card-title:hover { color: var(--accent); }
.proj-card-date {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.proj-card-more {
  position: relative;
  flex-shrink: 0;
}
.proj-card-more-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.proj-card-more-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.proj-card-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  min-width: 8.5rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #101826;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.proj-card-menu[hidden] { display: none !important; }
.proj-card-menu a,
.proj-card-menu button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
}
.proj-card-menu a:hover,
.proj-card-menu button:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.proj-card-menu .btn-delete-project-row:hover {
  color: var(--danger);
}
.proj-end {
  text-align: center;
  color: rgba(139,163,199,0.55);
  font-size: 0.82rem;
  margin: 0.5rem 0 1rem;
}
.proj-pagination {
  margin-top: 0.5rem;
}
@media (max-width: 640px) {
  .proj-search { min-width: 100%; }
  .proj-toolbar-right { width: 100%; }
}

.projects-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.projects-panel {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}

.projects-table {
  margin: 0;
}

.projects-table th {
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.82rem;
}

.projects-table td {
  vertical-align: middle;
}

.projects-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.projects-actions .btn {
  width: auto;
  flex-shrink: 0;
}

.project-title-text {
  cursor: pointer;
}

.project-title-text:hover {
  color: var(--accent2, #7ee8d8);
}

.mono-muted {
  font-family: monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.08);
}

.status-pill.status-completed,
.status-pill.status-storyboard_ready {
  background: rgba(0, 200, 160, 0.15);
  color: #8fecd0;
}

.status-pill.status-parsed,
.status-pill.status-images_ready {
  background: rgba(100, 180, 255, 0.12);
  color: #a8d4ff;
}

.empty-projects {
  padding: 3rem 2rem;
  text-align: center;
}

.empty-projects h3 {
  margin: 0 0 0.5rem;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.pagination-info {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination-per-page {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

.pagination-per-page select {
  padding: 0.35rem 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: inherit;
}

.btn.disabled,
.btn.disabled:hover {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

.site-icp-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  flex: 0 0 auto;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  padding: 1rem 1.5rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(0, 255, 200, 0.1);
  box-sizing: border-box;
}

.site-icp-line {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.site-icp-footer a {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.site-icp-footer a:hover {
  color: var(--accent);
}

.auth-body .site-icp-footer {
  border-top: none;
  padding-top: 0.5rem;
}

@media (max-width: 900px) {
  .projects-table thead {
    display: none;
  }
  .projects-table tr {
    display: block;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }
  .projects-table td {
    display: block;
    border: none;
    padding: 0.25rem 0;
  }
  .projects-actions {
    justify-content: flex-start;
    margin-top: 0.75rem;
    flex-wrap: wrap;
  }
}

/* 顺鸽品牌输入/确认弹窗（替代浏览器原生 prompt/confirm） */
.app-dialog {
  margin: auto;
  width: min(520px, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid rgba(0, 255, 200, 0.22);
  border-radius: 18px;
  background: linear-gradient(165deg, #121a22 0%, #0b1016 100%);
  color: var(--text, #e8eef5);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 28px 72px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(0, 255, 200, 0.08);
}
.app-dialog::backdrop {
  background: rgba(4, 10, 16, 0.72);
  backdrop-filter: blur(4px);
}
.app-dialog-inner {
  padding: 1.4rem 1.5rem 1.35rem;
}
.app-dialog-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.95rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent, #00ffc8);
}
.app-dialog-brand-icon {
  width: 1.45rem;
  height: 1.45rem;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  border-radius: 4px;
}
.app-dialog-title {
  margin: 0 0 0.5rem;
  font-size: 1.22rem;
  font-weight: 700;
  color: #f2f7fb;
  line-height: 1.35;
}
.app-dialog-desc {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  line-height: 1.5;
  color: rgba(232, 238, 245, 0.72);
  white-space: pre-wrap;
}
.app-dialog-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.35rem;
  padding: 0.82rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: #f2f7fb;
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.app-dialog-input:focus {
  border-color: rgba(0, 255, 200, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 255, 200, 0.12);
}
.app-dialog-input::placeholder {
  color: rgba(232, 238, 245, 0.35);
}
.app-dialog-error {
  min-height: 1.2rem;
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #ff8e8e;
}
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.app-dialog-actions .btn {
  min-width: 5.8rem;
  min-height: 2.5rem;
  font-size: 0.98rem;
  border-radius: 12px;
}

/* ===== 全站可读性：标题 / 表单 / 管理台 ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-title);
}

label, th, button, .btn, summary {
  font-weight: var(--fw-ui);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  font-weight: var(--fw-body);
}

body.ops-admin-page,
body.billing-admin-page,
body.marketing-admin-page,
body.legal-admin-page {
  font-size: 1.03rem;
}

body.ops-admin-page table,
body.billing-admin-page table,
body.marketing-admin-page table {
  font-size: 1rem;
}

body.ops-admin-page th,
body.billing-admin-page th,
body.marketing-admin-page th {
  font-weight: var(--fw-title);
}
