/* ==============================================================================
   千剧工坊 v2 · Flow UX 层（2026-11-15 Updream Minimal Liquid Glass）
   ------------------------------------------------------------------------------
   1. /write 极简双按钮创作中心（.apple-write.aw3.aw4）
   2. 写作台 Agent 输入框统一按钮（.qf-send / .qf-queued）
   3. 首页回复中「排队发送」（.g-queue-send）
   4. 全站外壳（#studio-topbar / #studio-sidebar / Mobile Drawers）
   ============================================================================== */

:root {
  --fx-ease: cubic-bezier(.2, .8, .2, 1);
  --fx-ease-out: cubic-bezier(.16, 1, .3, 1);
  --fx-novel: #ffffff;
  --fx-novel-2: #d4d4d8;
  --fx-novel-ink: #0a0a0a;
  --fx-script: #ffffff;
  --fx-script-2: #d4d4d8;
  --fx-script-ink: #0a0a0a;
  --fx-director: #ffffff;
  --fx-director-2: #d4d4d8;
  --fx-canvas: #ffffff;
  --fx-canvas-2: #d4d4d8;
}
:root:is([data-theme=day], [data-theme=light]) {
  --fx-novel: #111111;
  --fx-novel-2: #52525b;
  --fx-novel-ink: #ffffff;
  --fx-script: #111111;
  --fx-script-2: #52525b;
  --fx-script-ink: #ffffff;
  --fx-director: #111111;
  --fx-director-2: #52525b;
  --fx-canvas: #111111;
  --fx-canvas-2: #52525b;
}

/* ==============================================================================
   1. /write · 极简小说与剧本中心（两枚清晰动作卡片 + 下方作品库）
   ============================================================================== */
#app .apple-write.aw3.aw4 {
  max-width: 1120px;
  padding: 36px 36px 32px;
  border-radius: 26px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--up-border, rgba(255, 255, 255, .08));
  background: var(--aw-panel-bg, var(--up-glass, rgba(20, 20, 20, .84)));
}
.aw3-ambient { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.aw3-ambient i {
  position: absolute; width: 440px; height: 440px; border-radius: 50%;
  filter: blur(110px); opacity: .05;
  animation: aw3-drift 22s var(--fx-ease) infinite alternate;
}
.aw3-ambient i:first-child { left: -140px; top: -240px; background: var(--fx-script); }
.aw3-ambient i:last-child { right: -160px; top: -220px; background: var(--fx-script-2); animation-delay: -9s; }
:root:is([data-theme=day], [data-theme=light]) .aw3-ambient i { opacity: .07; }
@keyframes aw3-drift { to { transform: translate3d(48px, 32px, 0) scale(1.06); } }

.aw3-inner { position: relative; display: flex; flex-direction: column; gap: 22px; }

.aw3-head.aw4-head { max-width: 640px; animation: fx-rise .45s var(--fx-ease-out) both; }
.aw3-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-size: 11px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase;
  color: var(--lg-text-3, rgba(148, 163, 184, .75));
}
.aw3-kicker span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fx-script);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx-script) 18%, transparent);
}
#app .aw3-title {
  margin: 0; font-size: clamp(28px, 3.2vw, 38px); line-height: 1.12; font-weight: 720; letter-spacing: -.025em;
  color: var(--lg-text-1, #f8fafc);
}
.aw3-sub { margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: var(--lg-text-2, rgba(226, 232, 240, .74)); }

/* 两张极简操作卡 */
.aw3-cards.aw4-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.aw3-cards.is-single { grid-template-columns: minmax(0, 560px); }
.aw3-card.aw4-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0;
  padding: 22px 24px 20px; border-radius: 22px;
  border: 1px solid var(--lg-rim, rgba(255, 255, 255, .1));
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .015) 56%),
    var(--lg-glass-card, rgba(255, 255, 255, .032));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 22px 46px -30px rgba(0, 0, 0, .72);
  overflow: hidden; isolation: isolate;
  transition: transform .28s var(--fx-ease-out), border-color .22s ease, box-shadow .28s var(--fx-ease-out), background .22s ease;
  animation: fx-rise .5s var(--fx-ease-out) both;
}
.aw3-card.aw4-card.is-script { animation-delay: .05s; }
:root:is([data-theme=day], [data-theme=light]) .aw3-card.aw4-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, .96), rgba(245, 245, 247, .92));
  border-color: rgba(0, 0, 0, .08);
  box-shadow: 0 1px 0 #fff inset, 0 16px 36px -26px rgba(0, 0, 0, .14);
}
.aw3-card.aw4-card:hover, .aw3-card.aw4-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--up-border-strong, rgba(255, 255, 255, .22));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .1) inset, 0 28px 58px -32px rgba(0, 0, 0, .65);
}
.aw3-card-spot {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 30%) var(--my, 0%), rgba(255, 255, 255, .07), transparent 62%);
  transition: opacity .28s ease;
}
.aw3-card.aw4-card:hover .aw3-card-spot { opacity: 1; }

.aw4-card-top { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.aw3-card-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  color: var(--up-t1, #f5f5f5);
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--up-border-strong, rgba(255, 255, 255, .16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
  transition: transform .32s var(--fx-ease-out), border-color .22s ease, background .22s ease;
}
.aw3-card.aw4-card.is-script .aw3-card-icon { color: var(--up-t1, #ffffff); border-color: var(--up-border-strong, rgba(255, 255, 255, .18)); background: rgba(255, 255, 255, .09); }
:root:is([data-theme=day], [data-theme=light]) .aw3-card-icon { color: #111111; background: rgba(0, 0, 0, .05); border-color: rgba(0, 0, 0, .12); }
:root:is([data-theme=day], [data-theme=light]) .aw3-card.aw4-card.is-script .aw3-card-icon { color: #111111; background: rgba(0, 0, 0, .06); border-color: rgba(0, 0, 0, .14); }
.aw3-card.aw4-card:hover .aw3-card-icon { transform: scale(1.04); }
.aw3-card-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aw3-card-titles small { font-size: 10.5px; font-weight: 650; letter-spacing: .12em; color: var(--lg-text-3); }
#app .aw3-card-titles h2 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 720; letter-spacing: -.015em; color: var(--lg-text-1, #f8fafc); }
.aw3-card-count {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px 0 11px; border-radius: 999px;
  border: 1px solid var(--lg-rim, rgba(255, 255, 255, .1)); background: var(--lg-glass-pill, rgba(255, 255, 255, .05));
  font-size: 12px; color: var(--lg-text-2); text-decoration: none; white-space: nowrap;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.aw3-card-count b { font-size: 12.5px; color: var(--lg-text-1); font-variant-numeric: tabular-nums; }
.aw3-card-count:hover { color: var(--lg-text-1); border-color: var(--lg-rim-strong); background: var(--lg-glass-pill-hover, rgba(255, 255, 255, .1)); }
.aw3-card-lede { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--lg-text-2); }
.aw4-card-foot { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
#app .aw3-go {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px 0 20px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700;
  color: #0a0a0a; background: #ffffff;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .55), inset 0 1px 0 #fff;
  transition: transform .2s var(--fx-ease), box-shadow .25s ease, filter .2s ease;
}
:root:is([data-theme=day], [data-theme=light]) #app .aw3-go {
  color: #ffffff; background: #111111; border-color: rgba(0, 0, 0, .2);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .3);
}
#app .aw3-go:hover { transform: translateY(-1px); filter: brightness(1.04); }
#app .aw3-go:active { transform: translateY(0) scale(.98); }
#app .aw3-go i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .08); transition: transform .25s var(--fx-ease-out); }
:root:is([data-theme=day], [data-theme=light]) #app .aw3-go i { background: rgba(255, 255, 255, .16); }
#app .aw3-go:hover i { transform: translateX(2px); }

/* 作品库列表 */
#app .apple-write.aw3.aw4 .aw3-recent {
  min-height: 0; padding: 20px 22px 18px; border-radius: 22px;
  border: 1px solid var(--lg-rim, rgba(255, 255, 255, .08));
  background: var(--lg-glass-card, rgba(255, 255, 255, .025));
  animation: fx-rise .55s var(--fx-ease-out) .08s both;
}
#app .apple-write.aw3.aw4 .aw3-recent-head { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 0 2px 14px; border-bottom: 1px solid var(--lg-rim, rgba(255, 255, 255, .07)); }
#app .apple-write.aw3.aw4 .aw3-recent-head .aw-side-title-row { flex: 1 1 200px; justify-content: flex-start; gap: 10px; }
#app .apple-write.aw3.aw4 .aw3-recent-head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.aw3-recent-sub { font-size: 12.5px; color: var(--lg-text-3); }
.aw4-library-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aw4-search {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--lg-rim, rgba(255, 255, 255, .1));
  background: var(--lg-glass-pill, rgba(255, 255, 255, .04));
  color: var(--lg-text-3);
}
.aw4-search:focus-within { border-color: var(--up-border-strong, rgba(255, 255, 255, .28)); color: var(--lg-text-1); }
.aw4-search input { border: 0; background: transparent; color: var(--lg-text-1); font: inherit; font-size: 12.5px; width: 156px; outline: none; }
.aw4-search input::placeholder { color: var(--lg-text-3); }
#app .apple-write.aw3.aw4 .aw3-recent-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 10px;
  overflow: visible; padding: 14px 0 0;
}
#app .apple-write.aw3.aw4 .aw3-recent-grid .aw-item-row {
  padding: 8px 10px 8px 8px; border-radius: 16px;
  border: 1px solid var(--lg-rim, rgba(255, 255, 255, .08));
  background: var(--lg-glass-card, rgba(255, 255, 255, .03));
  transition: transform .22s var(--fx-ease-out), border-color .2s ease, background .2s ease;
}
#app .apple-write.aw3.aw4 .aw3-recent-grid .aw-item-row:hover,
#app .apple-write.aw3.aw4 .aw3-recent-grid .aw-item-row:focus-within {
  transform: translateY(-2px);
  background: var(--lg-glass-card-hover, rgba(255, 255, 255, .06));
  border-color: var(--lg-rim-strong, rgba(255, 255, 255, .18));
}
#app .apple-write.aw3.aw4 .aw3-recent-grid .aw-item { grid-template-columns: 38px minmax(0, 1fr) 16px; }
#app .apple-write.aw3.aw4 .aw3-recent-grid .aw-item-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 14px; border: 1px solid rgba(255, 255, 255, .12); color: var(--lg-text-1); background: rgba(255, 255, 255, .06); }
#app .apple-write.aw3.aw4 .aw3-recent-grid .aw-item-mark.is-script { color: var(--up-t1, #f5f5f5); border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .09); }
#app .apple-write.aw3.aw4 .aw3-empty { padding: 28px 12px 14px; text-align: center; }

@media (max-width: 900px) {
  #app .apple-write.aw3.aw4 { padding: 26px 22px 24px; }
  .aw3-cards.aw4-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  #app .apple-write.aw3.aw4 { padding: 18px 14px 16px; border-radius: 18px; }
  .aw4-card-top { grid-template-columns: 42px minmax(0, 1fr); }
  .aw3-card-count { grid-column: 1 / -1; justify-self: start; }
  .aw4-library-tools { width: 100%; }
  .aw4-search { flex: 1 1 100%; }
  .aw4-search input { width: 100%; }
  #app .apple-write.aw3.aw4 .aw3-recent-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ==============================================================================
   3. 写作台 Agent 输入框 · 发送 / 停止 / 排队 统一按钮
   ============================================================================== */
#page .n-studio .n-composer-bottom .n-send.qf-send,
#page .n-studio .n-agent-compose .n-send.qf-send { position: relative; overflow: visible; transition: background .2s ease, color .2s ease, opacity .2s ease, transform .15s var(--fx-ease); }
.qf-send .qf-ico { display: grid; place-items: center; line-height: 0; }
.qf-send .qf-ico-stop i { display: block; width: 10px; height: 10px; border-radius: 2.5px; background: currentColor; }
.qf-send[data-qf-mode="stop"] .qf-ico-send,
.qf-send:not([data-qf-mode="stop"]) .qf-ico-stop { display: none !important; }
#page .n-studio .n-send.qf-send:active { transform: scale(.92); }
#page .n-studio .n-composer-bottom .n-send.qf-send[data-qf-mode="empty"] { opacity: .38 !important; cursor: default; }
.qf-ring { position: absolute; inset: -4px; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.qf-send:is([data-qf-mode="stop"], [data-qf-mode="queue"]) .qf-ring {
  opacity: 1;
  background: conic-gradient(from 0deg, transparent 0 55%, color-mix(in srgb, var(--fx-acc, #ffffff) 90%, #fff) 85%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  animation: qf-spin 1.1s linear infinite;
}
#page .n-studio .n-composer-bottom .n-send.qf-send[data-qf-mode="queue"] {
  background: var(--fx-acc, #ffffff) !important;
  color: #ffffff !important;
}
:root:not([data-theme=day]):not([data-theme=light]) #page .n-studio .n-composer-bottom .n-send.qf-send[data-qf-mode="queue"] { color: #0a0a0a !important; }
@keyframes qf-spin { to { transform: rotate(360deg); } }

.qf-queued {
  display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0 0 8px; padding: 7px 8px 7px 12px;
  border-radius: 12px; font-size: 12px;
  color: var(--lg-text-2, var(--text-2));
  border: 1px solid var(--up-border-strong, rgba(255, 255, 255, .16));
  background: rgba(255, 255, 255, .05);
  animation: fx-rise .3s var(--fx-ease-out) both;
}
.qf-queued-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--fx-acc, #ffffff); animation: fx-pulse 1.6s ease-in-out infinite; }
.qf-queued-label { flex: none; font-weight: 700; color: var(--lg-text-1, var(--text)); }
.qf-queued-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qf-queued-hint { flex: none; color: var(--lg-text-3, var(--text-3)); }
.qf-queued-cancel {
  flex: none; height: 24px; padding: 0 10px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600;
  color: var(--lg-text-1, var(--text)); border: 1px solid var(--lg-rim, rgba(255, 255, 255, .12)); background: var(--lg-glass-pill, rgba(255, 255, 255, .06));
}
.qf-queued-cancel:hover { background: var(--lg-glass-pill-hover, rgba(255, 255, 255, .12)); }
@media (max-width: 1280px) { .qf-queued-hint { display: none; } }

/* ==============================================================================
   4. 首页 · 回复中「排队发送」
   ============================================================================== */
#app .g-send.g-queue-send { position: relative; box-shadow: 0 0 0 2px color-mix(in srgb, var(--fx-acc, #ffffff) 45%, transparent), 0 8px 22px -10px rgba(0, 0, 0, .55); }

/* ==============================================================================
   通用动效
   ============================================================================== */
@keyframes fx-rise { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@keyframes fx-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.82); } }

@media (prefers-reduced-motion: reduce) {
  .aw3-ambient i, .aw3-kicker span, .qf-queued-dot, .qf-send .qf-ring { animation: none !important; }
  .aw3-head, .aw3-card, .aw3-skills, .aw3-recent, .g-flow, .qf-queued, .aw3-skills-panel { animation: none !important; }
  .aw3-card, .aw3-card-icon, .aw3-step-n, .aw3-go, .g-flow, .g-flow-icon, .g-flow-go { transition: none !important; }
  .aw3-card:hover, .g-flow:hover { transform: none !important; }
}

/* ==============================================================================
   4. 全站外壳 · 顶栏 + 左侧图标栏 + 移动端抽屉与参数浮层（2026-11-15 Updream Glass）
   ============================================================================== */
:root {
  --fx-acc: #ffffff;
  --fx-shell-bg: rgba(13, 13, 13, .92);
}
:root:is([data-theme=day], [data-theme=light]) {
  --fx-acc: #111111;
  --fx-shell-bg: rgba(248, 248, 250, .92);
}
html[data-module="novel"],
html[data-module="script"],
html[data-module="director"],
html[data-module="common"],
html[data-module="canvas"],
html[data-module="admin"] { --fx-acc: #ffffff; }
:root:is([data-theme=day], [data-theme=light]) html[data-module="novel"],
:root:is([data-theme=day], [data-theme=light]) html[data-module="script"],
:root:is([data-theme=day], [data-theme=light]) html[data-module="director"],
:root:is([data-theme=day], [data-theme=light]) html[data-module="common"],
:root:is([data-theme=day], [data-theme=light]) html[data-module="canvas"],
:root:is([data-theme=day], [data-theme=light]) html[data-module="admin"] { --fx-acc: #111111; }

@media (min-width: 821px) {
  :root { --fa-rail-w: 200px; --fa-header-h: 56px; }
  html[data-rail-collapsed="1"] { --fa-rail-w: 64px; }
  html[data-rail-mode="none"] { --fa-rail-w: 0px; }
  #app #studio-topbar .mobile-menu,
  #app #studio-topbar .icon-button.mobile-menu,
  .g-mobile-picker-btn { display: none !important; }
}

/* ---------- 顶栏 ---------- */
#app #studio-topbar.fa-topbar {
  padding: 0 16px 0 12px !important;
  gap: 12px;
  background: var(--fx-shell-bg) !important;
  -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
  backdrop-filter: blur(22px) saturate(160%) !important;
  border-bottom: 1px solid var(--lg-rim, rgba(255, 255, 255, .08)) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 10px 30px -24px rgba(0, 0, 0, .8) !important;
}
#app #studio-topbar .fa-topbar-left { gap: 12px; }
#app #studio-topbar .fa-brand { gap: 10px; padding: 4px 8px 4px 4px; border-radius: 12px; transition: background .18s ease; }
#app #studio-topbar .fa-brand:hover { background: var(--lg-glass-pill, rgba(255, 255, 255, .05)); }
#app #studio-topbar .fa-brand-mark { width: 32px; height: 32px; border-radius: 10px; overflow: hidden; background: var(--lg-glass-pill, rgba(255, 255, 255, .06)); box-shadow: inset 0 0 0 1px var(--lg-rim, rgba(255, 255, 255, .1)); }
#app #studio-topbar .fa-brand-mark img { width: 28px; height: 28px; border-radius: 8px; }
#app #studio-topbar .fa-brand-mark i { display: none; }
#app #studio-topbar .fa-brand-copy b { font-size: 14px; font-weight: 720; letter-spacing: -.01em; color: var(--lg-text-1); }
#app #studio-topbar .fa-brand-copy small { font-size: 10.5px; color: var(--lg-text-3); letter-spacing: .02em; }
#app #studio-topbar .fa-topbar-context {
  display: flex; align-items: center; min-width: 0; height: 24px; padding: 0 0 0 14px; margin: 0;
  border: 0 !important; border-left: 1px solid var(--lg-rim, rgba(255, 255, 255, .1)) !important;
  background: transparent !important; box-shadow: none !important; border-radius: 0 !important;
}
#app #studio-topbar .fa-top-crumb { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: transparent; }
#app #studio-topbar .fa-top-crumb i { display: none !important; }
#app #studio-topbar .fa-top-crumb b { font-size: 13px; font-weight: 620; color: var(--lg-text-1); white-space: nowrap; }
#app #studio-topbar .fa-top-crumb small { font-size: 11.5px; color: var(--lg-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#app #studio-topbar .fa-top-crumb small::before { content: '/'; margin-right: 7px; opacity: .4; }
#app #studio-topbar .fa-top-shortcuts { display: none !important; }

#app #studio-topbar .fa-topbar-right { gap: 8px; }
#app #studio-topbar .fa-topbar-right .fa-actions {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 !important; margin: 0;
  border: 0 !important; background: transparent !important; box-shadow: none !important;
}
#app #studio-topbar .fa-actions > :is(.icon-button, .fa-icon) {
  position: relative; width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important; padding: 0 !important;
  border: 1px solid var(--up-border, rgba(255, 255, 255, .08)) !important; border-radius: 999px !important;
  background: var(--up-glass, rgba(20, 20, 20, .84)) !important; box-shadow: none !important;
  color: var(--lg-text-2) !important; display: grid !important; place-items: center;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .15s var(--fx-ease);
}
#app #studio-topbar .fa-actions > :is(.icon-button, .fa-icon):hover {
  background: var(--up-surface-2, rgba(255, 255, 255, .08)) !important;
  border-color: var(--up-border-strong, rgba(255, 255, 255, .16)) !important;
  color: var(--lg-text-1) !important;
}
#app #studio-topbar .fa-actions > :is(.icon-button, .fa-icon):active { transform: scale(.92); }
#app #studio-topbar .fa-actions > :is(.icon-button, .fa-icon) svg { width: 16px !important; height: 16px !important; }
#app #studio-topbar .fa-actions :is(.nav-count, .ops-badge, [class*="badge"]):not(svg) {
  position: absolute !important; top: -2px !important; right: -2px !important; left: auto !important; bottom: auto !important;
  min-width: 15px !important; height: 15px !important; padding: 0 4px !important; margin: 0 !important;
  border-radius: 999px !important; border: 2px solid var(--up-bg, #0a0a0a) !important;
  font-size: 9px !important; font-weight: 700 !important; line-height: 11px !important;
  color: #fff !important; background: #ef4444 !important; box-shadow: none !important; transform: none !important;
}
:root:is([data-theme=day], [data-theme=light]) #app #studio-topbar .fa-actions :is(.nav-count, .ops-badge, [class*="badge"]):not(svg) { border-color: #fff !important; }

#app #studio-topbar .credit-pill {
  height: 36px !important; min-height: 36px !important; padding: 0 11px 0 6px !important; gap: 7px !important; margin: 0 !important;
  border-radius: 999px !important; border: 1px solid var(--up-border, rgba(255, 255, 255, .08)) !important;
  background: var(--up-glass, rgba(20, 20, 20, .84)) !important; box-shadow: none !important;
  color: var(--lg-text-1) !important; cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .15s var(--fx-ease);
}
#app #studio-topbar .credit-pill:hover { border-color: var(--up-border-strong, rgba(255, 255, 255, .18)) !important; background: var(--up-surface-2, rgba(255, 255, 255, .08)) !important; }
#app #studio-topbar .credit-pill:active { transform: scale(.97); }
#app #studio-topbar .credit-pill .credit-coin {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
}
:root:is([data-theme=day], [data-theme=light]) #app #studio-topbar .credit-pill .credit-coin { background: rgba(0, 0, 0, .06); border-color: rgba(0, 0, 0, .10); }
#app #studio-topbar .credit-pill .credit-coin svg { width: 13px !important; height: 13px !important; color: var(--lg-text-1) !important; }
#app #studio-topbar .credit-pill b { font-size: 13px !important; font-weight: 700 !important; color: var(--lg-text-1) !important; font-variant-numeric: tabular-nums; }
#app #studio-topbar .credit-pill .credit-unit { font-size: 11px !important; font-weight: 500 !important; color: var(--lg-text-3) !important; padding: 0 !important; border: 0 !important; background: none !important; }

#app #studio-topbar .fa-user .profile-button {
  height: 36px !important; padding: 3px 10px 3px 3px !important; gap: 7px !important;
  border-radius: 999px !important; border: 1px solid var(--up-border, rgba(255, 255, 255, .08)) !important;
  background: var(--up-glass, rgba(20, 20, 20, .84)) !important; box-shadow: none !important;
  transition: border-color .2s ease, background .2s ease;
}
#app #studio-topbar .fa-user .profile-button:hover,
#app #studio-topbar .fa-user[open] .profile-button { border-color: var(--up-border-strong, rgba(255, 255, 255, .18)) !important; background: var(--up-surface-2, rgba(255, 255, 255, .09)) !important; }
#app #studio-topbar .fa-user .profile-button .avatar {
  width: 28px !important; height: 28px !important; font-size: 12px !important; font-weight: 700 !important;
  color: #0a0a0a !important; background: linear-gradient(145deg, #ffffff, #d4d4d8) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6) !important;
}
:root:is([data-theme=day], [data-theme=light]) #app #studio-topbar .fa-user .profile-button .avatar {
  color: #ffffff !important; background: linear-gradient(145deg, #27272a, #111111) !important;
}
#app #studio-topbar .fa-user-name { font-size: 12.5px; font-weight: 600; color: var(--lg-text-1); }
#app #studio-topbar .fa-user .profile-button > svg { width: 12px !important; height: 12px !important; color: var(--lg-text-3) !important; transition: transform .22s var(--fx-ease-out); }
#app #studio-topbar .fa-user[open] .profile-button > svg { transform: rotate(180deg); }
#app #studio-topbar .fa-user-menu {
  top: calc(100% + 8px) !important; width: 242px !important; padding: 6px !important;
  border-radius: 16px !important; border: 1px solid var(--up-border, rgba(255, 255, 255, .1)) !important;
  background: var(--lg-glass-modal, rgba(18, 18, 18, .94)) !important;
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .7) !important;
  animation: fx-pop .2s var(--fx-ease-out) both; transform-origin: top right;
}
#app #studio-topbar .fa-user-menu :is(a, button) { min-height: 36px !important; border-radius: 10px !important; padding: 0 10px !important; font-size: 13px !important; color: var(--lg-text-2) !important; }
#app #studio-topbar .fa-user-menu :is(a, button):hover { background: var(--lg-glass-pill-hover, rgba(255, 255, 255, .08)) !important; color: var(--lg-text-1) !important; }
#app #studio-topbar .fa-user-head { margin: 4px 6px 6px !important; padding: 6px 4px 12px !important; border-bottom: 1px solid var(--lg-rim, rgba(255, 255, 255, .08)) !important; }
#app #studio-topbar .workspace-status { display: none !important; }

#app #studio-topbar .studio-back {
  display: grid; place-items: center; width: 34px; height: 34px; min-width: 34px; min-height: 34px; padding: 0; margin: 0; border-radius: 11px;
  border: 1px solid var(--lg-rim, rgba(255, 255, 255, .09)); background: var(--lg-glass-pill, rgba(255, 255, 255, .05));
  color: var(--lg-text-1); text-decoration: none;
  transition: background .2s ease, transform .15s var(--fx-ease);
}
#app #studio-topbar .studio-back .shell-back-mark {
  display: grid; place-items: center; width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 0; margin: 0;
  border: 0 !important; border-radius: inherit !important; background: transparent !important; box-shadow: none !important; color: inherit;
}
#app #studio-topbar .studio-back:hover { background: var(--lg-glass-pill-hover, rgba(255, 255, 255, .1)); }
#app #studio-topbar .studio-back:hover .shell-back-mark { transform: none !important; }
#app #studio-topbar .studio-back:active { transform: scale(.94); }

/* ---------- 左侧导轨（200px 可收起至 64px） ---------- */
#app #studio-sidebar.fa-rail {
  background: #0d0d0d !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border-right: 1px solid var(--up-border, rgba(255, 255, 255, .08)) !important;
  box-shadow: none !important;
  padding: 12px 10px !important;
}
:root:is([data-theme=day], [data-theme=light]) #app #studio-sidebar.fa-rail {
  background: #f8f8fa !important;
}
#app #studio-sidebar .fa-rail-glow { display: none !important; }
#app #studio-sidebar nav { padding: 0 !important; gap: 4px !important; }
#app #studio-sidebar .nav-group { margin: 0 0 8px !important; gap: 3px !important; padding: 0 !important; }
#app #studio-sidebar .nav-group > p {
  display: block !important; height: auto !important; margin: 10px 10px 4px !important; padding: 0 !important;
  font-size: 10.5px !important; line-height: 1.4 !important; font-weight: 600 !important;
  letter-spacing: 0.04em !important; text-align: left !important;
  color: rgba(255, 255, 255, 0.34) !important; background: transparent !important; border: 0 !important;
}
#app #studio-sidebar .nav-group:first-child > p { display: none !important; }
#app #studio-sidebar .nav-group > p::before, #app #studio-sidebar .nav-group > p::after { display: none !important; content: none !important; }

#app #studio-sidebar .nav-link {
  position: relative !important; display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: flex-start !important;
  gap: 10px !important; width: 100% !important; min-height: 38px !important; height: 38px !important; padding: 0 11px !important; margin: 0 !important;
  border: 1px solid transparent !important; border-radius: 10px !important; background: transparent !important; box-shadow: none !important;
  color: rgba(255, 255, 255, .64) !important; text-decoration: none;
  font-size: 13px !important; font-weight: 500 !important; line-height: 1.2 !important; letter-spacing: 0 !important;
  transition: background .16s ease, color .16s ease, border-color .16s ease !important;
  -webkit-tap-highlight-color: transparent;
}
#app #studio-sidebar .nav-link::before { display: none !important; content: none !important; }
#app #studio-sidebar .nav-link svg {
  position: relative; z-index: 1; width: 17px !important; height: 17px !important; margin: 0 !important; flex: none;
  stroke-width: 1.75 !important; opacity: 0.88 !important; filter: none !important;
  color: inherit !important; transition: color .16s ease, opacity .16s ease;
}
#app #studio-sidebar .nav-link span { position: relative; z-index: 1; margin-top: 0 !important; max-width: none !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app #studio-sidebar .nav-link > i { display: none !important; }
#app #studio-sidebar .nav-link:hover { color: #ffffff !important; background: rgba(255, 255, 255, .055) !important; }
#app #studio-sidebar .nav-link:hover svg { transform: none !important; opacity: 1 !important; }
#app #studio-sidebar .nav-link:active { transform: scale(.985); }
#app #studio-sidebar .nav-link:focus-visible { outline: 2px solid rgba(255,255,255,.35) !important; outline-offset: 1px; }

#app #studio-sidebar .nav-link.active {
  color: #ffffff !important; font-weight: 600 !important;
  background: rgba(255, 255, 255, .10) !important;
  border-color: rgba(255, 255, 255, .10) !important;
}
#app #studio-sidebar .nav-link.active svg { color: #ffffff !important; opacity: 1 !important; }
#app #studio-sidebar .nav-link.active::after { display: none !important; content: none !important; }
:root:is([data-theme=day], [data-theme=light]) #app #studio-sidebar .nav-group > p { color: rgba(0, 0, 0, .38) !important; }
:root:is([data-theme=day], [data-theme=light]) #app #studio-sidebar .nav-link { color: rgba(0, 0, 0, .62) !important; }
:root:is([data-theme=day], [data-theme=light]) #app #studio-sidebar .nav-link:hover { color: #111111 !important; background: rgba(0, 0, 0, .05) !important; }
:root:is([data-theme=day], [data-theme=light]) #app #studio-sidebar .nav-link.active { color: #111111 !important; background: rgba(0, 0, 0, .07) !important; border-color: rgba(0, 0, 0, .09) !important; }
:root:is([data-theme=day], [data-theme=light]) #app #studio-sidebar .nav-link.active svg { color: #111111 !important; }

#app #studio-sidebar .fa-rail-foot { margin: 6px 14px 0 !important; padding: 10px 0 0 !important; border-top: 1px solid var(--lg-rim, rgba(255, 255, 255, .08)) !important; }
#app #studio-sidebar .fa-rail-help {
  display: grid; place-items: center; width: 34px !important; height: 34px !important; border-radius: 11px !important;
  color: var(--lg-text-3) !important; background: transparent !important; border: 0 !important;
  transition: background .2s ease, color .2s ease;
}
#app #studio-sidebar .fa-rail-help:hover { color: var(--lg-text-1) !important; background: var(--lg-glass-pill-hover, rgba(255, 255, 255, .08)) !important; }

.fx-rail-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 130; border: 0; padding: 0;
  background: rgba(0, 0, 0, .62);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
body.fx-rail-open .fx-rail-backdrop { display: block; }

/* ---------- 侧栏说明浮层 ---------- */
.fx-nav-tip {
  position: fixed; z-index: 1200; left: 0; top: 0; max-width: 240px; padding: 10px 13px 11px;
  display: flex; flex-direction: column; gap: 3px; pointer-events: none;
  border-radius: 13px; border: 1px solid var(--up-border, rgba(255, 255, 255, .1));
  background: var(--lg-glass-modal, rgba(20, 20, 20, .95));
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 18px 44px -18px rgba(0, 0, 0, .75);
  opacity: 0; transform: translate(-6px, -50%) scale(.98); transform-origin: left center;
  transition: opacity .16s ease, transform .2s var(--fx-ease-out);
}
.fx-nav-tip.is-on { opacity: 1; transform: translate(0, -50%) scale(1); }
.fx-nav-tip::before {
  content: ''; position: absolute; left: -5px; top: 50%; width: 9px; height: 9px; margin-top: -5px;
  background: inherit; border-left: 1px solid var(--up-border, rgba(255, 255, 255, .1)); border-bottom: 1px solid var(--up-border, rgba(255, 255, 255, .1));
  transform: rotate(45deg); -webkit-backdrop-filter: none; backdrop-filter: none;
}
.fx-nav-tip b { font-size: 13px; font-weight: 700; color: var(--lg-text-1, #f5f5f5); }
.fx-nav-tip span { font-size: 12px; line-height: 1.55; color: var(--lg-text-2, rgba(229, 229, 229, .78)); }

@keyframes fx-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* 参数菜单移动端不越界 */
.g-param-menu { max-width: calc(100vw - 24px) !important; }

/* 窄屏与移动端统一收口 */
@media (max-width: 820px) {
  :root { --fa-rail-w: 0px; }
  #app #studio-topbar .fa-topbar-left { gap: 8px; }
  #app #studio-topbar .mobile-menu,
  #app #studio-topbar .icon-button.mobile-menu {
    order: -1;
    display: inline-flex !important; align-items: center; justify-content: center;
    width: 34px !important; height: 34px !important; min-width: 34px !important;
    border-radius: 10px !important; border: 1px solid var(--lg-rim) !important;
    background: var(--lg-glass-pill) !important; color: var(--lg-text-1) !important;
  }
  #app #studio-sidebar.fa-rail {
    position: fixed !important; top: var(--fa-header-h, 58px) !important; bottom: 0 !important; left: 0 !important;
    width: 248px !important; z-index: 140 !important;
    background: var(--lg-glass-modal, rgba(16, 16, 16, .96)) !important;
    -webkit-backdrop-filter: blur(24px) !important; backdrop-filter: blur(24px) !important;
    transform: translateX(-100%) !important; transition: transform .22s var(--fx-ease-out) !important;
  }
  #app #studio-sidebar.fa-rail.mobile-open { transform: translateX(0) !important; box-shadow: 24px 0 64px rgba(0, 0, 0, .65) !important; }
  #app #studio-sidebar .nav-link { flex-direction: row !important; justify-content: flex-start !important; min-height: 44px !important; padding: 0 12px !important; gap: 12px !important; font-size: 13px !important; }
  #app #studio-sidebar .nav-link::before { top: 6px; bottom: 6px; left: 4px; right: 4px; width: auto; height: auto; margin: 0; }
  #app #studio-sidebar .nav-link span { margin-top: 0; max-width: none; }
  #app #studio-sidebar .nav-link.active::after { display: none !important; }
  #app #studio-topbar .fa-topbar-context { display: none; }
  #app #studio-topbar .fa-user-name, #app #studio-topbar .credit-pill .credit-unit { display: none; }

  .g-workspace .g-model-picker.is-open {
    display: flex !important;
    position: fixed !important;
    inset: var(--fa-header-h, 58px) auto 0 0 !important;
    width: min(330px, 88vw) !important;
    z-index: 135 !important;
    margin: 0 !important;
    border-radius: 0 20px 0 0 !important;
    background: var(--lg-glass-modal, rgba(16, 16, 16, .96)) !important;
    -webkit-backdrop-filter: blur(24px) saturate(140%) !important;
    backdrop-filter: blur(24px) saturate(140%) !important;
    transform: none !important;
    box-shadow: 24px 0 64px rgba(0, 0, 0, .65) !important;
  }
  .g-picker-backdrop {
    position: fixed; inset: 0; z-index: 130; border: 0; padding: 0;
    background: rgba(0, 0, 0, .58);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  }
  .fx-nav-tip { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  #app #studio-sidebar .nav-link, #app #studio-sidebar .nav-link::before, #app #studio-sidebar .nav-link svg, .fx-nav-tip, #app #studio-topbar .fa-user-menu { transition: none !important; animation: none !important; }
  #app #studio-sidebar .nav-link:hover svg { transform: none; }
}
