/* ============================================================
   橡小图AI · 星核Core AI 风格主题层（starcore-theme.css）
   设计规范来源：xingmaai.top 官方前端（ui-theme.css + 工作台页面）
   原则：只覆盖视觉（配色/阴影/圆角/动效/背景光斑），不改任何布局与功能逻辑
   加载顺序：本文件必须在 macos-theme.css 之后加载
   双模式：暗色 = 星核靛蓝工作台；浅色 = 星核暖白官网风
   ============================================================ */

/* ---------- 1. 共享令牌（缓动 / 圆角 / 品牌色，两种模式通用） ---------- */
:root {
  --sc-accent: #6366f1;
  --sc-accent-2: #818cf8;
  --sc-accent-deep: #4f46e5;
  --sc-accent-grad: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  --sc-ease-out: cubic-bezier(.16, 1, .3, 1);
  --sc-ease-smooth: cubic-bezier(.4, 0, .2, 1);
  --sc-ease-spring: cubic-bezier(.34, 1.56, .64, 1);   /* 回弹过冲：入场/抬升有弹性 */
  --sc-ease-snap: cubic-bezier(.22, 1, .36, 1);          /* 更利落的强缓出 */
  --sc-radius-lg: 16px;
  --sc-radius-md: 12px;
  --sc-radius-sm: 10px;
}

/* ---------- 2. 暗色令牌（星核靛蓝工作台） ---------- */
body.theme-dark {
  color-scheme: dark;
  --bg: #10141b;
  --panel: #191f2a;
  --card: #1e2531;
  --surface: #1e2531;
  --soft-line: rgba(148, 163, 184, .12);
  --line: rgba(148, 163, 184, .18);
  --line-strong: rgba(129, 140, 248, .34);
  --text: #edf2f7;
  --text-secondary: #c5cede;
  --text-muted: #aab4c3;
  --muted: #aab4c3;
  --muted-2: #8b96a8;
  --accent: #818cf8;
  --accent-strong: #a5b4fc;
  --accent-end: #4f46e5;
  --accent-soft: rgba(99, 102, 241, .18);
  --ok: #10b981;
  --danger: #ef4444;
  --shadow: 0 14px 38px rgba(0, 0, 0, .24);

  --sc-glass: rgba(25, 31, 42, .94);
  --sc-glass-2: rgba(25, 31, 42, .88);
  --sc-topbar-bg: rgba(21, 26, 35, .78);
  --sc-input-bg: rgba(148, 163, 184, .07);
  --sc-input-border: rgba(148, 163, 184, .18);
  --sc-ghost-bg: rgba(148, 163, 184, .08);
  --sc-ghost-border: rgba(148, 163, 184, .2);
  --sc-ghost-hover-bg: rgba(99, 102, 241, .14);
  --sc-ghost-hover-border: rgba(129, 140, 248, .4);
  --sc-ghost-hover-text: #c7d2fe;
  --sc-chip-bg: rgba(99, 102, 241, .22);
  --sc-chip-border: rgba(129, 140, 248, .5);
  --sc-scroll-thumb: rgba(148, 163, 184, .22);
  --sc-scroll-thumb-hover: rgba(148, 163, 184, .32);
  --sc-shadow-hover: 0 18px 44px rgba(0, 0, 0, .32);
  --sc-card-lift-shadow: 0 24px 52px -12px rgba(0, 0, 0, .58), 0 14px 32px -10px rgba(99, 102, 241, .38);
  --sc-glow: 0 12px 24px rgba(99, 102, 241, .24);
}

/* ---------- 2b. 浅色令牌（星核暖白官网风） ---------- */
body:not(.theme-dark) {
  color-scheme: light;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --card: #ffffff;
  --surface: #ffffff;
  --soft-line: rgba(15, 23, 42, .06);
  --line: rgba(15, 23, 42, .10);
  --line-strong: rgba(79, 70, 229, .30);
  --text: #1f2430;
  --text-secondary: #3a4252;
  --text-muted: #6b7488;
  --muted: #6b7488;
  --muted-2: #9aa3b5;
  --accent: #4f46e5;
  --accent-strong: #6366f1;
  --accent-end: #4f46e5;
  --accent-soft: rgba(79, 70, 229, .12);
  --ok: #059669;
  --danger: #dc2626;
  --shadow: 0 14px 38px rgba(15, 23, 42, .10);

  --sc-glass: rgba(255, 255, 255, .82);
  --sc-glass-2: rgba(255, 255, 255, .9);
  --sc-topbar-bg: rgba(255, 255, 255, .75);
  --sc-input-bg: rgba(15, 23, 42, .04);
  --sc-input-border: rgba(15, 23, 42, .12);
  --sc-ghost-bg: rgba(15, 23, 42, .04);
  --sc-ghost-border: rgba(15, 23, 42, .10);
  --sc-ghost-hover-bg: rgba(79, 70, 229, .10);
  --sc-ghost-hover-border: rgba(79, 70, 229, .35);
  --sc-ghost-hover-text: #4338ca;
  --sc-chip-bg: rgba(79, 70, 229, .12);
  --sc-chip-border: rgba(79, 70, 229, .35);
  --sc-scroll-thumb: rgba(15, 23, 42, .18);
  --sc-scroll-thumb-hover: rgba(15, 23, 42, .30);
  --sc-shadow-hover: 0 18px 44px rgba(15, 23, 42, .16);
  --sc-card-lift-shadow: 0 24px 52px -12px rgba(15, 23, 42, .30), 0 14px 32px -10px rgba(99, 102, 241, .34);
  --sc-glow: 0 12px 24px rgba(79, 70, 229, .18);
}

/* ---------- 3. 页面背景 + 漂浮光斑动态层 ---------- */
/* 关闭原站杂乱装饰：彩色彩屑 & 星空画布（纯装饰，非功能） */
.confetti-container { display: none !important; }
#homeStars { display: none !important; }

/* 漂浮光斑容器：固定在背景层、不挡交互 */
.sc-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.sc-ambient::before,
.sc-ambient::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  will-change: transform;
}

/* 暗色光斑：靛蓝 / 紫 / 青 弥散光晕 */
body.theme-dark .sc-ambient::before {
  inset: -10% -10% auto auto;
  width: 60vw; height: 60vw;
  background:
    radial-gradient(closest-side, rgba(129, 140, 248, .32), transparent 70%),
    radial-gradient(closest-side at 60% 40%, rgba(168, 85, 247, .22), transparent 70%);
  animation: sc-float-a 24s var(--sc-ease-smooth) infinite;
}
body.theme-dark .sc-ambient::after {
  inset: auto auto -15% -10%;
  width: 55vw; height: 55vw;
  background:
    radial-gradient(closest-side, rgba(34, 211, 238, .16), transparent 70%),
    radial-gradient(closest-side at 40% 50%, rgba(99, 102, 241, .20), transparent 70%);
  animation: sc-float-b 30s var(--sc-ease-smooth) infinite;
}

/* 浅色光斑：柔和靛蓝 / 蓝 / 粉，低饱和 */
body:not(.theme-dark) .sc-ambient::before {
  inset: -8% -8% auto auto;
  width: 58vw; height: 58vw;
  background:
    radial-gradient(closest-side, rgba(79, 70, 229, .14), transparent 70%),
    radial-gradient(closest-side at 60% 40%, rgba(99, 102, 241, .12), transparent 70%);
  animation: sc-float-a 24s var(--sc-ease-smooth) infinite;
}
body:not(.theme-dark) .sc-ambient::after {
  inset: auto auto -12% -8%;
  width: 52vw; height: 52vw;
  background:
    radial-gradient(closest-side, rgba(236, 72, 153, .08), transparent 70%),
    radial-gradient(closest-side at 40% 50%, rgba(56, 189, 248, .10), transparent 70%);
  animation: sc-float-b 30s var(--sc-ease-smooth) infinite;
}

/* 基础底色（光斑在其上漂浮） */
body.theme-dark {
  background:
    radial-gradient(1100px 520px at 50% -12%, rgba(129, 140, 248, .10), transparent 60%),
    linear-gradient(180deg, #10141b 0%, #151a23 48%, #11151d 100%) !important;
  background-attachment: fixed !important;
  color: var(--text) !important;
}
body:not(.theme-dark) {
  background:
    radial-gradient(1000px 480px at 50% -10%, rgba(99, 102, 241, .10), transparent 60%),
    linear-gradient(180deg, #f6f7fb 0%, #eef0f6 100%) !important;
  background-attachment: fixed !important;
  color: var(--text) !important;
}

@keyframes sc-float-a {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(6%, -4%, 0) scale(1.08); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes sc-float-b {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-5%, 5%, 0) scale(1.12); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

/* ---------- 4. 顶栏：星核毛玻璃 ---------- */
html .topbar {
  background: var(--sc-topbar-bg) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid var(--soft-line) !important;
  transition: background .3s var(--sc-ease-smooth), border-color .25s var(--sc-ease-smooth), box-shadow .3s var(--sc-ease-smooth);
}
html .logo-sub { color: var(--muted-2); }

html .nav-btn {
  color: var(--text-muted);
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease !important;
}
html .nav-btn:hover {
  background: rgba(148, 163, 184, .10);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
}
html .nav-btn.active {
  background: var(--accent-soft) !important;
  color: var(--accent-strong) !important;
  border-color: var(--line-strong) !important;
}
html .balance-box {
  background: var(--sc-ghost-bg) !important;
  border-color: var(--sc-ghost-border) !important;
}
html .balance-value { color: var(--accent-strong) !important; }

/* ---------- 5. 按钮：星核靛蓝渐变主按钮 ---------- */
html .btn,
html button.btn,
html .btn-ghost {
  transition: transform .2s var(--sc-ease-out), box-shadow .25s var(--sc-ease-out), background .18s ease, border-color .18s ease, color .18s ease, filter .18s ease !important;
}
html .btn:active { transform: translateY(0) scale(.96); }
html .btn-primary {
  background: var(--sc-accent-grad) !important;
  color: #fff !important;
  box-shadow: 0 10px 28px rgba(79, 70, 229, .28) !important;
  border: none !important;
}
html .btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 16px 38px rgba(79, 70, 229, .38) !important;
  filter: brightness(1.06);
}
html .btn-ghost {
  background: var(--sc-ghost-bg) !important;
  border-color: var(--sc-ghost-border) !important;
  color: var(--text-secondary) !important;
}
html .btn-ghost:hover {
  background: var(--sc-ghost-hover-bg) !important;
  border-color: var(--sc-ghost-hover-border) !important;
  color: var(--sc-ghost-hover-text) !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(99, 102, 241, .18);
}

/* ---------- 6. 面板与卡片：星核玻璃卡片 + 悬停浮起 ---------- */
html .panel {
  background: var(--sc-glass) !important;
  border: 1px solid var(--soft-line) !important;
  box-shadow: var(--shadow) !important;
  transition: transform .35s var(--sc-ease-out), box-shadow .35s var(--sc-ease-out), border-color .25s var(--sc-ease-smooth), background .3s var(--sc-ease-smooth) !important;
}
html .home-card {
  background: var(--sc-glass) !important;
  border: 1px solid var(--soft-line) !important;
  box-shadow: var(--shadow) !important;
  transition: transform .35s var(--sc-ease-out), box-shadow .35s var(--sc-ease-out), border-color .25s var(--sc-ease-smooth) !important;
}
/* 必须高于原站 body.theme-dark .home-card:hover(!important) 才能生效 */
html body.theme-dark .home-card:hover,
html body:not(.theme-dark) .home-card:hover {
  transform: translateY(-8px) !important;
  border-color: var(--line-strong) !important;
  box-shadow: var(--sc-card-lift-shadow), 0 0 0 1px rgba(129, 140, 248, .22) !important;
}
html .home-card-icon,
html body:not(.theme-dark) .home-card-icon {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  color: #fff !important;
  transition: transform .3s var(--sc-ease-out), box-shadow .3s var(--sc-ease-out);
}
html .home-card-icon .sc-ico { width: 21px; height: 21px; display: block; }
html .home-card:hover .home-card-icon { transform: scale(1.08) rotate(-4deg); box-shadow: 0 6px 16px rgba(99,102,241,.42) !important; }

/* ---------- 6b. 主标题：逐字从左到右依次展开（星核同款） ---------- */
html .home-title .sc-char {
  display: inline-block;
  opacity: 0;
  transform: translateX(-0.42em) translateY(.05em);
  filter: blur(9px);
  transition: opacity .5s var(--sc-ease-smooth), transform .62s var(--sc-ease-out), filter .55s var(--sc-ease-out);
  will-change: opacity, transform, filter;
  -webkit-text-fill-color: currentcolor !important; /* 关键：覆盖原站透明填充，确保大字可见 */
}
html .home-title.sc-title-in .sc-char {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
/* 覆盖原站 #page-home .home-title 的「扫光」效果（background-clip:text + 透明填充），
   该效果与逐字 span 拆分冲突导致主标题整体透明不可见。此处恢复纯色可见。 */
html #page-home .home-title,
html .home-title {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: currentcolor !important;
  color: #e9edf5 !important; /* 暗色：浅色大字 */
  animation: none !important;
}
html body.light #page-home .home-title,
html body.light .home-title {
  color: #1a202c !important; /* 亮色：深色大字 */
}

/* ---------- 6b-2. 品牌字「橡小图AI」彩色渐变高亮 ----------
   JS 已按字切片（background-size = N×100%、background-position 按序号位移），
   这里只负责把一整条渐变挂上去 + 用 background-clip:text 做彩色字。
   亮/暗两套配色：亮色用偏深的高饱和彩带（浅底上够彩又不糊），
   暗色提亮一档（深底上不发闷）。 */
html #page-home .home-title .sc-char.sc-brand,
html .home-title .sc-char.sc-brand {
  background-repeat: no-repeat !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  /* 渐变字不能参与 blur 入场：Chromium 在 filter:blur() 动画期间会放弃 background-clip:text，
     渐变会被画成模糊色块（像一团彩糊）。这里只保留位移+淡入，字始终锐利。 */
  filter: none !important;
  background-image: linear-gradient(92deg,
      #4f46e5 0%, #7c3aed 20%, #db2777 42%, #ea580c 62%, #059669 82%, #0891b2 100%) !important;
}
html body.theme-dark #page-home .home-title .sc-char.sc-brand,
html body.theme-dark .home-title .sc-char.sc-brand {
  background-image: linear-gradient(92deg,
      #818cf8 0%, #a78bfa 20%, #f472b6 42%, #fbbf24 62%, #34d399 82%, #38bdf8 100%) !important;
  /* 渐变字是「透明填充 + 背景裁剪」，深色描边阴影会从透明字形里透出来把彩色压成暗块，
     故品牌字去掉阴影（彩色本身对比度足够）。 */
  text-shadow: none !important;
}

/* ---------- 6b-3. 主标题 / 副标题禁止鼠标框选 ----------
   这两行是纯展示文案，选中没有任何用途：鼠标一划过就会拖出蓝色选区，
   而且会把逐字动画的 span 拆成一个个碎片，视觉上很脏。
   注意作用域只限 .home-hero（标题+副标题+光晕），不要下放到整个首页，
   否则下方的搜索输入框、卡片文案会跟着没法选中。 */
html .home-hero,
html .home-title,
html .home-title .sc-char,
html .home-desc {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 6c. 工作流底栏让出全局 ICP 备案条高度，避免被遮挡一半 ---------- */
html body.canvas-mode .wf-bottom-bar { bottom: 26px !important; }
html .wf-bottom-bar { bottom: 26px !important; }
html .card {
  background: var(--card);
  border-color: var(--soft-line);
  box-shadow: var(--shadow);
  transition: transform .35s var(--sc-ease-out), box-shadow .35s var(--sc-ease-out), border-color .25s var(--sc-ease-smooth);
}
html .card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--sc-shadow-hover), 0 0 0 1px rgba(129, 140, 248, .14);
  transform: translateY(-3px);
}

/* ---------- 7. 输入框：星核聚焦光晕 ---------- */
html .input,
html textarea.input,
html select.input {
  background: var(--sc-input-bg) !important;
  border-color: var(--sc-input-border) !important;
  color: var(--text) !important;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease !important;
}
html .input:focus {
  border-color: var(--line-strong) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
  background: var(--sc-input-bg) !important;
  outline: none !important;
}
html .input::placeholder { color: var(--muted-2) !important; }
html .input:focus-visible, html button:focus-visible {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
}

/* ---------- 8. 徽章 / 标签 / 模式项：靛蓝化 ---------- */
html .chip { transition: background .18s ease, color .18s ease, border-color .18s ease, transform .2s var(--sc-ease-out), box-shadow .2s var(--sc-ease-out); }
html .chip:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(99, 102, 241, .16); }
html .chip.active {
  background: var(--sc-accent-grad) !important;
  color: #fff !important;
  border-color: transparent !important;
}
html .mode-item { transition: border-color .18s ease, background .18s ease, transform .2s var(--sc-ease-out), box-shadow .2s var(--sc-ease-out) !important; }
html .mode-item:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 23, 42, .12); }
html .mode-item.active {
  background: var(--accent-soft) !important;
  color: var(--accent-strong) !important;
  border-color: var(--line-strong) !important;
}
html body .gen-task-tab { transition: background .18s ease, border-color .18s ease, transform .2s var(--sc-ease-out), box-shadow .2s var(--sc-ease-out); }
html body .gen-task-tab:hover {
  background: var(--accent-soft) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, .16);
}
html body .gen-task-tab.active {
  background: var(--sc-chip-bg) !important;
  border-color: var(--sc-chip-border) !important;
}

/* ---------- 9. 全局组件过渡（明暗/状态切换渐变融合的关键） ---------- */
html .topbar, html .nav-btn, html .btn, html .panel, html .card,
html .home-card, html .input, html .chip, html .mode-item {
  transition-property: transform, box-shadow, border-color, background, color, filter;
  transition-duration: .25s;
  transition-timing-function: var(--sc-ease-out);
}
/* 画布/工作流节点不参与过渡，保证拖拽跟手 */
html .wf-canvas, html .wf-node, html .wf-left, html .wf-node * {
  transition-property: none !important;
}

/* ---------- 10. 滚动显现动画（星核同款：下移浮现 + 错峰） ---------- */
.sc-reveal {
  opacity: 0 !important;
  transform: translateY(22px) scale(.99) !important;
  will-change: opacity, transform;
}
.sc-reveal.sc-in {
  opacity: 1 !important;
  transform: none !important;
  transition: opacity .5s var(--sc-ease-smooth), transform .55s var(--sc-ease-out) !important;
}
.sc-reveal.sc-in.sc-d1 { transition-delay: .08s !important; }
.sc-reveal.sc-in.sc-d2 { transition-delay: .16s !important; }
.sc-reveal.sc-in.sc-d3 { transition-delay: .24s !important; }

/* ---------- 11. 弹层 / 下拉 / 模态：星核滑入 ---------- */
@keyframes sc-pop-in {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
html .modal:not([hidden]), html .modal.show,
html .popover, html .dropdown-menu {
  animation: sc-pop-in .22s var(--sc-ease-out) both;
}

/* ---------- 12. 滚动条：星核低饱和 ---------- */
html ::-webkit-scrollbar { width: 8px; height: 8px; }
html ::-webkit-scrollbar-thumb {
  background: var(--sc-scroll-thumb);
  border-radius: 4px;
}
html ::-webkit-scrollbar-thumb:hover { background: var(--sc-scroll-thumb-hover); }

/* ---------- 13. 顶栏充值按钮 / 充值弹窗：橙粉→星核靛蓝（原 style.css 漏色补丁） ---------- */
html .top-recharge-btn {
  background: var(--sc-accent-grad) !important;
  color: #fff !important;
  box-shadow: 0 10px 28px rgba(79, 70, 229, .28) !important;
  transition: transform .2s var(--sc-ease-out), box-shadow .25s var(--sc-ease-out), filter .18s ease !important;
}
html .top-recharge-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 16px 38px rgba(79, 70, 229, .38) !important;
  filter: brightness(1.06);
}
html .pkg-hot .pkg-btn {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%) !important;
  box-shadow: 0 10px 28px rgba(99, 102, 241, .32) !important;
}
html .recharge-balance {
  background: var(--accent-soft) !important;
  color: var(--accent-strong) !important;
  border: 1px solid var(--line-strong) !important;
}
html .recharge-balance b { color: var(--accent-strong) !important; }

/* ---------- 14. 无障碍：仅保留内容可见性兜底，不强制关闭用户需要的星核动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html .sc-reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- 15. ballpit 交互粒子背景（置于背景层、不挡交互） ---------- */
.sc-ballpit {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s var(--sc-ease-smooth);
}

/* 点击爆裂光晕：独立置顶画布（事件不拦截，仅在首页显示） */
.sc-burst {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s var(--sc-ease-smooth);
}

/* ---------- 16. 首页功能栏：从左到右错峰展开（仅首次加载，加速式分级延迟） ---------- */
.sc-stagger {
  opacity: 0;
  transform: translateY(28px) scale(.96) rotate(-1.1deg);
  will-change: opacity, transform;
}
.sc-stagger.sc-stagger-in {
  opacity: 1;
  transform: none;
  transition: opacity .5s var(--sc-ease-smooth), transform .62s var(--sc-ease-spring);
  transition-delay: var(--sc-stagger-delay, 0s);
}

/* 星核同款：滚动显现（位移加重 + 弹簧缓动，按属性分缓动） */
.sc-reveal {
  opacity: 0 !important;
  transform: translateY(28px) scale(.985) !important;
  will-change: opacity, transform;
}
.sc-reveal.sc-in {
  opacity: 1 !important;
  transform: none !important;
  transition: opacity .55s var(--sc-ease-smooth), transform .68s var(--sc-ease-spring) !important;
}
.sc-reveal.sc-in.sc-d1 { transition-delay: .09s !important; }
.sc-reveal.sc-in.sc-d2 { transition-delay: .18s !important; }
.sc-reveal.sc-in.sc-d3 { transition-delay: .27s !important; }

/* 光标跟随柔光（星核灵动感来源之一）：随鼠标移动，混合出柔和光斑 */
.sc-cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 460px; height: 460px;
  margin: -230px 0 0 -230px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transform: translate3d(-9999px, -9999px, 0);
  background: radial-gradient(circle at center,
              rgba(129, 140, 248, .16) 0%,
              rgba(99, 102, 241, .10) 32%,
              rgba(99, 102, 241, 0) 70%);
  mix-blend-mode: screen;
  transition: opacity .4s var(--sc-ease-smooth);
  will-change: transform, opacity;
}
body.theme-dark .sc-cursor-glow {
  background: radial-gradient(circle at center,
              rgba(129, 140, 248, .22) 0%,
              rgba(99, 102, 241, .12) 34%,
              rgba(99, 102, 241, 0) 70%);
}
body:not(.theme-dark) .sc-cursor-glow {
  mix-blend-mode: multiply;
  background: radial-gradient(circle at center,
              rgba(99, 102, 241, .10) 0%,
              rgba(129, 140, 248, .05) 34%,
              rgba(129, 140, 248, 0) 70%);
}

/* ===== 深色模式：流星背景穿越主/副标题时保证文字可读性 =====
   仅加极轻量的深色外发光描边（不改动字体与配色风格），
   让流星线条从文字背后穿过时文字依然清晰。 */
html body.theme-dark #page-home .home-title {
  text-shadow: 0 2px 14px rgba(8, 11, 20, .92), 0 0 30px rgba(8, 11, 20, .75);
}
html body.theme-dark #page-home .home-desc {
  text-shadow: 0 1px 10px rgba(8, 11, 20, .95), 0 0 22px rgba(8, 11, 20, .82);
}

/* ===== 文件选择控件：把原生英文「Choose File / No file chosen」中文化 ===== */
.fp-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px dashed var(--soft-line, rgba(255, 255, 255, .14));
  border-radius: 10px;
  background: var(--sc-glass, rgba(255, 255, 255, .03));
  transition: border-color .25s var(--sc-ease-smooth, ease), background .25s var(--sc-ease-smooth, ease);
}
.fp-wrap:hover { border-color: var(--accent, #6366f1); }

/* 原 input 保留在 DOM 里（.files / change 事件照旧可用），仅视觉隐藏 */
input[type="file"].input.fp-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
}

.fp-btn {
  flex: 0 0 auto;
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 4px 12px rgba(99, 102, 241, .28);
  transition: transform .2s var(--sc-ease-out, ease), box-shadow .2s var(--sc-ease-out, ease), filter .2s;
}
.fp-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(99, 102, 241, .36);
}
.fp-btn:active { transform: scale(.97); }

.fp-name {
  font-size: 12.5px;
  color: var(--text-muted, #8b95a9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-name.has-file { color: var(--text, #e9edf5); }

/* ===== 充值页标题：原样式 .recharge-header h2/p 写死了浅底用的深灰字
   （#1f2937 / #6b7280），深色模式下直接落在深色页面背景上，几乎看不见。
   这里只补深色模式的两条覆盖，浅色模式保持原样。 ===== */
html body.theme-dark .recharge-header h2 { color: #e9edf5 !important; }
html body.theme-dark .recharge-header p { color: #9aa6bd !important; }

/* ---------- 17. 背景音乐：右下角悬浮控件（全站常驻·记忆开关） ---------- */
.bgm-fab {
  position: fixed;
  right: 20px;
  bottom: 64px;
  z-index: 100000;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 10px 26px rgba(79, 70, 229, .32), 0 2px 8px rgba(0, 0, 0, .18);
  transition: transform .2s var(--sc-ease-out, ease), box-shadow .25s var(--sc-ease-out, ease), filter .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.bgm-fab:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
  box-shadow: 0 16px 36px rgba(79, 70, 229, .42), 0 2px 10px rgba(0, 0, 0, .2);
}
.bgm-fab:active { transform: scale(.95); }
.bgm-fab:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }

/* 图标：音符 + 静音斜杠，按播放状态切换 */
.bgm-fab .bgm-ico { width: 22px; height: 22px; display: block; }
.bgm-fab .bgm-slash {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 3px;
  margin: -1.5px 0 0 -15px;
  background: #fff;
  border-radius: 3px;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, .9);
  transition: opacity .2s ease, transform .25s var(--sc-ease-out, ease);
}
.bgm-fab.bgm-on .bgm-slash { opacity: 0; transform: rotate(-45deg) scaleX(.2); }

/* 播放态：图标轻微律动 */
.bgm-fab.bgm-on .bgm-ico { animation: bgm-pulse 1.8s ease-in-out infinite; }
@keyframes bgm-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}

/* 无限画布全屏模式：底部操作栏固定在 bottom:23px、高度约 56px（窄屏会换行更高），
   音乐按钮原来的 bottom:64px 会正好压在「＋ 放大」等按钮上，这里单独上移留出间距。 */
body.canvas-mode .bgm-fab { bottom: 100px; }
@media (max-width: 900px) {
  body.canvas-mode .bgm-fab { bottom: 148px; }
}

@media (max-width: 600px) {
  .bgm-fab { right: 14px; bottom: 58px; width: 42px; height: 42px; }
  body.canvas-mode .bgm-fab { bottom: 148px; }
}

@media (prefers-reduced-motion: reduce) {
  .bgm-fab.bgm-on .bgm-ico { animation: none; }
}

/* ============================================================
   18. 双模式按钮对比度统一修正
   背景：style.css 第 1295 行起的「最终修正」用 !important 把
   .nav-btn / .chip / .mode-item / .btn-ghost 等文字色全局锁死成
   深色值（#b7c2d6 等），浅色模式变量切换被它压住 → 浅色下导航/标签
   发虚看不清。同时深色模式下「白字 + 浅靛蓝 #818cf8」的激活态对比度
   仅 2.98，不达标。
   本段用最后加载 + 高优先级( html body:not(.theme-dark) ) !important
   覆盖之，并统一所有激活/实色底色为更深的靛蓝 #4f46e5，保证白字过 AA。
   ============================================================ */

/* ---- 浅色模式：把被锁死的深色文字改回可读的深色；激活态用浅靛蓝底+深靛蓝字 ---- */
html body:not(.theme-dark) .nav-btn { color: #475569 !important; }
html body:not(.theme-dark) .nav-btn:hover { background: #eef2f7 !important; color: #1e293b !important; }
html body:not(.theme-dark) .nav-btn.active { background: #eef2ff !important; color: #4338ca !important; border-color: #c7d2fe !important; }

html body:not(.theme-dark) .chip { background: #ffffff !important; border-color: #e2e8f0 !important; color: #475569 !important; }
html body:not(.theme-dark) .chip:hover { border-color: #6366f1 !important; color: #4338ca !important; }
html body:not(.theme-dark) .chip.active { background: #eef2ff !important; border-color: #6366f1 !important; color: #4338ca !important; }

html body:not(.theme-dark) .mode-item { background: #ffffff !important; border-color: #e8eaf0 !important; color: #475569 !important; }
html body:not(.theme-dark) .mode-item:hover { border-color: #6366f1 !important; color: #4338ca !important; }
html body:not(.theme-dark) .mode-item.active { background: #eef2ff !important; border-color: #6366f1 !important; color: #4338ca !important; }

/* ghost 按钮：浅色模式用浅底深字，避免在深色子容器里出现深字深底 */
html body:not(.theme-dark) .btn-ghost { background: #eef2f7 !important; border-color: #d8dee9 !important; color: #334155 !important; }
html body:not(.theme-dark) .btn-ghost:hover { background: #e2e8f0 !important; color: #1e293b !important; }

/* int 系列：简单引导/高级操作 tab、面板 tab、左侧图层按钮 */
html body:not(.theme-dark) .int-tab { color: #475569 !important; border-color: #d8dee9 !important; }
html body:not(.theme-dark) .int-tab.active { background: #4f46e5 !important; color: #fff !important; border-color: #4f46e5 !important; }
html body:not(.theme-dark) .int-panel-tab { color: #475569 !important; }
html body:not(.theme-dark) .int-panel-tab.active { color: #4338ca !important; }
/* 图层按钮始终压在预览区（图片）上 → 统一用不透明深底 + 浅色字（自包含，任何图片上都清晰） */
html .int-layer-btn { color: #e2e8f0 !important; background: #1f2937 !important; border-color: rgba(255,255,255,0.22) !important; }
html .int-layer-btn.active { background: #4f46e5 !important; color: #fff !important; border-color: #4f46e5 !important; }

/* 主题切换按钮：浅色下原本是深底深字（🌙 看不清），改为浅底深字 */
html .theme-toggle { background: #eef2f7 !important; color: #475569 !important; border: 1px solid #d8dee9 !important; }
html body.theme-dark .theme-toggle { background: rgba(255,255,255,0.06) !important; color: #c7d2fe !important; border-color: rgba(255,255,255,0.14) !important; }

/* ---- 深色模式：统一激活/实色底色为更深的靛蓝 #4f46e5，保证白字过 AA ---- */
html body.theme-dark .login-tab.active,
html body.theme-dark .int-tab.active,
html body.theme-dark .int-layer-btn.active,
html body.theme-dark .mode-btn { background: #4f46e5 !important; color: #ffffff !important; border-color: #4f46e5 !important; }
html body.theme-dark .nav-btn.active { color: #c7d2fe !important; }
html body.theme-dark .chip.active,
html body.theme-dark .mode-item.active { color: #c7d2fe !important; }

/* ---- 登录/充值主按钮：加深蓝底满足 AA（白字对比度 ≥ 4.5） ---- */
html .btn-login-register { background: #0a5fd6 !important; color: #fff !important; }
html .btn-login-register:hover { background: #0a52b8 !important; }
html .top-recharge-btn { background: var(--sc-accent-grad) !important; color: #fff !important; }
html .pkg-btn { background: linear-gradient(135deg, #4f46e5, #6366f1) !important; color: #fff !important; }

/* ============================================================
   19. 专项按钮对比度补强（覆盖 macos-theme / style.css 的 !important 锁）
   要点：
   - macos-theme 用 .topbar .xxx (!important, 特异性 0,2,0) 锁死登录/主题按钮，
     本段用 html .topbar .xxx (0,2,1) 压过它。
   - style.css 用 body.light 写浅色覆盖，但站点实际以 body:not(.theme-dark) 判定浅色，
     导致那些 body.light 规则形同虚设；本段统一改用 body:not(.theme-dark)。
   ============================================================ */

/* ---- 登录/注册主按钮：压过 macos .topbar .btn-login-register(!important) ---- */
html .topbar .btn-login-register,
html .btn-login-register { background: #0a5fd6 !important; color: #fff !important; }
html .topbar .btn-login-register:hover,
html .btn-login-register:hover { background: #0a52b8 !important; }

/* ---- 充值套餐按钮：统一更深靛蓝渐变，白字过 AA；同时压过 .pkg-hot .pkg-btn(!important) ---- */
html .pkg-btn,
html .pkg-hot .pkg-btn { background: linear-gradient(135deg, #4338ca, #6366f1) !important; color: #fff !important; }

/* ---- 背景音乐 / 上传选择(fp-btn) 悬浮按钮：加深渐变使白字过 AA ---- */
html .bgm-fab { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important; color: #fff !important; }
html .fp-btn { background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important; color: #fff !important; }

/* ---- 深色模式 ghost 按钮：压过 style.css 锁死的 #b7c2d6（用不透明深底，避免灰底透出） ---- */
html body.theme-dark .btn-ghost { background: #1c2230 !important; border-color: rgba(255,255,255,0.14) !important; color: #e2e8f0 !important; }
html body.theme-dark .btn-ghost:hover { background: #283044 !important; color: #fff !important; }

/* ---- 个人中心历史 tab：双模式均过 AA ---- */
html body.theme-dark .dsx-history-tab { color: #cbd5e1 !important; }
html body.theme-dark .dsx-history-tab.active { color: #f1f5f9 !important; border-bottom-color: #818cf8 !important; }
html body:not(.theme-dark) .dsx-history-tab { color: #475569 !important; }
html body:not(.theme-dark) .dsx-history-tab.active { color: #4338ca !important; border-bottom-color: #4338ca !important; }

/* ---- 无限画布 / 工作流编辑器按钮 ---- */
/* 浅色：面板为近白底，用不透明浅色调底 + 深色字（自包含） */
html body:not(.theme-dark) .wf-mode-btn { color: #5b21b6 !important; background: #ede9fe !important; border-color: #c4b5fd !important; }
html body:not(.theme-dark) .wf-mode-btn.cat-3d { color: #9a3412 !important; background: #ffedd5 !important; border-color: #fdba74 !important; }
html body:not(.theme-dark) .wf-mode-btn.cat-id { color: #15803d !important; background: #dcfce7 !important; border-color: #86efac !important; }
html body:not(.theme-dark) .wf-mode-btn.cat-fix { color: #9f1239 !important; background: #ffe4e6 !important; border-color: #fda4af !important; }
html body:not(.theme-dark) .wf-mode-btn.cat-other { color: #334155 !important; background: #f1f5f9 !important; border-color: #cbd5e1 !important; }
html body:not(.theme-dark) .wf-lib-item { background: #ffffff !important; border-color: #e2e8f0 !important; color: #334155 !important; }
html body:not(.theme-dark) .wf-left-collapse { color: #475569 !important; }

/* 深色：面板为深蓝底，用不透明深色调底 + 浅色字（自包含，不受父级灰底影响） */
html body.theme-dark .wf-mode-btn { color: #ddd6fe !important; background: #2e1065 !important; border-color: #5b21b6 !important; }
html body.theme-dark .wf-mode-btn.cat-3d { color: #fed7aa !important; background: #7c2d12 !important; border-color: #c2410c !important; }
html body.theme-dark .wf-mode-btn.cat-id { color: #bbf7d0 !important; background: #14532d !important; border-color: #15803d !important; }
html body.theme-dark .wf-mode-btn.cat-fix { color: #fecdd3 !important; background: #7f1d3a !important; border-color: #9f1239 !important; }
html body.theme-dark .wf-mode-btn.cat-other { color: #cbd5e1 !important; background: #1e293b !important; border-color: #475569 !important; }
html body.theme-dark .wf-lib-item { background: #1e2330 !important; border-color: #2a2f3d !important; color: #cbd5e1 !important; }
html body.theme-dark .wf-left-collapse { color: #cbd5e1 !important; }

/* ---------- 20. 首页功能图标 · 3D 插画 PNG（底框内最大化） ---------- */
html .home-card-icon.ico-img-mode {
  width: 78px !important;
  height: 78px !important;
  min-width: 78px !important;
  border-radius: 20px !important;
  background: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
  overflow: visible;
}
/* 原图四周约有 9% 透明留白，放大 116% 并负外边距抵消，使插画贴满底框 */
html .home-card-icon.ico-img-mode .home-ico-img {
  width: 116%;
  height: 116%;
  margin: -8%;
  display: block;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 5px 12px rgba(99, 102, 241, .32));
  transition: filter .3s var(--sc-ease-out, ease);
}
html .home-card:hover .home-card-icon.ico-img-mode {
  transform: none;
}
html .home-card:hover .home-card-icon.ico-img-mode .home-ico-img {
  filter: drop-shadow(0 9px 20px rgba(99, 102, 241, .5));
}
/* 卡片纵向留白随图标增高适配 */
html #page-home .home-card { padding-top: 12px !important; padding-bottom: 12px !important; }
