/* ============================================================================
 * Dooflo Design System —— 创作台视觉层
 * 2026-10-31 第七轮（审美整改）
 *
 * 为什么需要这一层：
 *   之前创作台所有面板都是同一套材质（bg-surface-950/60 + 1px 灰边框），
 *   参数按钮和能力按钮也全是同一种「白 4% 灰块」——
 *   结果是**没有层次**：输入区、参数区、预览区、结果区看上去像四个一样的灰盒子，
 *   眼睛找不到主次，这就是「廉价感」的根源。
 *
 * 这一层提供三件事：
 *   ① 材质分级：cf-panel（卡片）/ cf-glass（浮层）/ cf-well（内凹槽）
 *   ② 控件语法：cf-chip（参数胶囊）/ cf-seg（分段控件）/ cf-cta（主按钮）
 *   ③ 播放器语法：cf-stage + cf-meta-* + cf-dl-*（预览台与元信息、下载）
 *
 * 作用域：全部挂在 .cf-bench 之下 —— 不影响剧集创作与自由画布两个板块。
 * 特异度：嵌套选择器（0,2,0）> Tailwind CDN 运行时注入的单类（0,1,0），
 *         所以本文件的优先级永远高于 Tailwind 工具类，不会被覆盖。
 * ========================================================================== */

.cf-app,
.cf-bench,
.cf-longform,
.cf-canvas {
  /* ---- 品牌语义色（与 tailwind.config 对齐，组件里直接引用） ----
   * 注意：这一组是**默认值**；真实取值由 css/themes.css 的
   * `html[data-theme] .cf-bench` 覆盖（主题改的就是这一层令牌）。 */
  --cf-brand: #9333ea;
  --cf-brand-rgb: 147, 51, 234;
  --cf-brand-deep: #6b21a8;
  --cf-brand-deep-rgb: 107, 33, 168;
  --cf-brand-600: #7e22ce;
  --cf-brand-600-rgb: 126, 34, 206;
  --cf-brand-300: #d8b4fe;
  --cf-brand-300-rgb: 216, 180, 254;
  --cf-cyan: #06b6d4;
  --cf-cyan-rgb: 6, 182, 212;
  --cf-amber: #f59e0b;
  --cf-emerald: #10b981;
  --cf-rose: #f43f5e;

  /* ---- 文本层级（全面提高明暗对比度，杜绝灰暗模糊看不清） ---- */
  --cf-ink-1: #ffffff;
  --cf-ink-2: #e2e8f0;
  --cf-ink-3: #94a3b8;
  --cf-ink-4: #64748b;

  /* ---- 材质（深空蓝灰有层次质感，消除死黑） ---- */
  --cf-card-bg: linear-gradient(180deg, #131929 0%, #0e1422 100%);
  --cf-card-border: rgba(255, 255, 255, 0.14);
  --cf-card-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.95);
  --cf-hairline: rgba(255, 255, 255, 0.08);

  /* ---- 内部分隔线 ---- */
  --cf-divider: rgba(255, 255, 255, 0.16);
  --cf-divider-soft: rgba(255, 255, 255, 0.12);

  --cf-glass-bg: #0d121f;
  --cf-glass-border: rgba(255, 255, 255, 0.16);

  /* ---- 舞台（预览区）氛围光 ---- */
  --cf-stage-glow-a: rgba(147, 51, 234, 0.18);
  --cf-stage-glow-b: rgba(6, 182, 212, 0.12);
  --cf-stage-bg: #090d16;

  /* ---- 圆角 ---- */
  --cf-r-sm: 10px;
  --cf-r-md: 14px;
  --cf-r-lg: 18px;

  color: var(--cf-ink-2);
}

/* ============================================================================
 * ① 材质分级
 * ========================================================================== */

/* 卡片：渐变面 + 顶部高光 + 投影。比纯灰边框有「厚度」，但不做成发光边框（廉价感来源）。 */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-panel {
  position: relative;
  background: var(--cf-card-bg);
  border: 1px solid var(--cf-card-border);
  border-radius: var(--cf-r-lg);
  box-shadow: var(--cf-card-shadow);
  /* 注意：**不要**在这里用 isolation:isolate 建层级上下文。
   * 面板内有多处 position:fixed 的浮层（手机端底部 CTA 带 z-30、参数浮层 z-70、
   * 全屏提示词编辑器 z-70、能力坞浮层 z-76）；一旦本面板自成层级上下文，
   * 它们的 z-index 只在本面板内比较，会被**后面兄弟面板**（预览区）整块盖住。
   * 实测：CTA 带被 .cf-stage 压住、生成按钮点不到。
   * 这里保持 auto —— 面板不参与 z-index 比较，固定浮层直接与根层面对话。 */
}

/* 顶部 1px 高光：模拟顶光打在卡片棱上，是深色高级感的关键细节 */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.16) 18%,
    rgba(255, 255, 255, 0.16) 82%,
    transparent 100%);
  pointer-events: none;
  /* 用 0 而不是 1：面板不再自成层级上下文后，z-1 会让这根 1px 线
   * 盖到全页所有 z-auto 内容之上；z-0 只与同层兄弟按文档序比较。 */
  z-index: 0;
}

/* 内凹槽：放参数条 / 备注行，形成干净利落的沉浸层次 */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-well {
  background: #090d17;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--cf-r-md);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* 玻璃浮层：能力坞 / 各类小面板（实底不透底） */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-glass {
  background: #0d121f;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--cf-r-lg);
  box-shadow: 0 32px 64px -24px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ============================================================================
 * ①-b 内部分隔线 / 版块头（2026-10-31 收口）
 *
 * 作用域挂在 .cf-bench 下，特异度（0,2,0）高于 Tailwind 单类（0,1,0），
 * 直接覆盖组件模板里残留的 border-surface-border* 即可，无需 !important。
 * 用法：把模板里的 `border-b border-surface-border/70` 这类换成 `cf-sep-b`；
 *       需要"头/脚成为可辨识的区"时再叠加 `cf-zone-head`（淡底色 + 顶部高光）。
 * ========================================================================== */

.cf-bench .cf-sep  { border: 1px solid var(--cf-divider); }
.cf-bench .cf-sep-t { border-top: 1px solid var(--cf-divider); }
.cf-bench .cf-sep-b { border-bottom: 1px solid var(--cf-divider); }
.cf-bench .cf-sep-l { border-left: 1px solid var(--cf-divider); }
.cf-bench .cf-sep-r { border-right: 1px solid var(--cf-divider); }
.cf-bench .cf-sep-t-s { border-top: 1px solid var(--cf-divider-soft); }
.cf-bench .cf-sep-b-s { border-bottom: 1px solid var(--cf-divider-soft); }

/* 版块头 / 脚：在分隔线之上叠一层极淡底色，让"头"成为可辨识的区，而不只是根线。
 * 与 .cf-panel::before 同语言（顶光打在棱上）。 */
.cf-bench .cf-zone-head {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018));
}

/* 输入框聚焦态：cf-sep 的 resting 色（0,2,0）与 Tailwind focus:border-*（0,2,0）同特异度，
 * 源顺序不可靠。这里用（0,3,0）锁定聚焦描边为品牌色，确保聚焦高亮不被 resting 色压掉。 */
.cf-bench .cf-sep:focus,
.cf-bench .cf-sep-t:focus,
.cf-bench .cf-sep-b:focus,
.cf-bench .cf-sep-l:focus,
.cf-bench .cf-sep-r:focus,
.cf-bench .cf-sep-t-s:focus,
.cf-bench .cf-sep-b-s:focus {
  border-color: rgba(var(--cf-brand-rgb), 0.6);
}

/* cta-band 的边框带响应式开关（md:border-t-0 / md:border-l），不能用固定宽度的
 * cf-sep-* 类去替换（会压过响应式宽度开关）。这里只提色，宽度交给 Tailwind 响应式。 */
.cf-bench [data-role="cta-band"] { border-color: var(--cf-divider-soft); }

/* ============================================================================
 * ② 控件语法
 * ========================================================================== */

/* 参数胶囊：统一材质、图标有底色方块、选中时品牌色描边 */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--cf-r-sm);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--cf-ink-3);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
  cursor: pointer;
}

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-chip:hover {
  color: var(--cf-ink-1);
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(var(--cf-brand-rgb), 0.34);
}

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-chip:active { transform: translateY(1px); }

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-chip.is-open,
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-chip.is-on {
  color: #fff;
  background: linear-gradient(180deg, rgba(var(--cf-brand-rgb), 0.26), rgba(var(--cf-brand-rgb), 0.1));
  border-color: rgba(var(--cf-brand-rgb), 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 8px 20px -12px rgba(var(--cf-brand-rgb), 0.9);
}

/* 图标底块：让每个入口有独立色相，一眼分辨「风格 / 模板 / 技能」 */
.cf-bench .cf-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 10px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.07);
  color: var(--cf-ink-3);
  transition: background-color 0.16s ease, color 0.16s ease;
}

.cf-bench .cf-ico.v-brand { background: rgba(var(--cf-brand-rgb), 0.18); color: var(--cf-brand-300, #c4b5fd); }
.cf-bench .cf-ico.v-cyan { background: rgba(var(--cf-cyan-rgb), 0.16); color: #67e8f9; }
.cf-bench .cf-ico.v-amber { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
.cf-bench .cf-ico.v-emerald { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-chip:hover .cf-ico,
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-chip.is-open .cf-ico { background: rgba(255, 255, 255, 0.12); }

/* 参数胶囊紧凑版（ux30）：
 * 创作台左栏实测只有 ~425px（1440 视口），5 个参数胶囊按默认尺寸合计 ~565px → 必然换行。
 * 这里把参数行的胶囊单独收紧（字号 13→12、图标块 22→16、padding 12→8），
 * 并让「参考素材」用更小的标签（11px），五个胶囊压到 ~390px，一排放得下。 */
.cf-bench .cf-pchip {
  font-size: 12px;
  font-weight: 600;
  padding: 0 8px;
  gap: 4px;
}

.cf-bench .cf-pchip .cf-ico {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  font-size: 8px;
}

.cf-bench .cf-pchip .cf-ico i { font-size: 8px; }

.cf-bench .cf-pchip-label {
  font-size: 11px;
  letter-spacing: .01em;
}

/* 分段控件容器：模式切换（图片 / 视频） */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-seg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(4, 7, 13, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--cf-ink-4);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
  cursor: pointer;
}

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-seg-btn:hover { color: var(--cf-ink-2); }

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-seg-btn.is-on {
  color: #fff !important;
  background: linear-gradient(180deg, #9333ea 0%, #7e22ce 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  box-shadow: 0 4px 14px -2px rgba(147, 51, 234, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
}

/* ============================================================================
 * 立体着色主按钮（生成图片 / 生成视频 / 批量生成）
 * 极致醒目、饱和度着色、3D 机械倒角高光、物理厚度、彩色光晕、按压回弹
 * ========================================================================== */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 24px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  /* 鲜亮璀璨的立体渐变着色：自顶部高亮紫过渡到深饱和底色 */
  background: linear-gradient(180deg,
    #a855f7 0%,
    #8b5cf6 36%,
    #7c3aed 72%,
    #6d28d9 100%
  ) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  /* 3D 机械倒角与物理厚度：
   * 1. 顶部 1.5px 极薄白高光棱（模拟晶体反光）
   * 2. 内部下压阴影（凹凸立体感）
   * 3. 底部 3.5px 物理键体厚度（3D 键帽实体厚度）
   * 4. 外部强劲的彩色霓虹光晕扩散（在深色背景上极其醒目）
   */
  box-shadow:
    inset 0 1.5px 0 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 0 0 rgba(0, 0, 0, 0.35),
    0 3.5px 0 0 #4c1d95,
    0 10px 24px -2px rgba(139, 92, 246, 0.75),
    0 0 0 1px rgba(139, 92, 246, 0.5);
  transform: translateY(0);
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.4, 1),
              box-shadow 0.12s cubic-bezier(0.2, 0.8, 0.4, 1),
              filter 0.12s ease;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta:hover {
  filter: brightness(1.12) saturate(1.15);
  transform: translateY(-1.5px);
  box-shadow:
    inset 0 1.5px 0 0 rgba(255, 255, 255, 0.75),
    inset 0 -2px 0 0 rgba(0, 0, 0, 0.35),
    0 5px 0 0 #4c1d95,
    0 14px 32px -2px rgba(139, 92, 246, 0.9),
    0 0 0 1px rgba(168, 85, 247, 0.7);
}

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta:active {
  filter: brightness(0.96);
  /* 机械按键物理下沉：3D 厚度被压下，触感反馈极强 */
  transform: translateY(2.5px);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.45),
    0 1px 0 0 #4c1d95,
    0 4px 12px -2px rgba(139, 92, 246, 0.5),
    0 0 0 1px rgba(139, 92, 246, 0.4);
}

/* ============================================================================
 * 立体着色功能按钮体系（3D Tactile Colored Buttons）
 * 触感实体厚度、顶部机械高光、底部暗部下压阴影、饱和着色、按压物理回弹
 * ========================================================================== */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  font-weight: 700;
  text-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.45);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.28),
    inset 0 -1.5px 0 0 rgba(0, 0, 0, 0.35),
    0 2px 4px -1px rgba(0, 0, 0, 0.5),
    0 1px 0 0 rgba(0, 0, 0, 0.6);
  transform: translateY(0);
  transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.4, 1),
              box-shadow 0.1s cubic-bezier(0.2, 0.8, 0.4, 1),
              filter 0.12s ease;
}

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d:hover:not(:disabled) {
  filter: brightness(1.1) saturate(1.12);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.42),
    inset 0 -1.5px 0 0 rgba(0, 0, 0, 0.35),
    0 3px 6px -1px rgba(0, 0, 0, 0.6),
    0 1px 0 0 rgba(0, 0, 0, 0.7);
}

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d:active:not(:disabled) {
  filter: brightness(0.96);
  transform: translateY(1.5px);
  box-shadow:
    inset 0 1px 2px 0 rgba(0, 0, 0, 0.5),
    0 0.5px 0 0 rgba(0, 0, 0, 0.6);
}

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
  transform: none;
  box-shadow: none;
}

/* 品牌紫（主操作 / 植入@ / 模型选择） */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d-brand {
  background: linear-gradient(180deg, #9333ea 0%, #7e22ce 50%, #6b21a8 100%) !important;
  border: 1px solid rgba(216, 180, 254, 0.4) !important;
  color: #ffffff !important;
}

/* 青蓝（分镜图 / 批量生图） */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d-cyan {
  background: linear-gradient(180deg, #06b6d4 0%, #0891b2 50%, #0e7490 100%) !important;
  border: 1px solid rgba(165, 243, 252, 0.45) !important;
  color: #ffffff !important;
}

/* 紫罗兰（视频提示词 / 批量生视频 / 单镜生视频） */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d-violet {
  background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%) !important;
  border: 1px solid rgba(196, 181, 253, 0.45) !important;
  color: #ffffff !important;
}

/* 翡翠绿（保存提示词 / 保存台词 / 看小说） */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d-emerald {
  background: linear-gradient(180deg, #10b981 0%, #059669 50%, #047857 100%) !important;
  border: 1px solid rgba(167, 243, 208, 0.45) !important;
  color: #ffffff !important;
}

/* 琥珀金（本剧资产 / AI生成提示词 / 看剧本） */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d-amber {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 50%, #b45309 100%) !important;
  border: 1px solid rgba(254, 243, 199, 0.5) !important;
  color: #111827 !important;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.35);
}

/* 珊瑚红（重写剧本 / 危险操作） */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d-rose {
  background: linear-gradient(180deg, #f43f5e 0%, #e11d48 50%, #be123c 100%) !important;
  border: 1px solid rgba(254, 205, 211, 0.45) !important;
  color: #ffffff !important;
}

/* 天空蓝（重新生成分镜） */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d-sky {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 50%, #0369a1 100%) !important;
  border: 1px solid rgba(186, 230, 253, 0.5) !important;
  color: #ffffff !important;
}

/* 深邃金属（放大编辑 / 辅助操作 / 进度总览） */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d-dark {
  background: linear-gradient(180deg, #232c3f 0%, #171f2d 50%, #0f1520 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #e2e8f0 !important;
}

/* 豪华渐变（导出剪映草稿包） */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d-gradient {
  background: linear-gradient(135deg, #7c3aed 0%, #0891b2 50%, #059669 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.4),
    inset 0 -1.5px 0 0 rgba(0, 0, 0, 0.35),
    0 3px 8px -1px rgba(124, 58, 237, 0.5),
    0 1px 0 0 rgba(0, 0, 0, 0.6) !important;
}

/* ============================================================================
 * 全局弹窗 / 抽屉 / 对话框最高实底规范（100% 绝对不透明纯深色底，彻底杜绝穿透，字字清晰）
 * ========================================================================== */
.cf-modal-solid {
  background-color: #0b0f19 !important;
  background-image: linear-gradient(180deg, #121826 0%, #0b0f19 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 32px 80px -16px rgba(0, 0, 0, 0.98), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

.cf-modal-solid-head {
  background-color: #121826 !important;
  background-image: linear-gradient(180deg, #172033 0%, #121826 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.cf-modal-solid-card {
  background-color: #131b2e !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.cf-modal-solid-input {
  background-color: #070a12 !important;
  border: 1px solid rgba(255, 255, 255, 0.20) !important;
  color: #ffffff !important;
}

.cf-modal-solid-foot {
  background-color: #121826 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
}

/* ============================================================================
 * 遮罩层（2026-11-08 用户反馈改版）
 * 旧版 rgba(0,0,0,.82)+blur(8px)：弹窗一出来底层全黑，用户失去「我从哪来的」上下文，
 * 找不到自己刚点的东西，体验很闷。新策略：
 *   ① 普通对话框只做「压暗 + 轻微失焦」，底层仍隐约可辨（cf-overlay / cf-modal-backdrop）
 *   ② 只有看图/看视频的 lightbox 才用重遮罩（cf-overlay-strong），因为此时重点是媒体本身
 *   ③ 弹窗自身仍是不透明面板，可读性由面板负责，不靠遮罩加深
 * ========================================================================== */
.cf-overlay,
.cf-modal-backdrop {
  background-color: rgba(3, 7, 18, 0.55) !important;
  backdrop-filter: blur(3px) !important;
  -webkit-backdrop-filter: blur(3px) !important;
}

.cf-overlay-strong {
  background-color: rgba(0, 0, 0, 0.82) !important;
  backdrop-filter: blur(2px) !important;
  -webkit-backdrop-filter: blur(2px) !important;
}

/* 触屏：可点面积 ≥28×28（用户反馈删项目/复制/关闭这些小图标点不到） */
.cf-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 8px;
}

@media (pointer: coarse) {
  .cf-icon-btn {
    min-width: 32px !important;
    min-height: 32px !important;
  }
}

/* 次级按钮 */
.cf-bench .cf-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--cf-r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--cf-ink-3);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: all 0.16s ease;
  cursor: pointer;
}

.cf-bench .cf-btn-ghost:hover {
  color: var(--cf-ink-1);
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(var(--cf-brand-rgb), 0.34);
}

/* 小节标签：面板内的分区标题，带一竖道 */
.cf-bench .cf-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cf-ink-4);
}

.cf-bench .cf-eyebrow::before {
  content: "";
  width: 3px;
  height: 11px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cf-brand), rgba(var(--cf-cyan-rgb), 0.85));
}

/* ============================================================================
 * ③ 编辑器（提示词区）
 * ========================================================================== */

.cf-bench .cf-editor {
  background: linear-gradient(180deg, rgba(7, 10, 17, 0.72) 0%, rgba(5, 8, 14, 0.55) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--cf-r-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cf-bench .cf-editor:focus-within {
  border-color: rgba(var(--cf-brand-rgb), 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 3px rgba(var(--cf-brand-rgb), 0.11),
    0 20px 44px -30px rgba(var(--cf-brand-rgb), 0.9);
}

/* 编辑器顶栏：把「模式 + 字数」从正文里抽出来，正文区更干净 */
.cf-bench .cf-editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--cf-divider-soft);
  background: rgba(255, 255, 255, 0.022);
}

.cf-bench .cf-editor-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--cf-ink-4);
}

.cf-bench .cf-editor-count.is-warn { color: var(--cf-amber); }

/* 正文区：左侧一条品牌色渐变道，暗示「从这里开始写」 */
.cf-bench .cf-editor-body {
  position: relative;
}

.cf-bench .cf-editor-body::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, rgba(var(--cf-brand-rgb), 0.85), rgba(var(--cf-cyan-rgb), 0.15));
  opacity: 0.75;
  pointer-events: none;
}

.cf-bench .cf-editor textarea {
  caret-color: var(--cf-brand);
  /* 防御性声明：提示词是正文，必须始终可鼠标框选 / Ctrl+A 全选。
     表单控件默认 auto 即等价 text，这里显式写死，避免父级或运行时 CDN
     Tailwind 规则（如被误伤成 user-select:none）导致拖不出高亮、只能逐字删。 */
  user-select: text;
  -webkit-user-select: text;
}

.cf-bench .cf-editor textarea::placeholder {
  color: rgba(148, 163, 184, 0.62);
}

/* 编辑器嵌在 cf-panel 卡片里时「去掉自身外框」——
   卡片已经是一层材质了，里面再套一个带边框的方框就成了「盒中盒」，廉价感正来自这种套娃。
   手机全屏编辑态（fixed inset-0）不在 .cf-panel 内，仍保留完整编辑器材质。 */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-panel > .cf-editor {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-panel > .cf-editor:focus-within {
  border-color: transparent;
  box-shadow: none;
}

:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-panel > .cf-editor .cf-editor-bar {
  background: rgba(255, 255, 255, 0.028);
  border-bottom-color: var(--cf-divider-soft);
}

/* 备注行 */
.cf-bench .cf-note-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-top: 1px solid var(--cf-divider-soft);
  background: rgba(0, 0, 0, 0.16);
}

/* ============================================================================
 * ④ 播放器（预览台）
 * ========================================================================== */

/* 舞台底：中心微光 + 四角压暗 = 「一块发光的屏幕」，而不是一块黑纸 */
.cf-bench .cf-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 78% at 50% 12%, var(--cf-stage-glow-a) 0%, transparent 58%),
    radial-gradient(90% 60% at 50% 100%, var(--cf-stage-glow-b) 0%, transparent 62%),
    var(--cf-stage-bg);
}

.cf-bench .cf-stage-media {
  border-radius: 12px;
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.07);
}

/* 元信息栏：视频 = 时长 / 分辨率 / 生成时间；图片 = 分辨率 */
.cf-bench .cf-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--cf-divider-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(0, 0, 0, 0.2));
}

.cf-bench .cf-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--cf-ink-3);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.075);
  white-space: nowrap;
}

.cf-bench .cf-meta i { font-size: 9px; opacity: 0.8; }

.cf-bench .cf-meta.v-brand i { color: var(--cf-brand-300, #c4b5fd); }
.cf-bench .cf-meta.v-cyan i { color: #67e8f9; }
.cf-bench .cf-meta.v-amber i { color: #fcd34d; }

/* 标签：让用户知道这一项是什么（只有数字是读不懂的） */
.cf-bench .cf-meta-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cf-ink-4);
}

.cf-bench .cf-meta-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--cf-ink-1);
  letter-spacing: 0.01em;
}

/* 下载按钮：明确、大、带文案（不能只是一个小图标） */
.cf-bench .cf-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--cf-r-md);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--cf-cyan) 0%, var(--cf-cyan-deep, #0e7490) 100%);
  border: 1px solid rgba(var(--cf-cyan-rgb), 0.4);
  box-shadow:
    0 14px 30px -14px rgba(var(--cf-cyan-rgb), 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  cursor: pointer;
}

.cf-bench .cf-dl:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow:
    0 18px 36px -14px rgba(var(--cf-cyan-rgb), 1),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.cf-bench .cf-dl:active { transform: translateY(0); }

/* ============================================================================
 * ⑤ 结果网格
 * ========================================================================== */

.cf-bench .cf-res-card {
  border-radius: var(--cf-r-md);
  background: rgba(4, 7, 13, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 12px 28px -20px rgba(0, 0, 0, 0.9);
  transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.cf-bench .cf-res-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--cf-brand-rgb), 0.42);
  box-shadow: 0 18px 34px -20px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(var(--cf-brand-rgb), 0.12);
}

.cf-bench .cf-res-card.is-selected {
  border-color: rgba(var(--cf-brand-rgb), 0.72);
  box-shadow: 0 0 0 1px rgba(var(--cf-brand-rgb), 0.4), 0 20px 40px -22px rgba(var(--cf-brand-rgb), 0.85);
}

/* ============================================================================
 * ⑥ 灵感 chip
 * ========================================================================== */

.cf-bench .cf-spark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 20rem;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--cf-ink-3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.18s ease;
  cursor: pointer;
}

.cf-bench .cf-spark:hover {
  color: var(--cf-ink-1);
  border-color: rgba(var(--cf-brand-rgb), 0.42);
  background: linear-gradient(180deg, rgba(var(--cf-brand-rgb), 0.2), rgba(var(--cf-brand-rgb), 0.06));
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -14px rgba(var(--cf-brand-rgb), 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.cf-bench .cf-spark .fa-wand-magic-sparkles { color: var(--cf-brand-300, #c4b5fd); }

/* 演示条：一行横排，窄屏横向滚动（**不换行**）
 *
 * 为什么不用 flex-wrap：
 *   换行会把创作台底部撑高，把「生成视频」主按钮挤出视口。
 *   演示条是横向导航条，放不下就该横着滚，而不是把版面撑开。
 */
.cf-bench .cf-spark-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cf-bench .cf-spark-row::-webkit-scrollbar { display: none; }

/* chip 本体在横排行里不许被压扁 */
.cf-bench .cf-spark-row > .cf-spark {
  flex: 0 0 auto;
  max-width: 22rem;
}

/* chip 里的次要说明（时长 · 画幅） */
.cf-bench .cf-spark .cf-spark-sub {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--cf-ink-4, #7c8aa0);
  padding-left: 7px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

/* chip 内的复制按钮：悬停才显形，避免抢标题的视觉重心 */
.cf-bench .cf-spark .cf-spark-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 2px;
  margin-right: -4px;
  border-radius: 999px;
  color: var(--cf-ink-4, #7c8aa0);
  opacity: 0.55;
  transition: opacity 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.cf-bench .cf-spark:hover .cf-spark-copy,
.cf-bench .cf-spark .cf-spark-copy:hover {
  opacity: 1;
  color: var(--cf-brand-200, #ddd6fe);
  background: rgba(255, 255, 255, 0.09);
}

/* 已载入的案例：点过的 chip 保持品牌色高亮 —— 用户一眼知道提示词框里装的是哪一条 */
.cf-bench .cf-spark.is-active {
  color: var(--cf-ink-1);
  border-color: rgba(var(--cf-brand-rgb), 0.55);
  background: linear-gradient(180deg, rgba(var(--cf-brand-rgb), 0.26), rgba(var(--cf-brand-rgb), 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ============================================================================
 * ⑦ 参数行 / 动作行（2026-10-31 用户反馈：提示词优化要并到参数行）
 *
 * 改动前（桌面）：
 *   [参考附件][模型][时长][分辨率][画幅]
 *   [提示词优化 +5]      [约8积分·余额4] [生成视频]
 *   —— 动作行独占一整行，左边空一大块，信息密度低。
 *
 * 改动后（桌面）：
 *   [参考附件][模型][时长][分辨率][画幅]        [提示词优化 +5]
 *                                            [约8积分·余额4] [生成视频]
 *   —— 「提示词优化」提到参数行末尾（视觉上紧跟最后一个参数胶囊），
 *      动作行只剩「成本 + 主按钮」并右对齐。
 *
 * 实现方式：**Grid 布局**，不用 absolute。
 *   原因（实测踩坑）：band 本身是 `display:flex; align-items:center` 的 flex 容器，
 *   绝对定位子元素的 `top` 会被 align-self 覆盖而**完全失效**（设 top:0 / top:-300px 都不动），
 *   按钮会卡在 band 的静态位置。Grid 是确定性的，直接把四个元素摆到四个格子。
 *   `display:contents` 让 band 的子元素直接成为父级网格项（band 自己不再生成盒子）。
 * ========================================================================== */

@media (min-width: 768px) {
  .cf-bench .cf-param-row-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 8px;
    align-items: center;
  }

  /* 动作行拆开：band 自身不再生成盒子，子元素直接进父级网格 */
  .cf-bench .cf-param-row-stack > .cf-cta-band { display: contents; }

  /* 第 1 行：参数胶囊**独占整行**。
   * 旧版把「提示词优化」塞在第 2 列，参数胶囊只剩 ~263px → 5 个胶囊挤成 3 行（16:9 孤零零掉行）。
   * 现在胶囊区拿满整行宽度，且永远不换行（放不下就横向滑动）。 */
  .cf-bench .cf-param-row-stack > .cf-param-scroll {
    grid-column: 1 / -1;
    grid-row: 1;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
  }

  /* 第 2 行：提示词优化（左）… 成本 + 唯一主按钮（右），左右都有内容，不再左空右挤 */
  .cf-bench .cf-param-row-stack > .cf-cta-band > [data-param="optimize"] {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    align-self: center;
    /* 品牌色底，和周围的「灰胶囊」区分开 */
    color: var(--cf-ink-2);
    background: rgba(var(--cf-brand-rgb), 0.13);
    border-color: rgba(var(--cf-brand-rgb), 0.34);
  }
  .cf-bench .cf-param-row-stack > .cf-cta-band > [data-param="optimize"]:hover {
    color: #fff;
    background: rgba(var(--cf-brand-rgb), 0.24);
    border-color: rgba(var(--cf-brand-rgb), 0.55);
  }

  /* 第 2 行：成本 + 唯一主按钮（右对齐） */
  .cf-bench .cf-param-row-stack > .cf-cta-band > [data-cost-summary] {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    align-self: center;
  }
  .cf-bench .cf-param-row-stack > .cf-cta-band > [data-primary="generate"] {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    align-self: center;
  }
}

/* ============================================================================
 * ⑧ 移动端（<= 767px）
 * ========================================================================== */

@media (max-width: 767px) {
  /* 手机端所有可点元素 ≥44px 触摸区 */
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-chip,
  .cf-bench .cf-btn-ghost,
  .cf-bench .cf-spark { min-height: 44px; }

  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta,
  .cf-bench .cf-dl { min-height: 48px; }

  /* 模式切换（图片 / 视频）：触摸区从 36px 提到 44px */
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-seg-btn { min-height: 44px; padding: 0 16px; }

  /* 预览台：手机上放宽高度限制，让作品看得更清楚 */
  .cf-bench .cf-stage { min-height: 300px; }

  /* 元信息胶囊在窄屏换行成 2 列排布，不横向溢出 */
  .cf-bench .cf-meta-bar { gap: 7px; padding: 10px 12px; }

  .cf-bench .cf-meta { height: 30px; padding: 0 11px; font-size: 12px; }

  /* 段落标签在手机上不占空间 */
  .cf-bench .cf-eyebrow { font-size: 10px; letter-spacing: 0.07em; }

  /* ------------------------------------------------------------------
   * ① 底部 CTA 带：375px 下三件（优化 / 成本 / 生成）合计 ~382px > 可用 351px，
   *    「生成图片」被推出屏幕右边界。改成两行：第一行优化 + 成本，第二行主按钮整宽。
   * ---------------------------------------------------------------- */
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta-band {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 8px 12px 10px;
  }

  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta-band > [data-cost-summary] { margin-left: auto; }

  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta-band > [data-primary="generate"] {
    flex-basis: 100%;
    width: 100%;
    justify-content: center;
  }

  /* ------------------------------------------------------------------
   * ② 参数行横滑：右侧渐隐提示「还能往右滑」，滑到头自动取消渐隐。
   *    类名由 ParamBar 的 syncParamHint() 实时切换（has-more / no-more）。
   * ---------------------------------------------------------------- */
  .cf-bench .cf-param-scroll.has-more {
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 30px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 30px), transparent 100%);
  }

  .cf-bench .cf-param-scroll.no-more {
    -webkit-mask-image: none;
    mask-image: none;
  }

  /* ------------------------------------------------------------------
   * ③ 能力坞：375px 下「风格 / 模板」一行、「技能」另起一行，视觉不平衡。
   *    收敛成一行三个等宽入口；「能力」标签在窄屏隐藏（三个图标已自解释）。
   * ---------------------------------------------------------------- */
  .cf-bench [data-role="capability-dock"] { flex-wrap: nowrap; gap: 6px; }

  .cf-bench [data-role="capability-dock"] > .cf-eyebrow { display: none; }

  .cf-bench [data-role="capability-dock"] > .cf-chip {
    flex: 1 1 0;
    justify-content: center;
    padding: 0 6px;
    gap: 5px;
  }

  .cf-bench [data-role="capability-dock"] > .cf-chip .cf-ico { width: 20px; height: 20px; }
}

/* ============================================================================
 * 无障碍：焦点可见 / 动效降级 (2026-11-08, v20261108-prod80)
 * 本节只做「追加」：上方既有规则一律保持原样，不修改、不删除任何一行。
 *   ① 键盘焦点环 —— 只在 :focus-visible 生效，鼠标/触摸点击不出现焦点环
 *   ② 动效降级   —— prefers-reduced-motion: reduce 下去位移、去缩放，
 *                   保留亮度/底色这类静态反馈（hover 仍看得出可点）
 * ========================================================================== */

/* ----------------------------------------------------------------------------
 * 焦点环令牌：复用上方 .cf-app / .cf-bench / .cf-longform / .cf-canvas 令牌层
 * （文件开头 L21-24 那组 --cf-* 默认值），就近声明：不污染 :root，
 * 也不干扰 themes.css 的 html[data-theme] 主题覆盖链。
 * -------------------------------------------------------------------------- */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) {
  --cf-focus-ring: rgba(168, 85, 247, 0.95);
  --cf-focus-ring-inner: rgba(255, 255, 255, 0.65);
  --cf-focus-ring-width: 2px;
  --cf-focus-ring-offset: 2px;
}

/* ----------------------------------------------------------------------------
 * ① 键盘焦点环（WCAG 2.4.7 Focus Visible）
 * 作用域与既有组件约定一致；只写 :focus-visible、不写 :focus，
 * 因此鼠标点击 / 触摸不会冒出焦点环，键盘 Tab 才出现。
 * 刻意不写 border-radius —— 焦点环必须跟随元素自身圆角，
 * 否则胶囊形按钮、圆形图标按钮的环会被切成方块。
 *
 * outline / outline-offset 加 !important 的理由（只加这两个属性）：
 *   本仓库页面大量使用 Tailwind 工具类与 UA 默认样式，输入类控件
 *   （input / textarea / select）常被重置成 outline: none，
 *   `:focus  outline: 0` 之类的写法也会把 UA 焦点环冲掉；
 *   而 :focus-visible 的选择器特异性不足以在所有场景压过这些重置。
 *   焦点可见是硬性无障碍要求，必须保证生效，故只对这两个「纯焦点指示」
 *   属性加 !important；颜色、背景、字体、尺寸等一律不加，
 *   避免影响既有视觉体系与主题令牌。
 * -------------------------------------------------------------------------- */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) :is(
  a[href],
  button,
  [role="button"],
  input,
  select,
  textarea,
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: var(--cf-focus-ring-width) solid var(--cf-focus-ring) !important;
  outline-offset: var(--cf-focus-ring-offset) !important;
  /* 1px 白色内描边：紫色环与品牌紫按钮（#9333ea 系）明度接近时作分离带，
   * 深色面板（#0d121f）与浅色卡片上都能辨识 */
  box-shadow: 0 0 0 1px var(--cf-focus-ring-inner);
}

/* 说明：.cf-btn-3d / .cf-cta 聚焦时，box-shadow 会被上面那 1px 白色分离带接管
 * （3D 厚度阴影让位给焦点环）。这是刻意取舍：焦点态以「环」为唯一强信号，
 * 避免为了补回厚度而在这里复制一份上方 L323-328 / L377-381 的阴影数值，
 * 造成两处魔法数字不同步。松焦后厚度阴影立即恢复，无布局跳动。 */

/* ----------------------------------------------------------------------------
 * ② 动效降级：prefers-reduced-motion: reduce
 * 只屏蔽「位移 / 缩放 / 过渡 / 循环动画」，保留「变亮 / 变暗 / 换底色」
 * 这类静态状态反馈，避免降级后 hover 完全没有回应。
 * 这里的 box-shadow 不加 !important：本节在文件末尾，同特异性下后写者胜，
 * 足以压过上方 L388 / L398 / L338 / L349 的 hover / active 阴影。
 * -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  /* 3D 实体按钮与主 CTA：去掉抬升/下压位移，去掉过渡与循环动画 */
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d,
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d:hover:not(:disabled),
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d:active:not(:disabled),
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta,
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta:hover,
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta:active {
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  /* 静态厚度阴影：按钮保持键帽层次，但阴影不随 hover/active 变化
   * （阴影变化本身就是「阴影过渡」；hover 反馈交给上方 filter 提亮） */
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d,
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d:hover:not(:disabled),
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-btn-3d:active:not(:disabled) {
    box-shadow:
      inset 0 1px 0 0 rgba(255, 255, 255, 0.28),
      inset 0 -1.5px 0 0 rgba(0, 0, 0, 0.35),
      0 2px 4px -1px rgba(0, 0, 0, 0.5),
      0 1px 0 0 rgba(0, 0, 0, 0.6);
  }

  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta,
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta:hover,
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) .cf-cta:active {
    box-shadow:
      inset 0 1.5px 0 0 rgba(255, 255, 255, 0.55),
      inset 0 -2px 0 0 rgba(0, 0, 0, 0.35),
      0 3.5px 0 0 #4c1d95,
      0 10px 24px -2px rgba(139, 92, 246, 0.75),
      0 0 0 1px rgba(139, 92, 246, 0.5);
  }

  /* 通用收敛：作用域内所有元素与伪元素的过渡/动画压到瞬时；
   * 顺带关闭平滑滚动（滚动位移对前庭敏感用户同样不适） */
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas),
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) *,
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) *::before,
  :is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}


/* ===========================================================================
 * 下拉选项可读性（2026-11-08）
 * 原生 <select> 的弹出列表由浏览器绘制，默认白底；我们给 select 设了浅色字
 * （text-slate-200）会被 <option> 继承，于是变成「白底白字」，几乎看不清。
 * 这里把 option 显式成深底浅字（Chrome/Edge/Firefox 都支持 option 的
 * color / background-color）；若某浏览器忽略这两条，会退回它自己的默认
 * 白底黑字，同样可读，不会再出现白底白字。
 * =========================================================================== */
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) select > option,
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) select > optgroup {
  background-color: #0f1420;
  color: #e5eaf3;
}
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) select > option:checked,
:is(.cf-app, .cf-bench, .cf-longform, .cf-canvas) select > option:hover {
  background-color: #1f2a3d;
  color: #ffffff;
}


/* 移动端 375 适配（2026-11-08） */
@media (max-width: 767px) {
  /* 底部导航（index.html 的 nav.md:hidden ... h-14 safe-bottom）：
   * Tailwind preflight 是 border-box，h-14 把总高钉死在 3.5rem，而 .safe-bottom 的
   * padding-bottom: env(safe-area-inset-bottom) 会从这 3.5rem 里再扣掉一段。
   * iPhone X / 11 Pro / 12 mini 这类 375×812 机型的 inset 是 34px，扣完内容区只剩
   * ~22px，而按钮本身要 49px，于是 flex 居中把图标+文字整体顶到导航栏上沿之外
   * （实测溢出 16px），文字正好落进 home indicator 遮挡区，同时与上方 .cf-cta-band
   * 重叠。这里让导航随 safe area 一起长高：无 inset 时仍是 3.5rem（等于原 h-14，
   * 不影响普通安卓机），有 inset 时总高 = 3.5rem + inset，与 ParamBar 里
   * .cf-cta-band 的 bottom: calc(3.5rem + env(safe-area-inset-bottom)) 严丝合缝。
   * 仅窄屏生效，桌面（>=768px）走 .md:flex 侧栏，此选择器匹配不到，行为不变。 */
  nav.safe-bottom {
    height: calc(3.5rem + env(safe-area-inset-bottom, 0px));
  }
}


/* 微图标热区与「悬停才出现」角标（2026-11-08 补：细节可用性）
 * 背景：chip 内 9px 图标、角标上的 16px 下载/放大按钮视觉尺寸太小捏不准，
 * 但直接把视觉做大又会撑破 chip / 盖住缩略图。这里不动外观，只用 ::before
 * 把可点热区补到 28×28（绝对定位、不参与布局），鼠标/触屏都好按。 */
.cf-hit-28 {
  position: relative;
}
.cf-hit-28::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 28px);
  height: max(100%, 28px);
  transform: translate(-50%, -50%);
  border-radius: 8px;
}

/* 「悬停才出现」的角标（缩略图上的下载/放大/加入资产）在触屏上根本没有 hover，
 * 等于永远点不到；这里在无 hover 能力的设备上强制常显，桌面仍是 hover 渐显。 */
@media (hover: none), (pointer: coarse) {
  .cf-hover-reveal {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
}
