/*
 * Novart Flow 风格的用户端外观（2026-09-30）
 * ------------------------------------------------------------
 * 用户端（/app、资产、设置、开发者、通知、登录注册……）的设计 / 布局 / 配色统一成 Novart Flow 画布那一套：
 * 数值出处见 docs/flow/前端设计.md「工作台外壳 StudioLayout」「视觉规范」两节（改这里先对一遍那份文档）：
 * 左侧 220px 导航栏 + 48px 顶栏（余额胶囊靠右）、近黑底 #08080b、蓝主色 #2563eb、Poppins / Bricolage Grotesque。
 * 只是一层样式：模板结构与 JS 钩子（id、data-* 属性）一律不动，所以本文件必须排在 app.css / dashboard-preview.css /
 * user-preview.css **之后**加载（base.html 保证），靠覆盖生效。
 *
 * 管理后台不受影响：base.html 只在非后台页引入本文件（后台保持石墨黑，见 docs/admin-design.md）。
 * 选择器里重复的 .nf-theme.nf-theme 是故意的：user-preview.css 的顶栏规则带四个类（body.user-preview-page
 * .topbar.user-preview-topbar …），不叠高特异性就盖不过它。
 * 侧栏布局只在桌面宽度（≥901px）生效；更窄时沿用原有的移动端抽屉导航，只换配色与字体。
 */

/* ── 1. 设计令牌 ─────────────────────────────────────────── */
:root {
  --nf-bg: #08080b;
  --nf-side: #0b0b0f;
  --nf-card: #161618;
  --nf-panel: #18181b;
  --nf-line: rgba(255, 255, 255, 0.06);
  --nf-line-strong: rgba(255, 255, 255, 0.1);
  --nf-ink: #f0f0f0;
  --nf-muted: #a0a0a0;
  --nf-faint: #808080;
  --nf-blue: #2563eb;
  --nf-blue-hover: #1d4ed8;
  --nf-blue-soft: rgba(96, 165, 250, 0.16);
  --nf-side-w: 220px;
  --nf-top-h: 48px;
  --nf-font: "Poppins", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --nf-font-display: "Bricolage Grotesque", "Poppins", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;

  --bg: var(--nf-bg);
  --bg2: #0e0e12;
  --panel: rgba(22, 22, 24, 0.92);
  --panel-strong: rgba(24, 24, 27, 0.97);
  --line-soft: var(--nf-line);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --ink: var(--nf-ink);
  --muted: var(--nf-muted);
  --accent: var(--nf-blue);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.28);
  --accent-line: rgba(96, 165, 250, 0.3);
  --accent-line-strong: rgba(96, 165, 250, 0.46);
  --font-ui: var(--nf-font);
}

body.nf-theme {
  font-family: var(--nf-font);
  color: var(--nf-ink);
  background: var(--nf-bg);
}

body.nf-theme h1,
body.nf-theme .page-title,
body.nf-theme .side-title,
body.nf-theme .brand {
  font-family: var(--nf-font-display);
}

body.nf-theme.dashboard-page {
  background: var(--nf-bg);
}

body.nf-theme.dashboard-page .dashboard-preview-root {
  --bg-0: var(--nf-bg);
  --bg-1: var(--nf-bg);
  --bg-2: var(--nf-card);
  --panel: rgba(22, 22, 24, 0.92);
  --panel-strong: rgba(24, 24, 27, 0.97);
  --line: rgba(255, 255, 255, 0.08);
  --blue: var(--nf-blue);
  --blue-2: var(--nf-blue);
  --cyan: #60a5fa;
  --text: var(--nf-ink);
  --muted: var(--nf-muted);
  --faint: var(--nf-faint);
  --radius-xl: 14px;
  --radius-lg: 12px;
  --radius-md: 10px;
  font-family: var(--nf-font);
}

/* 品牌字标：渐变圆点 + NOVART（NF 侧栏同款） */
body.nf-theme .brand,
body.nf-theme.dashboard-page .dashboard-preview-root .logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--nf-font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
}

body.nf-theme .brand::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #f472b6);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.45);
}

/* 主按钮 / 选中态：NF 蓝 */
body.nf-theme .button:not(.secondary):not(.ghost):not(.danger),
body.nf-theme.dashboard-page .dashboard-preview-root .new-chat,
body.nf-theme.dashboard-page .dashboard-preview-root .send-btn {
  background: var(--nf-blue);
  border-color: transparent;
  color: #fff;
  box-shadow: none;
}

body.nf-theme .button:not(.secondary):not(.ghost):not(.danger):hover,
body.nf-theme.dashboard-page .dashboard-preview-root .new-chat:hover,
body.nf-theme.dashboard-page .dashboard-preview-root .send-btn:hover {
  background: var(--nf-blue-hover);
}

body.nf-theme .topbar {
  background: var(--nf-bg);
  border-bottom: 1px solid var(--nf-line);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ── 2. 桌面：左侧导航栏 + 顶栏 ───────────────────────────── */
@media (min-width: 901px) {
  body.nf-shell.nf-theme.nf-theme {
    padding-left: var(--nf-side-w);
    padding-top: var(--nf-top-h);
  }

  /* 顶栏：固定在侧栏右边，内容靠右。固定定位的后代（品牌、导航、退出）要以视口为参照，
     所以这一串祖先都不能带 transform / filter / backdrop-filter。 */
  body.nf-shell.nf-theme.nf-theme .topbar,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .topbar {
    position: fixed;
    top: 0;
    left: var(--nf-side-w);
    right: 0;
    height: var(--nf-top-h);
    z-index: 10; /* 与原顶栏同层：弹窗遮罩要能盖住顶栏和侧栏 */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 20px;
    margin: 0;
    background: var(--nf-bg);
    border-bottom: 1px solid var(--nf-line);
    box-shadow: none;
    transform: none;
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.nf-shell.nf-theme.nf-theme .topbar .topbar-shell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 0;
    min-width: 0;
  }

  body.nf-shell.nf-theme.nf-theme .topbar-brand-panel,
  body.nf-shell.nf-theme.nf-theme .topbar-brand-row,
  body.nf-shell.nf-theme.nf-theme .brand-cluster,
  body.nf-shell.nf-theme.nf-theme .topnav,
  body.nf-shell.nf-theme.nf-theme .topnav-group-user-nav,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .brand-wrap,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .brand-stack,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .brand-row,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .nav {
    display: contents;
  }

  /* 品牌：侧栏顶部 */
  body.nf-shell.nf-theme.nf-theme .topbar .brand,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .logo {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 62;
    width: var(--nf-side-w);
    height: 60px;
    padding: 0 20px;
    margin: 0;
  }

  /* 主导航：整条侧栏（自带背景与右边线） */
  body.nf-shell.nf-theme.nf-theme .topnav-primary-links,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .nav-primary {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 61;
    width: var(--nf-side-w);
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    margin: 0;
    padding: 68px 14px 64px;
    overflow-y: auto;
    background: var(--nf-side);
    border-right: 1px solid var(--nf-line);
  }

  body.nf-shell.nf-theme.nf-theme .topnav-primary-links .topnav-link,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .nav-primary .nav-item,
  body.nf-shell.nf-theme.nf-theme .topnav-link-logout,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .signout-action {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    width: auto;
    min-width: 0;
    min-height: 0;
    height: auto;
    flex: none;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: var(--nf-muted);
    font-family: var(--nf-font);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.35;
    text-align: left;
    text-decoration: none;
    transform: none;
    cursor: pointer;
  }

  body.nf-shell.nf-theme.nf-theme .topnav-primary-links .topnav-link:hover,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .nav-primary .nav-item:hover,
  body.nf-shell.nf-theme.nf-theme .topnav-link-logout:hover,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .signout-action:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 0;
    box-shadow: none;
    transform: none;
  }

  body.nf-shell.nf-theme.nf-theme .topnav-primary-links .topnav-link.is-active,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .nav-primary .nav-item.active {
    background: var(--nf-blue-soft);
    color: #fff;
    border: 0;
    box-shadow: none;
    font-weight: 500;
  }

  /* 导航图标：按目标地址挂 mask（不改模板）。缺省是一个圆点。 */
  body.nf-shell.nf-theme.nf-theme .topnav-primary-links .topnav-link::before,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .nav-primary .nav-item::before {
    content: "";
    flex: none;
    width: 17px;
    height: 17px;
    background: currentColor;
    -webkit-mask: var(--nf-icon, var(--nf-icon-dot)) center / contain no-repeat;
    mask: var(--nf-icon, var(--nf-icon-dot)) center / contain no-repeat;
  }

  body.nf-shell.nf-theme.nf-theme {
    --nf-icon-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme [href="/app"] {
    --nf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9L12 3z'/%3E%3Cpath d='M19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8L19 15z'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme [href="/app/studio/projects"] {
    --nf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3Cpath d='M6.5 10v3.5a4 4 0 0 0 4 4H14'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme [href="/admin"] {
    --nf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7.5 3v5.5c0 4.5-3.1 8.3-7.5 9.5-4.4-1.2-7.5-5-7.5-9.5V6L12 3z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme [href="/app/assets"],
  body.nf-shell.nf-theme.nf-theme [data-nav-icon="library"] {
    --nf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4v16'/%3E%3Cpath d='M8 4v16'/%3E%3Cpath d='M12 5v15'/%3E%3Cpath d='M15.5 6.2l4.5 13.3'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme [data-nav-icon="models"] {
    --nf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.8l8 4.6v9.2l-8 4.6-8-4.6V7.4l8-4.6z'/%3E%3Cpath d='M4.3 7.6L12 12l7.7-4.4'/%3E%3Cpath d='M12 12v9'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme [href="/app/developer"] {
    --nf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7l-5 5 5 5'/%3E%3Cpath d='M16 7l5 5-5 5'/%3E%3Cpath d='M13.5 5l-3 14'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme [href="/app/developer/results"] {
    --nf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='2.5'/%3E%3Cpath d='M8 9h8'/%3E%3Cpath d='M8 13h8'/%3E%3Cpath d='M8 17h5'/%3E%3C/svg%3E");
  }

  /* 退出：侧栏底部（NF 的页脚项位置），上方一条分隔线 */
  body.nf-shell.nf-theme.nf-theme .topnav-link-logout,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .signout-action {
    position: fixed;
    left: 14px;
    bottom: 12px;
    z-index: 62;
    width: calc(var(--nf-side-w) - 28px);
  }

  body.nf-shell.nf-theme.nf-theme .topnav-link-logout::after,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .signout-action::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -9px;
    height: 1px;
    background: var(--nf-line);
  }

  /* 生成页的退出按钮没有内嵌图标，补一个同款的 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .signout-action::before {
    content: "";
    flex: none;
    width: 17px;
    height: 17px;
    background: currentColor;
    -webkit-mask: var(--nf-icon-logout) center / contain no-repeat;
    mask: var(--nf-icon-logout) center / contain no-repeat;
  }

  body.nf-shell.nf-theme.nf-theme {
    --nf-icon-logout: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H4'/%3E%3Cpath d='M14 4h4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme .topnav-link-logout svg,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .signout-action svg {
    flex: none;
    width: 17px;
    height: 17px;
  }

  /* 余额胶囊：一整条圆角条，余额 / 赠金 / 专享额度并排，充值是绿色小按钮 */
  body.nf-shell.nf-theme.nf-theme .top-balance-cluster,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 2px;
    height: 36px;
    margin: 0;
    padding: 0 4px 0 6px;
    border: 1px solid var(--nf-line-strong);
    border-radius: 999px;
    background: #111114;
    min-width: 0;
  }

  body.nf-shell.nf-theme.nf-theme .top-balance-cluster .top-balance,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row .pill.top-balance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    min-height: 0;
    min-width: 0;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
  }

  body.nf-shell.nf-theme.nf-theme .top-balance-cluster .top-balance-label,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row .top-balance-label {
    color: var(--nf-faint);
    font-size: 11px;
    font-weight: 500;
  }

  body.nf-shell.nf-theme.nf-theme .top-balance-cluster .top-balance-gift,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row .top-balance-gift,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row .top-balance-gift .pill-value {
    color: #34d399;
  }

  body.nf-shell.nf-theme.nf-theme .top-balance-cluster .top-balance-allowance,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row .top-balance-allowance,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row .top-balance-allowance .pill-value {
    color: #7dd3fc;
  }

  body.nf-shell.nf-theme.nf-theme .top-balance-cluster .top-up-trigger,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row .pill-button {
    display: inline-flex;
    align-items: center;
    height: 28px;
    min-height: 0;
    min-width: 0;
    margin-left: 4px;
    padding: 0 11px;
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    box-shadow: none;
    color: #34d399;
    font-family: var(--nf-font);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transform: none;
  }

  body.nf-shell.nf-theme.nf-theme .top-balance-cluster .top-up-trigger:hover,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row .pill-button:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
  }

  body.nf-shell.nf-theme.nf-theme .top-balance-cluster .referral-trigger,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row .pill-button[data-referral-open],
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row a.pill-button {
    border-color: var(--nf-line-strong);
    background: transparent;
    color: var(--nf-muted);
  }

  body.nf-shell.nf-theme.nf-theme .top-balance-cluster .referral-trigger:hover,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row .pill-button[data-referral-open]:hover,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row a.pill-button:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
  }

  /* 顶栏右侧的图标按钮：圆形幽灵按钮 */
  body.nf-shell.nf-theme.nf-theme .topnav-quick-icons,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .icon-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    flex: none;
  }

  body.nf-shell.nf-theme.nf-theme .topnav-quick-icons .topnav-link,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .icon-row .top-action:not(.signout-action) {
    width: 32px;
    height: 32px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: var(--nf-muted);
    transform: none;
  }

  body.nf-shell.nf-theme.nf-theme .topnav-quick-icons .topnav-link:hover,
  body.nf-shell.nf-theme.nf-theme .topnav-quick-icons .topnav-link.is-active,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .icon-row .top-action:not(.signout-action):hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    border: 0;
    transform: none;
  }

  /* 活动横幅留在顶栏里，占掉余额胶囊左边的空位 */
  body.nf-shell.nf-theme.nf-theme .topbar .campaign-banner-inline {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 auto 0 0;
    max-width: 560px;
  }

  /* 内容区 */
  body.nf-shell.nf-theme.nf-theme > main.wrap.page {
    max-width: 1320px;
    margin: 0;
    padding: 20px 40px 32px;
  }

  /* 生成页：顶栏已移出网格，剩下「对话列表 / 对话区 / 右栏」三列铺满侧栏右边 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root {
    width: calc(100vw - var(--nf-side-w));
    height: calc(100vh - var(--nf-top-h));
    min-width: 0;
    min-height: 0;
    padding: 16px 20px 18px;
    grid-template-columns: 232px minmax(0, 1fr) 300px;
    grid-template-rows: minmax(0, 1fr);
    column-gap: 20px;
    row-gap: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .main,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .rightbar {
    grid-row: 1;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .rightbar {
    padding-top: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .page.dashboard-page {
    min-height: 0;
  }
}

/* 中等宽度：右栏（公告 / 资产预览）收起，把宽度让给对话区 */
@media (min-width: 901px) and (max-width: 1279px) {
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .rightbar {
    display: none;
  }

  body.nf-shell.nf-theme.nf-theme .top-balance-cluster .top-balance-label,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .pill-row .top-balance-label {
    display: none;
  }
}

/* ── 3. 卡片 / 面板 ─────────────────────────────────────── */
body.nf-theme.dashboard-page .dashboard-preview-root .sidebar,
body.nf-theme.dashboard-page .dashboard-preview-root .right-card {
  background: #0e0e12;
  border: 1px solid var(--nf-line);
  border-radius: 14px;
}

body.nf-theme.dashboard-page .dashboard-preview-root .conv.active {
  background: var(--nf-blue-soft);
  border-color: transparent;
}

/* 对话区底部的渐隐遮罩原来写死了旧底色，换成 NF 底色 */
body.nf-theme.dashboard-page .dashboard-preview-root .main::after {
  background: linear-gradient(180deg, rgba(8, 8, 11, 0), rgba(8, 8, 11, 0.72) 52%, rgba(8, 8, 11, 0.96) 100%);
}

body.nf-theme.dashboard-page .dashboard-preview-root .composer-box,
body.nf-theme.dashboard-page .dashboard-preview-root .prompt-box {
  background: var(--nf-panel);
  border-color: var(--nf-line-strong);
}

/* 子页面（资产 / 设置 / 开发者 / 通知）：NF 的卡片——更小的圆角、纯色底、细边线、无投影 */
body.nf-theme.user-preview-page {
  background: var(--nf-bg);
}

body.nf-theme.user-preview-page .topbar.user-preview-topbar .brand {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

body.nf-theme.user-preview-page .page.user-preview-page .card,
body.nf-theme.user-preview-page .page.user-preview-page .notification-card,
body.nf-theme.user-preview-page .page.user-preview-page .api-result-row,
body.nf-theme.user-preview-page .page.user-preview-page .asset-card,
body.nf-theme.user-preview-page .page.user-preview-page .billing-summary-card,
body.nf-theme.user-preview-page .page.user-preview-page .developer-model-card,
body.nf-theme.user-preview-page .page.user-preview-page .developer-key-request-entry,
body.nf-theme.user-preview-page .page.user-preview-page .task-detail-stat,
body.nf-theme.user-preview-page .page.user-preview-page .task-detail-prompt,
body.nf-theme.user-preview-page .page.user-preview-page .task-detail-webhook-row,
body.nf-theme.user-preview-page .page.user-preview-page .task-detail-result-card,
body.nf-theme.user-preview-page .page.user-preview-page .developer-doc-tab,
body.nf-theme.user-preview-page .page.user-preview-page .developer-doc-flow-step {
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

body.nf-theme.user-preview-page:not(.nf-embed-page) .page.user-preview-page h1 {
  font-family: var(--nf-font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

@media (min-width: 901px) {
  body.nf-shell.nf-theme.nf-theme.user-preview-page > main.page.user-preview-page {
    width: auto;
    max-width: 1480px;
    margin: 0;
    padding: 20px 40px 32px;
  }
}


/* ── 4. 导航：即将上线占位、分隔线、新图标 ─────────────────── */
body.nf-theme .nav-soon-item {
  cursor: not-allowed;
  opacity: 0.55;
}

body.nf-theme .nav-soon-item > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.nf-theme .nav-soon {
  flex: none;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
}

@media (min-width: 901px) {
  /* 「做片子」与 NA 自己的模型 / 开发者入口之间一条分隔线（NF 侧栏 apart 同款：10px 上边距 + 1px 线） */
  body.nf-shell.nf-theme.nf-theme .topnav-primary-links .nav-apart,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .nav-primary .nav-apart {
    position: relative;
    margin-top: 21px;
  }

  body.nf-shell.nf-theme.nf-theme .topnav-primary-links .nav-apart::after,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .nav-primary .nav-apart::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -11px;
    height: 1px;
    background: var(--nf-line);
    pointer-events: none;
  }

  body.nf-shell.nf-theme.nf-theme .nav-soon-item:hover,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .nav-primary .nav-soon-item:hover {
    background: transparent;
    color: var(--nf-muted);
  }

  body.nf-shell.nf-theme.nf-theme [href="/app/studio/projects"] {
    --nf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.7-.9l-.8-1.2A2 2 0 0 0 7.9 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z'/%3E%3Cpath d='M8 10v4'/%3E%3Cpath d='M12 10v2'/%3E%3Cpath d='M16 10v6'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme [data-nav-mode="image"] {
    --nf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2.5'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='M21 15l-3.1-3.1a2 2 0 0 0-2.8 0L6 21'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme [data-nav-mode="video"] {
    --nf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='14' height='12' rx='2.5'/%3E%3Cpath d='M16 10.5l5.2-3a.5.5 0 0 1 .8.4v8.2a.5.5 0 0 1-.8.4l-5.2-3'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme [data-nav-icon="audio"] {
    --nf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E");
  }
}

/* ── 5. 生成页（图片 / 视频）：NF GenChatView 的版式 ───────────
   页头一行标题；一笔任务 = 一张底板（信息行横跨顶部，下面左产出 / 右描述词，2 : 3）；
   输入栏收在中间（内容区 1040、输入栏 840）。对话列表是 NA 独有的，按素材库左树的样子放成一列。 */

@media (min-width: 901px) {
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root {
    padding: 0;
    grid-template-columns: 208px minmax(0, 1fr);
    column-gap: 0;
    --prompt-content-width: min(840px, calc(100% - 40px));
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .rightbar {
    display: none;
  }

  /* 对话列：扁平的一列，右边一条发丝线 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar {
    padding: 12px 10px 16px 14px;
    border: 0;
    border-right: 1px solid var(--nf-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .side-title {
    font-family: var(--nf-font);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--nf-faint);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .sidebar-header {
    margin: 0 0 8px;
    padding: 0 6px;
    min-height: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .new-chat {
    height: 34px;
    min-height: 0;
    margin: 0 0 8px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 600;
    background: var(--nf-blue);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .search-box {
    display: flex;
    flex: none;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    height: 32px;
    min-height: 0;
    margin: 0 0 8px;
    padding: 0 10px;
    border-radius: 9px;
    border: 1px solid var(--nf-line-strong);
    background: rgba(0, 0, 0, 0.3);
    font-size: 12px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv {
    min-height: 0;
    margin: 0 0 2px;
    padding: 7px 6px 7px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv.active {
    background: var(--nf-blue-soft);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv-name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--nf-ink);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv-date {
    font-size: 10.5px;
    color: var(--nf-faint);
  }

  /* 主区：滚动区 + 输入栏（没有横向抬头：侧栏已经说明这是哪一页） */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .chat-feed {
    padding-top: 14px;
    padding-left: 20px;
    padding-right: 20px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .chat-feed > * {
    width: 100%;
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
  }

  /* 一笔任务 = 一张底板 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    column-gap: 14px;
    row-gap: 9px;
    align-items: start;
    margin-top: 0;
    margin-bottom: 14px;
    padding: 14px 16px 15px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.028);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.assistant,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.assistant > .message-col {
    display: contents;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .avatar,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.user .message-meta {
    display: none;
  }

  /* 信息行：模型 · 状态 · 参数；时间钉在右上角 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-meta {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0 150px 0 0;
    font-size: 11.5px;
    line-height: 18px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-meta .model-name {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--nf-muted);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-meta .assistant-time {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 11.5px;
    line-height: 18px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--nf-faint);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-meta .assistant-image-count {
    padding: 1px 8px;
    border-radius: 999px;
    border: 0.8px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    font-size: 11px;
    color: var(--nf-faint);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .status-badge {
    flex: none;
    height: auto;
    min-height: 0;
    padding: 1px 8px;
    border: 0;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.24);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .status-badge .status-dot {
    display: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .status-badge.success {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.2);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .status-badge.failed {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.22);
  }

  /* 左栏：产出 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-card {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-grid,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-grid.count-1,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-grid.count-2,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-grid.count-3,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-grid.count-4 {
    /* 取景框固定 16:9：横图竖图一律 contain 进同一个框，多张时在框内分格（NF .res-media / .res-grid） */
    width: 100%;
    max-width: none;
    min-height: 0;
    aspect-ratio: 16 / 9;
    grid-auto-rows: minmax(0, 1fr);
    gap: 8px;
    margin: 0;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-grid.count-1 {
    padding: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-unit {
    min-height: 0;
    height: 100%;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-item,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .loading-item,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-grid.count-1 .result-item,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-grid.count-1 .loading-item {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    border: 0;
    border-radius: 8px;
    background-color: transparent;
    overflow: hidden;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-grid.count-1 .result-item,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-grid.count-1 .loading-item {
    border-radius: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-item img,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-grid.count-1 .result-item img,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-grid.count-1 .result-item video {
    object-fit: contain;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-item::after {
    display: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .image-action-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(12, 12, 16, 0.72);
    backdrop-filter: blur(6px);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-card .notice.error {
    margin: 0 0 8px;
    padding: 18px;
    border: 1px solid rgba(248, 113, 113, 0.28);
    border-radius: 12px;
    background: rgba(248, 113, 113, 0.05);
    color: #f87171;
    font-size: 13.5px;
    line-height: 1.6;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-foot {
    margin-top: 7px;
    padding: 0;
    border: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .foot-meta span {
    font-size: 11px;
    color: var(--nf-faint);
    font-variant-numeric: tabular-nums;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .action-btn {
    height: auto;
    min-height: 0;
    padding: 5px 10px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--nf-muted);
    font-size: 12px;
    font-weight: 500;
    box-shadow: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .task-card-action.danger:hover {
    background: rgba(239, 68, 68, 0.8);
    color: #fff;
  }

  /* 右栏：参考图在上、描述词在下；描述词不套底板。
     描述词永远撑不高卡片：卡片高度由左栏产出决定，右栏拉伸到同高，文字区绝对定位填满它，超长就在框内向下滚动
     （NF .ask-text.expanded 的做法，这里不再有「展开 / 收起」）。复制按钮钉在文字区右下角，悬停才出现。 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.user {
    grid-column: 2;
    grid-row: 2;
    align-self: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.user .message-col {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    align-self: stretch;
    width: 100%;
    height: auto;
    min-height: 0;
    max-width: none;
    margin: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.user .user-reference-strip {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    margin: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .user-reference-thumb {
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .user-reference-thumb:hover {
    border-color: rgba(96, 165, 250, 0.7);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .user-reference-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.user .bubble {
    flex: 1 1 0;
    position: relative;
    width: 100%;
    max-width: none;
    min-height: 72px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.user .task-prompt-block {
    position: absolute;
    inset: 0 30px 0 0;
    display: block;
    margin: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.user .bubble-text,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.user .bubble-text.is-collapsed,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.user .bubble-text.is-expanded {
    display: block;
    margin: 0;
    overflow: visible;
    -webkit-line-clamp: unset;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14.5px;
    line-height: 1.6;
    font-weight: 400;
    color: var(--nf-ink);
    text-align: left;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .bubble-toggle,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .task-prompt-toggle:not([hidden]) {
    display: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .user-prompt-actions {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: block;
    margin: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.user:hover .user-prompt-actions,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .user-prompt-actions:focus-within {
    opacity: 1;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .prompt-copy-btn {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--nf-faint);
    font-size: 13px;
    line-height: 1;
    box-shadow: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .prompt-copy-btn .prompt-copy-label {
    display: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .prompt-copy-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
  }

  /* 旧三栏布局里中栏与右栏之间的那条竖向光线：右栏已收起，它会悬在内容中间 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .divider-glow {
    display: none;
  }

  /* 输入栏 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .mode-switch {
    display: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer-panel {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: #14141a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }

  /* 🔴 镜像层（.prompt-highlight）必须与 textarea 同字号同行高：textarea 文字是透明的，用户看到的是镜像层，
     光标却画在 textarea 里——差 0.5px 字号，@ 出「图N」药丸后越往后打字光标离字越远（10-02 用户报「光标漂移」） */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .prompt-textarea,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .prompt-input-wrap .prompt-highlight {
    font-family: var(--nf-font);
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.55;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer-tools {
    gap: 8px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer-chip {
    height: 30px;
    min-height: 0;
    padding: 0 8px 0 10px;
    border: 0.8px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--nf-muted);
    font-size: 12.5px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer-chip:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer-chip .chip-label {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--nf-faint);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer-chip select,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer-chip .mobile-picker-trigger-value {
    font-family: var(--nf-font);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--nf-ink);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer-tool {
    width: 32px;
    height: 32px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 9px;
    background: transparent;
    color: var(--nf-faint);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer-tool:hover {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer-price {
    font-size: 11.5px;
    color: var(--nf-muted);
    font-variant-numeric: tabular-nums;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .generate-btn {
    width: 38px;
    height: 38px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(100deg, #67e8f9, #93c5fd, #f9a8d4);
    color: #050507;
    box-shadow: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .generate-btn:hover {
    background: linear-gradient(100deg, #67e8f9, #93c5fd, #f9a8d4);
    filter: brightness(1.06);
    transform: none;
  }
}

/* ── 6. 我的素材库：NF AssetsView 的版式 ─────────────────────
   页签页头 + 保留期提示（NF 用量条的位置）+ 左列类型树（208px）+ 右列素材卡网格（1:1、contain）。 */
body.nf-theme.assets-page .page.user-preview-page.assets-page .nf-assets,
body.nf-theme.assets-page .nf-assets {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

body.nf-theme.assets-page .nf-assets-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 32px 6px;
}

body.nf-theme.assets-page .nf-assets-head h1.nf-assets-tab {
  margin: 0;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: var(--nf-font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  color: #fff;
  background: var(--nf-blue-soft);
}

body.nf-theme.assets-page .nf-assets .asset-library-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

body.nf-theme.assets-page .nf-assets .asset-library-selection-status {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--nf-faint);
}

body.nf-theme.assets-page .nf-assets .asset-library-toolbar-actions {
  display: flex;
  gap: 6px;
}

body.nf-theme.assets-page .nf-assets .asset-library-toolbar .button,
body.nf-theme.assets-page .nf-assets .pager .button {
  height: auto;
  min-height: 0;
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--nf-muted);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

body.nf-theme.assets-page .nf-assets .asset-library-toolbar .button:not(:disabled):hover,
body.nf-theme.assets-page .nf-assets .pager .button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.nf-theme.assets-page .nf-assets .asset-library-toolbar .button.primary:not(:disabled) {
  background: var(--nf-blue);
  color: #fff;
}

body.nf-theme.assets-page .nf-assets .asset-library-toolbar .button:disabled {
  opacity: 0.5;
}

body.nf-theme.assets-page .nf-assets-usage {
  max-width: 584px;
  margin: 0;
  padding: 4px 32px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--nf-faint);
  opacity: 1;
}

body.nf-theme.assets-page .nf-assets-body {
  display: flex;
  align-items: flex-start;
  border-top: 1px solid var(--nf-line);
}

body.nf-theme.assets-page .nf-assets-tree {
  position: sticky;
  top: calc(var(--nf-top-h) + 8px);
  flex: none;
  width: 208px;
  min-height: calc(100vh - 170px);
  padding: 8px 10px 20px 32px;
  border-right: 1px solid var(--nf-line);
}

body.nf-theme.assets-page .nf-assets-tree-label {
  padding: 6px 4px 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--nf-faint);
}

body.nf-theme.assets-page .nf-assets .asset-media-tabs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

body.nf-theme.assets-page .nf-assets .asset-media-tab {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: 7px;
  min-height: 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--nf-muted);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
}

body.nf-theme.assets-page .nf-assets .asset-media-tab::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--nf-tree-icon) center / contain no-repeat;
  mask: var(--nf-tree-icon) center / contain no-repeat;
  --nf-tree-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='3' width='13' height='13' rx='2'/%3E%3Cpath d='M16 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2h3'/%3E%3C/svg%3E");
}

body.nf-theme.assets-page .nf-assets .asset-media-tab[data-asset-tree-icon="image"]::before {
  --nf-tree-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2.5'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='M21 15l-3.1-3.1a2 2 0 0 0-2.8 0L6 21'/%3E%3C/svg%3E");
}

body.nf-theme.assets-page .nf-assets .asset-media-tab[data-asset-tree-icon="video"]::before {
  --nf-tree-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='14' height='12' rx='2.5'/%3E%3Cpath d='M16 10.5l5.2-3a.5.5 0 0 1 .8.4v8.2a.5.5 0 0 1-.8.4l-5.2-3'/%3E%3C/svg%3E");
}

body.nf-theme.assets-page .nf-assets .asset-media-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

body.nf-theme.assets-page .nf-assets .asset-media-tab.active {
  background: var(--nf-blue-soft);
  color: #fff;
}

body.nf-theme.assets-page .nf-assets .asset-media-tab small {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  font-size: 11px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--nf-faint);
}

body.nf-theme.assets-page .nf-assets-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 32px 32px 20px;
}

body.nf-theme.assets-page .nf-assets .pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--nf-faint);
}

body.nf-theme.assets-page .nf-assets .asset-group {
  margin: 0 0 22px;
}

body.nf-theme.assets-page .nf-assets .asset-group-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
}

body.nf-theme.assets-page .nf-assets .asset-group-head h3 {
  margin: 0;
  font-family: var(--nf-font);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--nf-muted);
  font-variant-numeric: tabular-nums;
}

body.nf-theme.assets-page .nf-assets .asset-group-head span {
  font-size: 11.5px;
  color: var(--nf-faint);
}

body.nf-theme.assets-page .nf-assets .asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card {
  position: relative;
  display: block;
  width: auto;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  overflow: hidden;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card.is-selected {
  border-color: rgba(37, 99, 235, 0.85);
}

body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card .asset-card-preview,
body.nf-theme.assets-page .page.user-preview-page.assets-page button.asset-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: var(--nf-font);
  text-align: left;
  cursor: zoom-in;
}

body.nf-theme.assets-page .page.user-preview-page.assets-page button.asset-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card .asset-image {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 0;
  background: linear-gradient(180deg, #17141b, #1d1519);
  transform: none;
}

body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card .asset-media-badge,
body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card .asset-card-preview::after,
body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card .asset-card-preview::before {
  display: none;
}

body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card .asset-card-name {
  display: block;
  padding: 10px 10px 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--nf-ink);
}

body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card .asset-card-info {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 10px;
  min-width: 0;
}

body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card .asset-src-badge {
  flex: none;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.5;
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.28);
}

body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card .asset-card-caption {
  position: static;
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none;
  font-size: 11px;
  font-weight: 400;
  color: var(--nf-faint);
  font-variant-numeric: tabular-nums;
  text-shadow: none;
}

body.nf-theme.assets-page .page.user-preview-page.assets-page .asset-card .asset-card-selection {
  top: 8px;
  left: 8px;
}

@media (min-width: 901px) {
  body.nf-shell.nf-theme.nf-theme.assets-page > main.page.user-preview-page.assets-page {
    max-width: none;
    padding: 0;
  }
}

@media (max-width: 900px) {
  body.nf-theme.assets-page .nf-assets-head,
  body.nf-theme.assets-page .nf-assets-usage {
    padding-left: 0;
    padding-right: 0;
  }

  body.nf-theme.assets-page .nf-assets-body {
    display: block;
  }

  body.nf-theme.assets-page .nf-assets-tree {
    position: static;
    width: auto;
    min-height: 0;
    padding: 8px 0;
    border-right: 0;
  }

  body.nf-theme.assets-page .nf-assets-tree-label {
    display: none;
  }

  body.nf-theme.assets-page .nf-assets .asset-media-tabs {
    flex-direction: row;
  }

  body.nf-theme.assets-page .nf-assets .asset-media-tab {
    width: auto;
    white-space: nowrap;
  }

  body.nf-theme.assets-page .nf-assets .asset-library-toolbar,
  body.nf-theme.assets-page .nf-assets .asset-library-toolbar-actions {
    flex-direction: row;
    flex-wrap: wrap;
    width: auto;
  }

  body.nf-theme.assets-page .nf-assets .asset-library-toolbar .button {
    width: auto;
  }

  body.nf-theme.assets-page .nf-assets-main {
    padding: 8px 0 24px;
  }

  body.nf-theme.assets-page .nf-assets .asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
}


/* ── 7. 输入栏（NF NodeComposer / GenChatView 的排法）、对话列表、素材拾取器 ─────────── */
body.nf-theme .composer-ref-add {
  display: contents;
}

body.nf-theme .reference-count-hint,
body.nf-theme .prompt-resize-grip,
body.nf-theme .conversation-search-empty[hidden] {
  display: none;
}

body.nf-theme.dashboard-page .dashboard-preview-root .search-box .conversation-search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

body.nf-theme.dashboard-page .dashboard-preview-root .search-box .conversation-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

body.nf-theme.dashboard-page .dashboard-preview-root .conversation-search-empty {
  margin: 10px 6px;
  font-size: 12px;
  color: var(--nf-faint);
}

@media (min-width: 901px) {
  /* 参考素材条常驻：缩略图在前，加素材的虚线方块排在后面，每加一张自动往后挪 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-strip,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-strip:has(.prompt-attachment-item) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 4px 2px 10px;
    border: 0;
    background: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-strip .prompt-attachments,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-strip .prompt-attachments.has-items {
    display: contents;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-strip .prompt-attachment-item {
    flex: none;
    width: 52px;
    height: 52px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    overflow: hidden;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-strip .prompt-attachment-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-strip .composer-tool {
    flex: none;
    width: 52px;
    height: 52px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 9px;
    background: transparent;
    color: var(--nf-faint);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-strip .composer-tool[hidden] {
    display: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-strip .composer-tool svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-strip .composer-tool:hover {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .prompt-input-wrap {
    position: relative;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .prompt-input-wrap .prompt-textarea,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .prompt-input-wrap .prompt-highlight {
    padding: 4px 6px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .prompt-resize-grip {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: block;
    width: 16px;
    height: 16px;
    cursor: ns-resize;
    touch-action: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .prompt-resize-grip::after {
    content: "";
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 7px;
    height: 7px;
    border-right: 2px solid rgba(255, 255, 255, 0.28);
    border-bottom: 2px solid rgba(255, 255, 255, 0.28);
    border-radius: 0 0 2px 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-count-hint:not([hidden]) {
    display: block;
    margin: 4px 0 0;
    padding: 0 6px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--nf-faint);
  }

  /* 参数行：左边一组 chip 在自己内部换行，右边「价格 + 生成」永远留在同一行 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 0;
    padding: 8px 0 0;
    border: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-tools {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
  }

  /* chip = 图标 + 当前值（不写「分辨率 / 宽高比」这些字，悬停有 title） */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .chip-label,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-trigger-label {
    display: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip]::before {
    content: "";
    flex: none;
    width: 13px;
    height: 13px;
    margin-right: 5px;
    background: currentColor;
    -webkit-mask: var(--nf-chip-icon) center / contain no-repeat;
    mask: var(--nf-chip-icon) center / contain no-repeat;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip="model"] {
    --nf-chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Cpath d='M8.5 16V8l7 8V8'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip="aspect"] {
    --nf-chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2v14a2 2 0 0 0 2 2h14'/%3E%3Cpath d='M18 22V8a2 2 0 0 0-2-2H2'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip="resolution"] {
    --nf-chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M9 21H3v-6'/%3E%3Cpath d='M21 3l-7 7'/%3E%3Cpath d='M3 21l7-7'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip="count"] {
    --nf-chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l9 5-9 5-9-5 9-5z'/%3E%3Cpath d='M3 13l9 5 9-5'/%3E%3Cpath d='M3 17.5l9 5 9-5'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip="duration"] {
    --nf-chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip="refmode"] {
    --nf-chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2.5'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='M21 15l-3.1-3.1a2 2 0 0 0-2.8 0L6 21'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip="audio"] {
    --nf-chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E");
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip="model"] {
    color: var(--nf-ink);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-trigger {
    min-height: 0;
    height: 28px;
    padding: 0 16px 0 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip.is-open {
    background: rgba(255, 255, 255, 0.1);
  }

  /* 下拉弹层：一律向上开，深色玻璃面板（NF .cc-pop / SelectMenu） */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-panel {
    left: 0;
    bottom: calc(100% + 6px);
    min-width: 132px;
    max-width: 300px;
    max-height: 300px;
    padding: 4px;
    gap: 1px;
    border: 0.8px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    background: linear-gradient(180deg, rgba(38, 38, 46, 0.98), rgba(26, 26, 32, 0.98));
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-option {
    min-height: 0;
    padding: 6px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--nf-ink);
    font-family: var(--nf-font);
    font-size: 12.5px;
    font-weight: 400;
    text-align: left;
    white-space: nowrap;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-option:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-option.is-active {
    background: rgba(37, 99, 235, 0.16);
    color: #93c5fd;
    font-weight: 500;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-price {
    margin-right: 2px;
    white-space: nowrap;
  }

  /* 对话列表：删除按钮悬停才出现，平时不抢眼 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conversation-list {
    margin: 0;
    padding: 0;
    gap: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv[hidden] {
    display: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv .trash {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--nf-faint);
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv:hover .trash,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv .trash:focus-visible {
    opacity: 1;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv .trash:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv .trash svg {
    width: 13px;
    height: 13px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv.active .conv-name {
    color: #fff;
    font-weight: 600;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .search-box:focus-within {
    border-color: rgba(96, 165, 250, 0.6);
  }
}

/* 素材拾取器（从我的素材库选参考素材） */
body.nf-theme .library-picker[hidden] {
  display: none;
}

body.nf-theme .library-picker {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 20px;
  font-family: var(--nf-font);
}

body.nf-theme .library-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

body.nf-theme .library-picker-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(860px, 100%);
  height: min(620px, 86vh);
  border: 0.8px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(28, 28, 32, 0.96), rgba(17, 17, 20, 0.98));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

body.nf-theme .library-picker-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.nf-theme .library-picker-head h2 {
  margin: 0;
  font-family: var(--nf-font);
  font-size: 15px;
  font-weight: 600;
  color: var(--nf-ink);
}

body.nf-theme .library-picker-kinds {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

body.nf-theme .library-picker .library-picker-kind,
body.nf-theme .library-picker .library-picker-btn,
body.nf-theme .library-picker .library-picker-more {
  min-height: 0;
  height: auto;
  line-height: 1.4;
  font-weight: 500;
  padding: 6px 12px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--nf-muted);
  font-family: var(--nf-font);
  font-size: 12.5px;
  cursor: pointer;
}

body.nf-theme .library-picker-kind[hidden] {
  display: none;
}

body.nf-theme .library-picker-kind:hover,
body.nf-theme .library-picker-btn:hover,
body.nf-theme .library-picker-more:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.nf-theme .library-picker-kind.active {
  background: var(--nf-blue-soft);
  color: #fff;
}

body.nf-theme .library-picker-btn.primary {
  background: var(--nf-blue);
  color: #fff;
}

body.nf-theme .library-picker-btn.primary:hover {
  background: var(--nf-blue-hover);
}

body.nf-theme .library-picker-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body.nf-theme .library-picker-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--nf-faint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

body.nf-theme .library-picker-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

body.nf-theme .library-picker-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 18px;
  overflow-y: auto;
}

body.nf-theme .library-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

body.nf-theme .library-picker-item {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--nf-muted);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
}

body.nf-theme .library-picker-item:hover {
  border-color: rgba(59, 130, 246, 0.5);
}

body.nf-theme .library-picker-item.selected {
  border-color: rgba(37, 99, 235, 0.95);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.95);
}

body.nf-theme .library-picker-item.selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--nf-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

body.nf-theme .library-picker-item img,
body.nf-theme .library-picker-item video,
body.nf-theme .library-picker-audio {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: linear-gradient(180deg, #17141b, #1d1519);
  font-size: 26px;
}

body.nf-theme .library-picker-item-name {
  padding: 6px 8px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
}

body.nf-theme .library-picker-empty {
  margin: 40px 0;
  text-align: center;
  font-size: 13px;
  color: var(--nf-faint);
}

body.nf-theme .library-picker-more {
  display: block;
  margin: 14px auto 0;
}

body.nf-theme .library-picker-more[hidden] {
  display: none;
}

body.nf-theme .library-picker-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.nf-theme .library-picker-count {
  margin-right: auto;
  font-size: 12px;
  color: var(--nf-faint);
}

@media (min-width: 901px) {
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .search-box svg {
    flex: none;
    width: 13px;
    height: 13px;
  }
}


/* ── 8. 项目库 / 音频生成 / 素材库 / Director Lab / 画布：内容由前端包渲染，外壳是全站这一套 ─────────
   templates/studio_embed.html。带外壳的页：内容区 = 视口减顶栏，#app 占满、自己滚；画布页全屏、不出外壳。 */
@media (min-width: 901px) {
  body.nf-shell.nf-theme.nf-theme [data-nav-icon="lab"] {
    --nf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.4 10.9a1 1 0 0 0 0-1.8l-8.6-3.9a2 2 0 0 0-1.6 0L2.6 9.1a1 1 0 0 0 0 1.8l8.6 3.9a2 2 0 0 0 1.6 0l8.6-3.9z'/%3E%3Cpath d='M22 10v6'/%3E%3Cpath d='M6 12.5V16a6 3 0 0 0 12 0v-3.5'/%3E%3C/svg%3E");
  }

  body.nf-embed-page.nf-theme {
    height: 100vh;
    overflow: hidden;
  }

  body.nf-embed-page.nf-theme > main.page,
  body.nf-shell.nf-theme.nf-theme.nf-embed-page.user-preview-page > main.page.user-preview-page {
    height: 100%;
    overflow: hidden;
  }
}

body.nf-embed-page.nf-theme > main.page,
body.nf-embed-page.nf-theme.user-preview-page > main.page.user-preview-page,
body.nf-shell.nf-theme.nf-theme.nf-embed-page.user-preview-page > main.page.user-preview-page {
  width: auto;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.nf-theme .nf-embed-root {
  height: 100%;
  min-height: calc(100vh - 140px);
  background: var(--nf-bg);
}

body.nf-canvas-page.nf-theme {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #0d0d10;
}

body.nf-canvas-page.nf-theme > main.page {
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.nf-canvas-page.nf-theme .nf-embed-root {
  min-height: 0;
  background: #0d0d10;
}


/* ── 9. 首屏语言：界面语言应用完之前，先不显示带翻译的文字（base.html 头部的内联脚本加 / 去这个类） ── */
html.nf-i18n-pending [data-app-i18n],
html.nf-i18n-pending [data-app-i18n-rich],
html.nf-i18n-pending [data-app-i18n-placeholder]::placeholder {
  visibility: hidden;
}

/* ── 10. 任务卡信息行（NF .card-head）：模型 · 状态 · 耗时 · 参数胶囊，时间钉右上角；卡片下方不再另起一排参数 ── */
body.nf-theme .assistant-dur,
body.nf-theme .assistant-params {
  display: none;
}

@media (min-width: 901px) {
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-meta .assistant-image-count,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-foot .foot-meta {
    display: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-meta .assistant-dur {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--nf-faint);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-meta .assistant-dur svg {
    width: 11px;
    height: 11px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-meta .assistant-dur .task-runtime:empty {
    display: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-meta .assistant-params {
    display: inline-block;
    padding: 1px 8px;
    border: 0.8px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--nf-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-meta .assistant-params:empty {
    display: none;
  }

  /* 失败 / 过期：取景框下面一排操作（编辑 / 重新生成 / 删除），靠左 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-foot {
    justify-content: flex-start;
    margin-top: 6px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-foot:not(:has(.task-card-actions)) {
    display: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .task-card-actions {
    justify-content: flex-start;
    gap: 6px;
  }

  /* 失败说明：占满取景框的位置（与成功 / 生成中同宽同形），文字居中 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-card .notice.error {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0;
    padding: 0 18px;
    text-align: center;
    font-size: 14px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-expired-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0;
    padding: 0 18px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--nf-faint);
    text-align: center;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .result-expired-card p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
  }
}

/* ── 11. 前端包渲染的页面（项目库 / 音频 / 素材库 / Lab / 画布）与 NA 全局样式互不串味 ───────────
   两边都带一套「元素级」的全局规则：NA 的 app.css 给所有 input / select / textarea / label / a / h1 定了样子，
   前端包自带 Tailwind 的 preflight。放在同一张页面里会互相改掉对方的缺省外观，所以：
   ① 这些页面上先把 NA 的元素级规则归零（:where 不加特异性，前端包里任何带类名的样式照样压得过它）；
   ② 再给 NA 自己的弹窗 / 顶栏把它们要的样子写回去（带类名，压得过 preflight）。 */
:where(.nf-embed-root, body.nf-view-studio > :not(main):not(script), body.nf-view-canvas > :not(main):not(script)) :is(input, select, textarea) {
  width: auto;
  padding: 0;
  border: 0 solid;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

:where(.nf-embed-root, body.nf-view-studio > :not(main):not(script), body.nf-view-canvas > :not(main):not(script)) a {
  color: inherit;
}

:where(.nf-embed-root, body.nf-view-studio > :not(main):not(script), body.nf-view-canvas > :not(main):not(script)) :is(input, select, textarea):focus {
  box-shadow: none;
}

:where(.nf-embed-root, body.nf-view-studio > :not(main):not(script), body.nf-view-canvas > :not(main):not(script)) textarea {
  min-height: 0;
  resize: none;
}

:where(.nf-embed-root, body.nf-view-studio > :not(main):not(script), body.nf-view-canvas > :not(main):not(script)) label {
  display: inline;
  flex: initial;
  gap: 0;
}

:where(.nf-embed-root, body.nf-view-studio > :not(main):not(script), body.nf-view-canvas > :not(main):not(script)) a:hover {
  text-decoration: none;
}

:where(.nf-embed-root, body.nf-view-studio > :not(main):not(script), body.nf-view-canvas > :not(main):not(script)) :is(h1, h2) {
  margin: 0;
  font-family: inherit;
  letter-spacing: normal;
}

body.nf-theme :is(.top-up-modal, .app-modal, .referral-modal, .model-catalog-modal, .announcement-modal) :is(input, select, textarea) {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(28, 28, 29, 0.78);
  color: var(--ink);
  font: inherit;
}

body.nf-theme :is(.top-up-modal, .app-modal, .referral-modal, .model-catalog-modal, .announcement-modal) label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 画布页：NA 的弹窗要盖住画布自己的顶栏和浮层（画布顶栏 z-index 100，浮层最高到 400） */
body.nf-canvas-page.nf-theme :is(.top-up-modal, .app-modal, .referral-modal, .model-catalog-modal, .announcement-modal, .asset-modal) {
  z-index: 1200;
}


/* ── 12. 全站一张宿主页（templates/dashboard.html + static/app-host.js）：切换内容不重新加载页面 ─────────
   body[data-host-view] = dashboard（图片 / 视频生成）| studio（项目库 / 音频 / 素材库 / Lab）| canvas（画布，全屏）|
   frame（设置 / 开发者 / API 结果 / 通知，放在 iframe 里）。 */
body.nf-theme .nf-host-view {
  display: none;
}

body.nf-theme[data-host-view="studio"] .dashboard-preview-root > :is(.sidebar, .main, .rightbar),
body.nf-theme[data-host-view="canvas"] .dashboard-preview-root > :is(.sidebar, .main, .rightbar),
body.nf-theme[data-host-view="frame"] .dashboard-preview-root > :is(.sidebar, .main, .rightbar),
body.nf-theme[data-host-view="studio"] .divider-glow,
body.nf-theme[data-host-view="canvas"] .divider-glow,
body.nf-theme[data-host-view="frame"] .divider-glow {
  display: none;
}

body.nf-theme[data-host-view="studio"] #app.nf-host-view,
body.nf-theme[data-host-view="frame"] #nf-host-frame.nf-host-view {
  display: block;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 140px);
  min-width: 0;
  border: 0;
  background: var(--nf-bg);
}

/* 画布：全屏盖住外壳 */
body.nf-theme[data-host-view="canvas"] #app.nf-host-view {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 70;
  min-height: 0;
  background: #0d0d10;
}

body.nf-theme[data-host-view="canvas"] .dashboard-preview-root > header,
body.nf-theme[data-host-view="canvas"] .mobile-actions-panel {
  display: none;
}

body.nf-theme[data-host-view="canvas"] :is(.top-up-modal, .app-modal, .referral-modal, .model-catalog-modal, .announcement-modal, .asset-modal) {
  z-index: 1200;
}

/* app.css 的 .truncate（NA 表格用，带 max-width:360px）与前端包 Tailwind 的同名工具类撞车：前端包里不限宽 */
body.nf-theme .nf-embed-root .truncate {
  max-width: none;
}

/* 画布顶栏与外面同一条（2026-10-01）：桌面端把 NA 自己的顶栏升到画布之上，只露右侧的余额胶囊 + 图标
   （同一份 DOM、同一套事件：充值 / 推广 / 站内信 / 公告 / 设置 / 语言都是真的那一个）；
   画布自己的用户区（UserBar）收起，画布顶栏只留左侧的返回 / 画布名 / 撤销重做，底色与描边对齐 NA 顶栏。
   余额由前端包在每次刷新钱包后通过 notifyHostWallet 同步给 NA 的胶囊（services/embed.ts）。
   手机端（≤900）NA 顶栏是另一套抽屉式布局，画布仍用自己的 UserBar。 */
@media (min-width: 901px) {
  body.nf-shell.nf-theme.nf-theme[data-host-view="canvas"] .dashboard-preview-root .topbar {
    left: auto;
    z-index: 90;
    background: transparent;
    border-bottom: 0;
  }

  body.nf-theme[data-host-view="canvas"] .dashboard-preview-root .topbar :is(.logo.brand, .nav-primary, .signout-action, [data-campaign-banner]) {
    display: none;
  }

  body.nf-theme[data-host-view="canvas"] #app .workflow-header {
    padding: 0 20px 0 16px;
    background: var(--nf-bg);
    border-bottom: 1px solid var(--nf-line);
    font-family: var(--nf-font);
  }

  body.nf-theme[data-host-view="canvas"] #app .workflow-header .header-right {
    display: none;
  }

  /* 返回按钮：与 NA 顶栏的胶囊按钮同一套（细描边、低透明底），不再用玻璃药丸 */
  body.nf-theme[data-host-view="canvas"] #app .workflow-header .back-button {
    height: 30px;
    padding: 0 12px 0 10px;
    border: 1px solid var(--nf-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
    backdrop-filter: none;
    color: var(--nf-ink);
    font-size: 13px;
    font-weight: 500;
  }

  body.nf-theme[data-host-view="canvas"] #app .workflow-header .back-button:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

/* 次要页面在 iframe 里：不要它自己的外壳、不重复弹每日公告（宿主页已经有） */
html.nf-in-frame body.nf-shell.nf-theme {
  padding: 0;
}

html.nf-in-frame body.nf-theme > header.topbar,
html.nf-in-frame body.nf-theme .announcement-modal:not(.model-catalog-modal) {
  display: none !important;
}


/* ── 13. 模型两级下拉（厂商 → 型号）、更小的参考图与加素材按钮 ───────────── */
@media (min-width: 901px) {
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-group-trigger {
    gap: 7px;
    min-width: 168px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .model-vendor-icon {
    flex: none;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* 官方 favicon（MiniMax / Wan，static/vendor-minimax.ico / vendor-wan.png）：图片图标，圆角裁一下 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .model-vendor-icon.is-img {
    border-radius: 3px;
    object-fit: contain;
  }

  /* 二级分组（「模型管理 → 分组管理」）：组内菜单的分节标题 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-section-title {
    padding: 8px 10px 4px;
    color: var(--nf-faint);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    pointer-events: none;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-section-title:not(:first-child) {
    margin-top: 4px;
    border-top: 1px solid var(--nf-line);
  }

  /* 只有一个型号的厂商组直接平铺成一项：图标 + 型号名 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-option.has-vendor-icon {
    gap: 7px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-option.has-vendor-icon .mobile-picker-option-name {
    flex: 1;
    min-width: 0;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-group.is-active > .mobile-picker-group-trigger {
    background: transparent;
    box-shadow: none;
    color: #fff;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-group:hover > .mobile-picker-group-trigger,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-group.is-open > .mobile-picker-group-trigger {
    background: rgba(255, 255, 255, 0.1);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-group-dot {
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #60a5fa;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-submenu {
    left: calc(100% + 4px);
    bottom: -4px;
    min-width: 230px;
    max-width: 340px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
    gap: 1px;
    border: 0.8px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    background: linear-gradient(180deg, rgba(38, 38, 46, 0.98), rgba(26, 26, 32, 0.98));
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .mobile-picker-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip .model-price-tag {
    flex: none;
    font-size: 10.5px;
    font-weight: 400;
    color: var(--nf-faint);
    font-variant-numeric: tabular-nums;
  }

  /* 任务卡里的参考图：小一号，从左往右排 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .message-row.user .user-reference-strip {
    justify-content: flex-start;
    align-self: flex-start;
    width: 100%;
    gap: 5px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .user-reference-thumb {
    width: 36px;
    height: 36px;
    border-radius: 7px;
  }

  /* 输入栏里的「上传」「从我的素材库选择」：缩到原来的一半 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-strip .composer-tool {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .reference-strip .composer-tool svg {
    width: 13px;
    height: 13px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip="model"]::before {
    width: 14px;
    height: 14px;
  }
}

/* ── 14. 音频模式（/app?mode=audio）：没有参考素材，结果是一条播放器 ───────────── */
body.nf-shell.nf-theme.audio-mode .dashboard-preview-root .composer .reference-strip,
body.nf-shell.nf-theme.audio-mode .dashboard-preview-root .composer .composer-upload,
body.nf-shell.nf-theme.audio-mode .dashboard-preview-root .composer #reference-count-hint {
  display: none !important;
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[hidden] {
  display: none !important;
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn.task-card-audio .result-grid,
body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn.task-card-audio .result-grid.count-1 {
  aspect-ratio: auto;
  height: 132px;
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn.task-card-audio .result-grid.count-1 .result-item-audio {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px 30px;
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn.task-card-audio .result-audio {
  display: block;
  width: 100%;
  height: 40px;
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip="voice"],
body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip="musicmode"] {
  --nf-chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E");
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .composer .composer-chip[data-chip="emotion"] {
  --nf-chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 14s1.5 2 4 2 4-2 4-2'/%3E%3Cpath d='M9 9h.01'/%3E%3Cpath d='M15 9h.01'/%3E%3C/svg%3E");
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn.task-card-audio .assistant-card .notice.error {
  aspect-ratio: auto;
  min-height: 132px;
}


/* ── 15. 生成页对话列：去掉「对话」标题，列从顶栏下沿开始；对话可就地重命名 ───────────── */
@media (min-width: 901px) {
  /* 对话列固定在左侧导航右边、顶栏下面（宿主页的内容区有 overflow:hidden，负外边距会被裁掉，所以用固定定位）；
     它在网格里原来那一列留空，生成区仍排在第二列。
     ⚠️ 别再让它顶到页面最上面：那样顶栏得让到它右边，余额 / 充值整块被挤右（2026-10-01 用户要求改回） */
  body.nf-shell.nf-theme.nf-theme.dashboard-page[data-host-view="dashboard"] .dashboard-preview-root .sidebar {
    position: fixed;
    top: var(--nf-top-h);
    bottom: 0;
    left: var(--nf-side-w);
    width: 208px;
    height: auto;
    max-height: none;
    padding-top: 14px;
    z-index: 11;
    background: var(--nf-bg);
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page[data-host-view="dashboard"] .dashboard-preview-root .main {
    grid-column: 2;
    grid-row: 1;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .sidebar-header {
    display: none;
  }
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv {
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: 2px;
  align-items: center;
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv .conv-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--nf-faint);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv:hover .conv-action,
body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv .conv-action:focus-visible {
  opacity: 1;
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv .conv-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--nf-ink);
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv .conv-action svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv-rename-input {
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 0 6px;
  border: 1px solid rgba(96, 165, 250, 0.55);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  outline: none;
}

@media (hover: none) {
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .sidebar .conv .conv-action {
    opacity: 1;
  }
}

/* ── 16. 空间利用（2026-10-01）：生成页内容区放宽、产出栏占大头；弹窗按屏幕给足尺寸，内容尽量一屏放下 ───────────── */
@media (min-width: 901px) {
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root {
    --prompt-content-width: min(1120px, calc(100% - 48px));
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .chat-feed {
    padding-left: 24px;
    padding-right: 24px;
  }

  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .chat-feed > * {
    max-width: 1320px;
  }

  /* 产出（左）固定在 480px 以内（16:9 框约 270px 高）：卡片是缩略预览，看大图点开；一屏能扫到更多条 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn {
    grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
    column-gap: 18px;
  }

  /* 取景框跟着变宽，但一张卡片不该比一屏还高：高度封顶，横图竖图照旧 contain 进框 */
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn:not(.task-card-audio) .result-grid,
  body.nf-shell.nf-theme.nf-theme.dashboard-page .dashboard-preview-root .task-card.turn .assistant-card .notice.error {
    max-height: min(40vh, 300px);
  }
}

/* 弹窗：不超过视口，留 24px 边；宽度按内容给足，把竖排的块改成两列，尽量不用滚动 */
body.nf-theme .top-up-dialog,
body.nf-theme .announcement-dialog,
body.nf-theme .asset-modal-dialog {
  max-height: calc(100vh - 48px);
}

body.nf-theme .top-up-dialog:not(.referral-dialog) {
  width: min(960px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
}

body.nf-theme .top-up-dialog:not(.referral-dialog) .app-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 16px 20px;
  align-content: start;
  overflow-y: auto;
}

body.nf-theme .top-up-dialog:not(.referral-dialog) .app-modal-body > .campaign-progress-card {
  grid-column: 1 / -1;
}

body.nf-theme .top-up-dialog:not(.referral-dialog) .app-modal-body > .top-up-qr-grid {
  grid-column: 1;
  margin: 0;
}

body.nf-theme .top-up-dialog:not(.referral-dialog) .app-modal-body > .top-up-redeem-form {
  grid-column: 1;
  margin: 0;
  padding: 0;
  border: 0;
}

body.nf-theme .top-up-dialog:not(.referral-dialog) .app-modal-body > .top-up-bonus {
  grid-column: 2;
  grid-row: span 2;
  margin: 0;
  padding: 0 0 0 20px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

body.nf-theme .top-up-dialog:not(.referral-dialog) .app-modal-body > .campaign-progress-card + .top-up-qr-grid ~ .top-up-bonus {
  grid-row: 2 / span 2;
}

body.nf-theme .top-up-dialog.referral-dialog {
  width: min(860px, calc(100% - 32px));
}

body.nf-theme .top-up-dialog.referral-dialog .app-modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  align-content: start;
  overflow-y: auto;
}

body.nf-theme .top-up-dialog.referral-dialog .app-modal-body > p,
body.nf-theme .top-up-dialog.referral-dialog .app-modal-body > .referral-stats-grid {
  grid-column: 1 / -1;
  margin: 0;
}

body.nf-theme .top-up-dialog.referral-dialog .referral-link-panel {
  margin: 0;
  padding: 0;
  border: 0;
}

/* 推广 v2 弹窗：一列排下来（说明 → 链接 → 四个数 → 规则 → 明细），明细表自己滚 */
body.nf-theme .top-up-dialog.referral-v2-dialog {
  width: min(720px, calc(100% - 32px));
}
body.nf-theme .top-up-dialog.referral-v2-dialog .app-modal-body {
  grid-template-columns: minmax(0, 1fr);
}
body.nf-theme .referral-v2-dialog .app-modal-body > * {
  grid-column: 1 / -1;
  margin: 0;
}
body.nf-theme .referral-v2-dialog .referral-v2-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
body.nf-theme .referral-v2-dialog .referral-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
body.nf-theme .referral-v2-dialog .referral-v2-state,
body.nf-theme .referral-v2-dialog .referral-v2-caps,
body.nf-theme .referral-v2-dialog .referral-v2-empty {
  color: var(--nf-ink-3, #8b8d94);
  font-size: 12.5px;
  line-height: 1.6;
}
body.nf-theme .referral-v2-dialog .referral-v2-detail h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}
body.nf-theme .referral-v2-dialog .referral-v2-table-wrap {
  max-height: 240px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
body.nf-theme .referral-v2-dialog .referral-v2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
body.nf-theme .referral-v2-dialog .referral-v2-table th,
body.nf-theme .referral-v2-dialog .referral-v2-table td {
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
body.nf-theme .referral-v2-dialog .referral-v2-table th {
  position: sticky;
  top: 0;
  background: #17181c;
  color: var(--nf-ink-3, #8b8d94);
  font-weight: 500;
}
@media (max-width: 720px) {
  body.nf-theme .referral-v2-dialog .referral-v2-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 大图预览：铺满视口（留边），不再卡 1200px */
body.nf-theme .task-image-preview-dialog {
  width: calc(100% - 48px);
  max-height: calc(100vh - 48px);
}

body.nf-theme .task-image-preview-image,
body.nf-theme .task-image-preview-video {
  max-height: calc(100vh - 48px);
}

/* 盖过手机顶栏（z-index 60）：否则顶部两颗按钮压在预览层上面 */
body.nf-theme #task-image-preview-modal {
  z-index: 120;
}

.task-image-preview-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

/* 素材拾取器：更大的网格，一屏多看几排 */
body.nf-shell.nf-theme.nf-theme .library-picker-dialog {
  width: min(1240px, calc(100% - 48px));
  height: min(860px, calc(100vh - 48px));
}

/* API 结果详情：左边参数 / 描述词 / 错误，右边产出，宽而矮 */
body.nf-theme .asset-modal-dialog.task-detail-dialog {
  width: min(1280px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
}

body.nf-theme .task-detail-dialog .task-detail-sheet:has(.task-detail-result-grid) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  column-gap: 24px;
  align-items: start;
}

body.nf-theme .task-detail-dialog .task-detail-sheet:has(.task-detail-result-grid) > .task-detail-head {
  grid-column: 1 / -1;
}

body.nf-theme .task-detail-dialog .task-detail-sheet:has(.task-detail-result-grid) > :not(.task-detail-head) {
  grid-column: 1;
}

body.nf-theme .task-detail-dialog .task-detail-sheet:has(.task-detail-result-grid) > .task-detail-section:has(.task-detail-result-grid) {
  grid-column: 2;
  grid-row: 2 / span 8;
  margin-top: 0;
}

body.nf-theme .task-detail-dialog .task-detail-result-card img {
  max-height: calc(100vh - 220px);
  object-fit: contain;
}

body.nf-theme .task-detail-dialog .task-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 开发者中心的 Key 弹窗：表单两列放得下，不必挤 */
body.nf-theme .developer-api-key-manage-dialog {
  width: min(640px, calc(100% - 32px));
}

@media (max-width: 760px) {
  body.nf-theme .top-up-dialog:not(.referral-dialog) .app-modal-body,
  body.nf-theme .top-up-dialog.referral-dialog .app-modal-body,
  body.nf-theme .task-detail-dialog .task-detail-sheet:has(.task-detail-result-grid) {
    display: flex;
    flex-direction: column;
  }

  body.nf-theme .top-up-dialog:not(.referral-dialog) .app-modal-body > .top-up-bonus {
    padding-left: 0;
    border-left: 0;
  }
}

/* 换域名提示条（app-shell.js 末尾）：顶栏下方居中的一条，可关闭；画布页同样适用，不挤占布局 */
.domain-moved-bar {
  position: fixed;
  top: 68px;   /* 顶栏（约 56px）下面，别盖住余额 */
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  padding: 9px 10px 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #1b1c21;
  color: #e9e9eb;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.domain-moved-bar button {
  flex: none;
  padding: 5px 12px;
  border-radius: 8px;
  background: #e6e7ea;
  color: #111214;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
