/* Chengsi visual refresh: loaded after the original bundled stylesheet. */
:root,
:root[data-theme="dark"] {
  --bg: #0d0e10;
  --bg-2: rgba(19, 20, 23, 0.96);
  --bg-dropdown: #1b1d20;
  --bg-elevated: #17191c;
  --bg-input: rgba(255, 255, 255, 0.075);
  --bg-node: rgba(24, 25, 28, 0.92);
  --bg-panel: rgba(18, 19, 22, 0.94);
  --bg-panel-card: rgba(255, 255, 255, 0.055);
  --bg-panel-solid: rgba(20, 21, 24, 0.96);
  --text-primary: rgba(250, 252, 248, 0.92);
  --text-secondary: rgba(231, 236, 228, 0.68);
  --text-muted: rgba(231, 236, 228, 0.48);
  --text-strong: rgba(255, 255, 255, 0.96);
  --stroke-default: rgba(255, 255, 255, 0.105);
  --stroke-strong: rgba(255, 255, 255, 0.18);
  --surface-node: rgba(23, 24, 27, 0.82);
  --surface-float: rgba(24, 25, 28, 0.96);
  --surface-glass: rgba(22, 23, 26, 0.74);
  --surface-menu: rgba(24, 25, 28, 0.96);
  --surface-save-dialog: rgba(24, 25, 28, 0.98);
  --blue: #4f9dff;
  --cyan: #22d3c5;
  --green: #34d399;
  --gold: #e8b85d;
  --indigo: #5b8cff;
  --purple: #8f7bff;
  --red: #f06565;
  --brand-gradient: linear-gradient(135deg, #2fd49a 0%, #4f9dff 54%, #e8b85d 100%);
  --indigo-gradient: linear-gradient(135deg, #2fd49a, #4f9dff);
  --action-btn-bg: rgba(47, 212, 154, 0.88);
  --action-btn-hover-bg: rgba(68, 226, 171, 0.98);
  --fill-active: rgba(47, 212, 154, 0.18);
  --fill-hover: rgba(255, 255, 255, 0.065);
  --fill-hover-strong: rgba(255, 255, 255, 0.105);
  --fill-input: rgba(255, 255, 255, 0.075);
  --tooltip-bg: rgba(25, 27, 30, 0.98);
  --tooltip-text: rgba(250, 252, 248, 0.94);
  --shadow-menu: 0 18px 48px rgba(0, 0, 0, 0.46), 0 0 0 1px rgba(255, 255, 255, 0.035) inset;
  --shadow-toolbar: 0 14px 36px rgba(0, 0, 0, 0.42);
  --shadow-dialog: 0 28px 80px rgba(0, 0, 0, 0.58);
  --shadow-surface: 0 10px 28px rgba(0, 0, 0, 0.3);
  --header-h: 56px;
  --node-r: 12px;
  --font-11: 11px;
  --font-12: 12px;
  --font-13: 13px;
  --font-14: 14px;
  --font-15: 14px;
  --font-16: 14px;
  --font-17: 15px;
  --font-18: 15px;
  --font-24: 22px;
  --font-28: 24px;
  --radius-18: 14px;
  --radius-20: 14px;
  --sidebar-settings-btn-size: 38px;
  --sidebar-settings-icon-size: 20px;
}

html[data-theme="light"] {
  --bg: #f5f6f4;
  --bg-2: rgba(255, 255, 255, 0.96);
  --bg-dropdown: #ffffff;
  --bg-elevated: #ffffff;
  --bg-input: rgba(17, 24, 39, 0.055);
  --bg-node: rgba(255, 255, 255, 0.92);
  --bg-panel: rgba(255, 255, 255, 0.96);
  --bg-panel-card: rgba(17, 24, 39, 0.04);
  --text-primary: rgba(20, 24, 22, 0.92);
  --text-secondary: rgba(20, 24, 22, 0.68);
  --text-muted: rgba(20, 24, 22, 0.48);
  --text-strong: rgba(15, 18, 16, 0.96);
  --stroke-default: rgba(16, 24, 20, 0.12);
  --stroke-strong: rgba(16, 24, 20, 0.22);
  --surface-node: rgba(255, 255, 255, 0.78);
  --surface-float: rgba(255, 255, 255, 0.96);
  --surface-glass: rgba(255, 255, 255, 0.72);
  --surface-menu: rgba(255, 255, 255, 0.96);
  --surface-save-dialog: rgba(255, 255, 255, 0.98);
  --fill-hover: rgba(18, 24, 20, 0.055);
  --fill-hover-strong: rgba(18, 24, 20, 0.095);
  --fill-input: rgba(18, 24, 20, 0.055);
  --tooltip-bg: rgba(25, 27, 30, 0.98);
  --tooltip-text: rgba(250, 252, 248, 0.94);
}

.v2-badge-beta {
  display: none !important;
}

#sidebarLogoWrap,
#canvasProjDropdown,
.canvas-proj-dropdown {
  display: none !important;
}

.sidebar-floating #btnAssets {
  display: none !important;
}

.v2-asset-sidebar-header,
.v2-workflow-sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v2-asset-sidebar-title,
.v2-workflow-sidebar-title {
  min-width: 0;
  flex: 1 1 auto;
}

.chengsi-aw-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.chengsi-aw-action-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--stroke-default);
  border-radius: 7px;
  background: var(--fill-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.chengsi-aw-action-btn:hover {
  background: var(--fill-hover);
  border-color: var(--stroke-strong);
  color: var(--text-strong);
}

.chengsi-aw-action-btn:active {
  transform: translateY(1px);
}

.chengsi-aw-empty-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.chengsi-aw-empty-actions .chengsi-aw-action-btn {
  min-width: 88px;
}

.v2-asset-empty,
.v2-workflow-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  min-height: 160px;
  text-align: center;
}

.v2-asset-cover-grid.chengsi-asset-cover-grid--count-1,
.v2-asset-cover-grid.chengsi-asset-cover-grid--count-2,
.v2-asset-cover-grid.chengsi-asset-cover-grid--count-3 {
  overflow: hidden;
}

.v2-asset-cover-grid.chengsi-asset-cover-grid--count-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.v2-asset-cover-grid.chengsi-asset-cover-grid--count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 1fr;
}

.v2-asset-cover-grid.chengsi-asset-cover-grid--count-3 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.v2-asset-cover-grid.chengsi-asset-cover-grid--count-1 > .chengsi-asset-cover-cell--empty,
.v2-asset-cover-grid.chengsi-asset-cover-grid--count-2 > .chengsi-asset-cover-cell--empty,
.v2-asset-cover-grid.chengsi-asset-cover-grid--count-3 > .chengsi-asset-cover-cell--empty {
  display: none;
}

.v2-asset-cover-grid.chengsi-asset-cover-grid--count-1 > .chengsi-asset-cover-cell--filled-1 {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}

.v2-asset-cover-grid.chengsi-asset-cover-grid--count-2 > .chengsi-asset-cover-cell--filled-1,
.v2-asset-cover-grid.chengsi-asset-cover-grid--count-2 > .chengsi-asset-cover-cell--filled-2 {
  grid-row: 1 / -1;
}

.v2-asset-cover-grid.chengsi-asset-cover-grid--count-3 > .chengsi-asset-cover-cell--filled-1 {
  grid-row: 1 / -1;
}

.v2-asset-cover-grid.chengsi-asset-cover-grid--count-3 > .chengsi-asset-cover-cell--filled-2 {
  grid-column: 2;
  grid-row: 1;
}

.v2-asset-cover-grid.chengsi-asset-cover-grid--count-3 > .chengsi-asset-cover-cell--filled-3 {
  grid-column: 2;
  grid-row: 2;
}

.chengsi-asset-dock-btn {
  position: fixed;
  top: 50%;
  right: 8px;
  z-index: 770;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 58px;
  padding: 6px 0;
  border: 1px solid rgba(14, 165, 233, 0.34);
  border-radius: 10px 0 0 10px;
  background: rgba(13, 19, 32, 0.92);
  color: #bae6fd;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.chengsi-asset-dock-btn:hover {
  border-color: rgba(14, 165, 233, 0.58);
  background: rgba(14, 165, 233, 0.18);
  color: #e0f2fe;
  transform: translateY(-50%) translateX(-2px);
}

.chengsi-asset-dock-btn[hidden],
body.chengsi-asset-library-expanded .chengsi-asset-dock-btn {
  display: none !important;
}

.v2-asset-item-cover,
.v2-asset-cover-grid,
.v2-asset-cover-cell,
.v2-asset-cover-cell img,
.v2-asset-thumb-img {
  min-width: 0;
  min-height: 0;
}

.v2-asset-cover-cell img,
.v2-asset-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel {
  position: fixed !important;
  inset: 72px 20px 22px auto !important;
  width: min(540px, calc(100vw - 112px)) !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto !important;
  max-height: none !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  border-radius: 16px !important;
  background: rgba(13, 19, 32, 0.96) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.035) inset !important;
  color: var(--text-primary) !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px) scale(0.985) !important;
  transform-origin: right center !important;
  transition: width 0.2s ease, opacity 0.18s ease, transform 0.2s ease !important;
  z-index: 780 !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel.show {
  display: flex !important;
  flex-direction: column !important;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1) !important;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--wide {
  width: min(720px, calc(100vw - 112px)) !important;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-header {
  flex: 0 0 auto;
  min-height: 58px;
  padding: 14px 14px 12px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(10, 15, 28, 0.9) !important;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-title-text {
  color: #e2e8f0 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}

.chengsi-asset-panel-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  flex: 0 0 auto;
}

.chengsi-asset-panel-btn {
  height: 28px;
  min-width: 44px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.72);
  color: #cbd5e1;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.chengsi-asset-panel-btn:hover {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(14, 165, 233, 0.4);
  color: #7dd3fc;
}

.chengsi-asset-panel-btn:active {
  transform: translateY(1px);
}

.chengsi-asset-panel-rail {
  display: none !important;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-tabs {
  flex: 0 0 auto;
  gap: 6px;
  padding: 10px 14px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  background: rgba(13, 19, 32, 0.76) !important;
  overflow-x: auto;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-tab {
  min-width: 72px;
  height: 30px;
  padding: 0 11px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #94a3b8 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-tab:hover,
.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-tab.active {
  border-color: rgba(14, 165, 233, 0.28) !important;
  background: rgba(14, 165, 233, 0.14) !important;
  color: #e2e8f0 !important;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px !important;
  overflow: auto !important;
}

.v2-asset-detail-btn[data-ui-action="asset-add-all"] {
  display: none !important;
}

.v2-asset-sidebar-panel.chengsi-script-library-mode .v2-asset-sidebar-tabs {
  display: none !important;
}

.v2-asset-sidebar-panel.chengsi-script-library-mode .v2-asset-back {
  display: none !important;
}

.chengsi-script-library {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}

.chengsi-script-library-head,
.chengsi-script-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chengsi-script-library-title {
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
}

.chengsi-script-library-subtitle,
.chengsi-script-detail-kicker {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.chengsi-script-back-btn {
  height: 30px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.74);
  color: #cbd5e1;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.chengsi-script-back-btn:hover {
  border-color: rgba(14, 165, 233, 0.42);
  background: rgba(14, 165, 233, 0.14);
  color: #e0f2fe;
}

.chengsi-script-card-grid,
.chengsi-script-asset-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-content: start;
}

.chengsi-script-card {
  position: relative;
  width: 100%;
  padding: 13px;
  border: 1px solid #253047;
  border-radius: 12px;
  background: #111827;
  color: inherit;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.chengsi-script-card-open {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0 28px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chengsi-script-card:hover,
.chengsi-script-asset-card:hover {
  border-color: rgba(14, 165, 233, 0.46);
  background: #142033;
  transform: translateY(-1px);
}

.chengsi-script-card-delete {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  color: #94a3b8;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.chengsi-script-card-delete:hover {
  border-color: rgba(240, 101, 101, 0.42);
  background: rgba(240, 101, 101, 0.15);
  color: #fecaca;
}

.chengsi-script-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chengsi-script-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(47, 212, 154, 0.22), rgba(14, 165, 233, 0.16));
  color: #7dd3fc;
  font-size: 15px;
  font-weight: 900;
}

.chengsi-script-card-title-wrap,
.chengsi-script-detail-title-wrap {
  min-width: 0;
  flex: 1 1 auto;
}

.chengsi-script-card-title,
.chengsi-script-detail-title {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chengsi-script-card-meta {
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.chengsi-script-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.chengsi-script-card-tags span,
.chengsi-script-detail-meta span,
.chengsi-script-asset-kind {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.08);
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.chengsi-script-card-prompt {
  display: -webkit-box;
  margin-top: 10px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.48;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chengsi-script-category-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chengsi-script-category-section {
  min-width: 0;
}

.chengsi-script-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.chengsi-script-category-title {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}

.chengsi-script-category-count {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.chengsi-script-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  align-items: start;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--wide .chengsi-script-category-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.chengsi-script-category-empty {
  min-height: 58px;
  padding: 16px 12px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.28);
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.chengsi-script-asset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  padding: 9px;
  border: 1px solid #253047;
  border-radius: 12px;
  background: #111827;
  cursor: grab;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.chengsi-script-asset-card:active {
  cursor: grabbing;
}

.chengsi-script-asset-cover {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: #0d1320;
  overflow: hidden;
}

.chengsi-script-asset-cover img,
.chengsi-script-subasset-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chengsi-asset-text-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(47, 212, 154, 0.16), rgba(14, 165, 233, 0.12));
  color: #bae6fd;
}

.chengsi-asset-text-thumb span {
  font-size: 20px;
  font-weight: 900;
}

.chengsi-script-asset-count {
  position: absolute;
  right: 7px;
  top: 7px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.76);
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 850;
}

.chengsi-script-asset-body {
  min-width: 0;
  padding: 0 26px 1px 0;
}

.chengsi-script-asset-title {
  margin-top: 7px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chengsi-script-asset-prompt {
  display: -webkit-box;
  margin-top: 8px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chengsi-script-asset-delete,
.chengsi-script-detail-delete {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.7);
  color: #94a3b8;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.chengsi-script-asset-delete {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  line-height: 1;
}

.chengsi-script-detail-delete {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
}

.chengsi-script-asset-delete:hover,
.chengsi-script-detail-delete:hover {
  border-color: rgba(240, 101, 101, 0.4);
  background: rgba(240, 101, 101, 0.14);
  color: #fecaca;
}

.chengsi-script-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chengsi-script-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chengsi-script-subasset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  align-items: start;
}

.chengsi-script-subasset {
  min-width: 0;
  padding: 9px;
  border: 1px solid #253047;
  border-radius: 11px;
  background: #111827;
  cursor: grab;
}

.chengsi-script-subasset:active {
  cursor: grabbing;
}

.chengsi-script-subasset-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  background: #0d1320;
  overflow: hidden;
}

.chengsi-script-subasset-name {
  margin-top: 8px;
  color: #e2e8f0 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.3;
}

.chengsi-script-subasset-prompt {
  display: -webkit-box;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.42;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.chengsi-asset-drag-ghost {
  position: fixed !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  opacity: 0.88;
  transform: translate(-9999px, -9999px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

body.chengsi-asset-dragging,
body.chengsi-asset-dragging * {
  cursor: grabbing !important;
}

.chengsi-script-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
  padding: 20px;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.42);
  text-align: center;
}

.chengsi-script-empty--compact {
  min-height: 128px;
}

.chengsi-script-empty-title {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 850;
}

.chengsi-script-empty-desc {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.45;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-view-list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-content: start;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--wide .v2-asset-view-list {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-item {
  min-width: 0 !important;
  padding: 10px !important;
  border: 1px solid #252d3d !important;
  border-radius: 12px !important;
  background: #141b2a !important;
  box-shadow: none !important;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease !important;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-item:hover {
  border-color: rgba(14, 165, 233, 0.42) !important;
  background: #172033 !important;
  transform: translateY(-1px);
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-item-cover {
  position: relative;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  margin: 0 0 10px !important;
  border-radius: 10px !important;
  background: #0d1320 !important;
  overflow: hidden !important;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-cover-grid {
  position: relative;
}

.chengsi-asset-count-badge {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.74);
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-item-name {
  max-width: 100%;
  color: #e2e8f0 !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chengsi-asset-card-script {
  margin-top: 6px;
  color: #38bdf8;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chengsi-asset-card-prompt {
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid #252d3d;
  border-radius: 8px;
  background: #0d1320;
  pointer-events: none;
}

.chengsi-asset-card-prompt-label {
  display: block;
  margin-bottom: 3px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.chengsi-asset-card-prompt-text {
  display: -webkit-box;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-view-detail {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  min-height: 0;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-subgrid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)) !important;
  gap: 10px !important;
  align-items: start;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--wide .v2-asset-subgrid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-subitem {
  min-width: 0;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-subitem-thumb {
  aspect-ratio: 1 / 1;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-subitem-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chengsi-asset-prompt-section {
  padding: 12px;
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.07);
}

.chengsi-asset-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.chengsi-asset-detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  padding: 0 8px;
  border: 1px solid rgba(14, 165, 233, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.48);
  color: #bae6fd;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chengsi-asset-prompt-label {
  margin-bottom: 6px;
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 800;
}

.chengsi-asset-prompt-text {
  max-height: 168px;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.65;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.chengsi-asset-prompt-empty {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.chengsi-asset-prompt-more {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.chengsi-asset-prompt-more span {
  display: block;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.56);
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.45;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--collapsed {
  width: 0 !important;
  min-width: 0 !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  pointer-events: none;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--collapsed .v2-asset-sidebar-header,
.v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--collapsed .v2-asset-sidebar-tabs,
.v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--collapsed .v2-asset-sidebar-content {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--collapsed .chengsi-asset-panel-rail {
  display: none !important;
}

html[data-theme="light"] .v2-asset-sidebar-panel.chengsi-asset-library-panel {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

html[data-theme="light"] .v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-header,
html[data-theme="light"] .v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-tabs {
  background: rgba(248, 250, 252, 0.9) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-item,
html[data-theme="light"] .chengsi-asset-card-prompt {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

html[data-theme="light"] .v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-title-text,
html[data-theme="light"] .v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-item-name {
  color: #0f172a !important;
}

html[data-theme="light"] .chengsi-script-library-title,
html[data-theme="light"] .chengsi-script-card-title,
html[data-theme="light"] .chengsi-script-category-title,
html[data-theme="light"] .chengsi-script-detail-title,
html[data-theme="light"] .chengsi-script-asset-title,
html[data-theme="light"] .chengsi-script-subasset-name,
html[data-theme="light"] .chengsi-script-empty-title {
  color: #0f172a !important;
}

html[data-theme="light"] .chengsi-script-card,
html[data-theme="light"] .chengsi-script-asset-card,
html[data-theme="light"] .chengsi-script-subasset,
html[data-theme="light"] .chengsi-script-empty,
html[data-theme="light"] .chengsi-script-category-empty {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .chengsi-script-card:hover,
html[data-theme="light"] .chengsi-script-asset-card:hover {
  background: #f1f5f9;
}

html[data-theme="light"] .chengsi-script-asset-cover,
html[data-theme="light"] .chengsi-script-subasset-thumb {
  background: #e2e8f0;
}

html[data-theme="light"] .chengsi-script-library-subtitle,
html[data-theme="light"] .chengsi-script-detail-kicker,
html[data-theme="light"] .chengsi-script-category-count,
html[data-theme="light"] .chengsi-script-category-empty,
html[data-theme="light"] .chengsi-script-card-meta,
html[data-theme="light"] .chengsi-script-card-prompt,
html[data-theme="light"] .chengsi-script-asset-prompt,
html[data-theme="light"] .chengsi-script-subasset-prompt,
html[data-theme="light"] .chengsi-script-empty-desc {
  color: #64748b;
}

html[data-theme="light"] .v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-tab {
  color: #64748b !important;
}

html[data-theme="light"] .v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-tab:hover,
html[data-theme="light"] .v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-sidebar-tab.active {
  background: rgba(14, 165, 233, 0.11) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .chengsi-asset-card-prompt-label,
html[data-theme="light"] .chengsi-asset-prompt-empty {
  color: #64748b;
}

html[data-theme="light"] .chengsi-asset-dock-btn,
html[data-theme="light"] .v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--collapsed .chengsi-asset-panel-rail {
  background: rgba(255, 255, 255, 0.94);
  color: #0369a1;
  border-color: rgba(14, 165, 233, 0.28);
}

html[data-theme="light"] .chengsi-asset-count-badge {
  background: rgba(15, 23, 42, 0.74);
  color: #e0f2fe;
}

html[data-theme="light"] .chengsi-asset-card-script {
  color: #0284c7;
}

html[data-theme="light"] .chengsi-asset-card-prompt-text {
  color: #475569;
}

html[data-theme="light"] .chengsi-asset-prompt-section {
  background: rgba(14, 165, 233, 0.08);
}

html[data-theme="light"] .chengsi-asset-detail-meta span {
  background: rgba(14, 165, 233, 0.08);
  color: #0369a1;
}

html[data-theme="light"] .chengsi-asset-prompt-text {
  color: #1e293b;
}

@media (max-width: 760px) {
  .chengsi-asset-dock-btn {
    right: 5px;
    width: 32px;
    min-height: 54px;
  }

  .v2-asset-sidebar-panel.chengsi-asset-library-panel,
  .v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--wide {
    inset: 64px 12px 14px 64px !important;
    width: auto !important;
  }

  .v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-view-list,
  .v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--wide .v2-asset-view-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .v2-asset-sidebar-panel.chengsi-asset-library-panel .v2-asset-subgrid,
  .v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--wide .v2-asset-subgrid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)) !important;
  }

  .chengsi-script-category-grid,
  .v2-asset-sidebar-panel.chengsi-asset-library-panel.chengsi-asset-panel--wide .chengsi-script-category-grid {
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  }

  .chengsi-script-subasset-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  }
}

html,
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.52;
  letter-spacing: 0;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

#v2-wrap {
  background:
    radial-gradient(circle at 68% 18%, rgba(47, 212, 154, 0.1), transparent 26%),
    radial-gradient(circle at 24% 74%, rgba(232, 184, 93, 0.075), transparent 28%),
    var(--bg);
}

#v2-canvas {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
}

.header {
  height: var(--header-h);
  padding: 0 22px 0 20px;
  background: linear-gradient(180deg, rgba(13, 14, 16, 0.84), rgba(13, 14, 16, 0.52));
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

html[data-theme="light"] .header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.58));
  border-bottom-color: rgba(16, 24, 20, 0.08);
}

.header-left {
  gap: 10px;
}

.logo {
  gap: 9px;
}

.logo svg {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 6px 14px rgba(47, 212, 154, 0.2));
}

.logo-title {
  max-width: 168px;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-tabs-wrap {
  margin-left: 10px;
  gap: 6px;
}

.canvas-tabs {
  gap: 5px;
}

.canvas-tab {
  min-width: 76px;
  max-width: 168px;
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.canvas-tab:hover {
  background: var(--fill-hover);
  color: var(--text-secondary);
}

.canvas-tab.active {
  background: rgba(47, 212, 154, 0.14);
  border-color: rgba(47, 212, 154, 0.26);
  color: var(--text-strong);
}

.canvas-tab-add {
  width: 30px;
  height: 30px;
  border-color: rgba(47, 212, 154, 0.26);
  background: rgba(47, 212, 154, 0.11);
  color: var(--text-primary);
}

.sidebar-floating {
  left: 18px;
  width: 48px;
  padding: 8px 5px;
  gap: 7px;
  border-radius: 16px;
  background: var(--surface-glass);
  border-color: var(--stroke-default);
  box-shadow: var(--shadow-menu);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sidebar-floating .sidebar-btn-v3 {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--text-secondary);
}

.sidebar-floating .sidebar-btn-v3:hover,
.sidebar-floating .sidebar-btn-v3.active {
  background: rgba(255, 255, 255, 0.095);
  color: var(--text-strong);
}

.sidebar-floating .add-btn-v3 {
  background: var(--brand-gradient);
  color: #0a0f0c;
  box-shadow: 0 10px 24px rgba(47, 212, 154, 0.22);
}

.sidebar-floating .add-btn-v3:hover {
  background: var(--brand-gradient);
  color: #0a0f0c;
  transform: translateY(-1px);
}

.sidebar-floating .sidebar-sep-v3 {
  width: 22px;
  background: var(--stroke-default);
}

.sidebar-floating #avatarMenu .avatar-menu-item {
  min-height: 34px;
  padding: 7px 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.canvas-controls-floating {
  left: 18px;
  bottom: 20px;
  min-height: 46px;
  padding: 6px 10px;
  gap: 8px;
  border-radius: 14px;
  background: var(--surface-glass);
  border-color: var(--stroke-default);
  box-shadow: var(--shadow-menu);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.cc-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.cc-btn:hover,
.cc-btn.active {
  background: var(--fill-hover-strong);
  color: var(--text-strong);
}

.zoom-controls {
  gap: 10px;
  padding-left: 2px;
}

.zoom-slider {
  width: 116px;
  height: 4px;
  background: rgba(255, 255, 255, 0.16);
}

.zoom-slider::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  background: var(--text-strong);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
}

.zoom-percent {
  min-width: 42px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.minimap-wrapper {
  left: 18px;
  bottom: 76px;
  border-radius: 14px;
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.node-add-menu {
  width: min(420px, calc(100vw - 36px));
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-float);
  border: 1px solid var(--stroke-default);
  box-shadow: var(--shadow-menu);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nam-section-title {
  padding: 2px 2px 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nam-grid {
  gap: 8px;
}

.nam-item {
  flex-direction: row;
  justify-content: flex-start;
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 650;
  gap: 10px;
  text-align: left;
}

.nam-item:hover {
  background: var(--fill-hover);
  border-color: var(--stroke-default);
  color: var(--text-strong);
  transform: translateY(-1px);
}

.nam-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--green);
}

.nam-badge {
  position: static;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(79, 157, 255, 0.14);
  color: #9ec7ff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.nam-badge.beta,
.v2-node-beta-pill {
  background: rgba(232, 184, 93, 0.16);
  border-color: rgba(232, 184, 93, 0.28);
  color: #f1cc83;
}

.empty-hint {
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--stroke-default);
  border-radius: 16px;
  background: rgba(18, 19, 22, 0.58);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

html[data-theme="light"] .empty-hint {
  background: rgba(255, 255, 255, 0.68);
}

.empty-hint-main {
  gap: 8px;
}

.hint-badge svg {
  width: 24px;
  height: 24px;
}

.v2-empty-hint-title {
  color: var(--text-strong);
  font-size: 17px;
  font-weight: 750;
}

.v2-empty-hint-subtitle {
  color: var(--text-muted);
  font-size: 13px;
}

.empty-hint-pills {
  gap: 8px;
}

.pill-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke-default);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.pill-btn:hover {
  background: rgba(47, 212, 154, 0.14);
  border-color: rgba(47, 212, 154, 0.26);
  color: var(--text-strong);
  transform: translateY(-1px);
}

.mascot-wrap {
  right: 20px;
  bottom: 20px;
  transform: scale(0.9);
  transform-origin: right bottom;
}

.mascot-bubble {
  border: 1px solid var(--stroke-default);
  background: var(--surface-float);
  color: var(--text-secondary);
  box-shadow: var(--shadow-menu);
}

.node-label {
  bottom: calc(100% + 7px);
  padding: 3px 7px;
  color: rgba(239, 243, 237, 0.54);
  font-size: 16px;
  font-weight: 650;
  text-shadow: none;
}

.node-label:hover {
  background: rgba(255, 255, 255, 0.065);
  color: var(--text-primary);
}

.v2-node.selected .node-label {
  color: var(--text-strong);
  text-shadow: none;
}

.node-card,
.source-text-card,
.preview-node .preview-card,
.storyboard-script-node {
  border-color: var(--stroke-default);
  border-radius: var(--node-r);
  background: var(--bg-node);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.node:not(.selected) .node-card:hover {
  border-color: var(--stroke-strong);
}

.node.selected:not(.comment-note-node) .node-card,
.v2-node.selected .source-text-card {
  border-color: rgba(47, 212, 154, 0.52);
  box-shadow:
    0 0 0 1px rgba(47, 212, 154, 0.28),
    0 14px 44px rgba(0, 0, 0, 0.35);
}

.source-text-content,
.text-card-content,
.preview-content-text {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.68;
}

.prompt-textarea,
.settings-input,
input[type="password"],
input[type="text"],
textarea {
  border-color: var(--stroke-default);
  background: var(--fill-input);
  color: var(--text-primary);
  font-size: 13px;
}

.prompt-textarea:focus,
.settings-input:focus,
input[type="password"]:focus,
input[type="text"]:focus,
textarea:focus {
  border-color: rgba(47, 212, 154, 0.45);
  box-shadow: 0 0 0 3px rgba(47, 212, 154, 0.12);
  outline: 0;
}

.node-floating-toolbar.v2-comment-toolbar,
.node-floating-toolbar.v2-img-toolbar,
.node-floating-toolbar.v2-text-toolbar,
.node-floating-toolbar.v2-video-toolbar {
  gap: 5px;
  padding: 5px;
  border-radius: 11px;
  background: var(--surface-float);
  border-color: var(--stroke-default);
  box-shadow: var(--shadow-toolbar);
}

.ftb-btn {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-secondary);
}

.ftb-btn:hover,
.ftb-btn.active {
  background: var(--fill-hover-strong);
  color: var(--text-strong);
}

.settings-overlay {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.settings-modal {
  width: min(1120px, calc(100vw - 44px));
  max-height: min(820px, calc(100vh - 44px));
  border: 1px solid var(--stroke-default);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-save-dialog);
  box-shadow: var(--shadow-dialog);
}

.settings-nav {
  width: 188px;
  padding: 18px 12px;
  background: rgba(255, 255, 255, 0.035);
  border-right: 1px solid var(--stroke-default);
}

.settings-nav-title {
  margin: 0 8px 14px;
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 800;
}

.settings-nav-item {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.settings-nav-item:hover {
  background: var(--fill-hover);
  color: var(--text-primary);
}

.settings-nav-item.active {
  background: rgba(47, 212, 154, 0.14);
  color: var(--text-strong);
}

.settings-content {
  padding: 0;
}

.settings-pane-title {
  margin: 0 0 14px;
  padding: 22px 30px 16px;
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 800;
}

.settings-pane-body {
  padding: 0 30px 24px;
  gap: 12px;
}

.settings-pane-footer {
  padding: 12px 30px 16px;
}

.settings-section,
.settings-card {
  border-color: var(--stroke-default);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.settings-section {
  padding: 14px 15px;
  margin-bottom: 12px;
}

.settings-card {
  padding: 14px 15px;
  margin-bottom: 12px;
}

.settings-row {
  grid-template-columns: minmax(220px, 330px) minmax(0, 1fr);
  gap: 18px;
}

.settings-label {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 750;
}

.settings-desc,
.settings-desc-lead {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.settings-card-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 760;
}

.settings-card-badge,
.settings-card-icon {
  box-shadow: inset 0 0 0 1px var(--stroke-default);
}

.settings-provider-status {
  height: 19px;
  font-size: 10px;
}

.settings-save-btn,
.settings-getkey,
.subscription-gate-btn {
  min-height: 34px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 750;
}

.settings-save-btn:not(.settings-btn-ghost),
.subscription-gate-btn.is-primary {
  border-color: rgba(47, 212, 154, 0.4);
  background: var(--action-btn-bg);
  color: #07110d;
}

.settings-save-btn:not(.settings-btn-ghost):hover,
.subscription-gate-btn.is-primary:hover {
  background: var(--action-btn-hover-bg);
}

.settings-save-btn.settings-btn-ghost,
.subscription-gate-btn {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--stroke-default);
  color: var(--text-secondary);
}

#shortcutsPresetControl,
.settings-section--shortcuts {
  display: none !important;
}

.cursor-size-btn,
.settings-preset-trigger {
  min-height: 34px;
  border-radius: 9px;
  border-color: var(--stroke-default);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-secondary);
  font-size: 13px;
}

.cursor-size-btn.active,
.settings-preset-option.is-active {
  background: rgba(47, 212, 154, 0.15);
  border-color: rgba(47, 212, 154, 0.3);
  color: var(--text-strong);
}

.canvas-proj-dropdown,
.avatar-menu,
.settings-preset-menu,
.global-tooltip {
  border-color: var(--stroke-default);
  border-radius: 12px;
  background: var(--surface-float);
  box-shadow: var(--shadow-menu);
}

.cpd-title {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 800;
}

.cpd-item-name,
.cpd-item-date {
  font-size: 13px;
}

.cpd-new-btn {
  min-height: 34px;
  border-color: rgba(47, 212, 154, 0.25);
  background: rgba(47, 212, 154, 0.12);
  color: var(--text-strong);
  font-weight: 750;
}

.v2-canvas-ctx-menu,
.v2-node-picker,
.v2-quote-menu {
  min-width: 210px;
  padding: 6px;
  border-color: var(--stroke-default);
  border-radius: 13px;
  background: var(--surface-float);
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: var(--shadow-menu);
}

.v2-node-picker {
  width: 286px;
}

.v2-menu-title,
.v2-quote-title {
  padding: 7px 9px 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.v2-menu-row,
.v2-node-picker .v2-menu-row {
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 9px;
  color: var(--text-primary);
}

.v2-menu-row:hover,
.v2-node-picker .v2-menu-row:hover {
  background: var(--fill-hover);
}

.v2-menu-lbl,
.v2-menu-sub,
.v2-menu-kbd {
  font-size: 13px;
}

.v2-menu-ico,
.v2-node-picker .v2-menu-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.save-dialog {
  width: min(380px, calc(100vw - 32px));
  border-color: var(--stroke-default);
  border-radius: 15px;
  background: var(--surface-save-dialog);
  box-shadow: var(--shadow-dialog);
}

.save-dialog-title {
  font-size: 17px;
  font-weight: 800;
}

.save-dialog-input {
  min-height: 38px;
  border-color: var(--stroke-default);
  background: var(--fill-input);
  font-size: 14px;
}

.save-dialog-cancel,
.save-dialog-confirm {
  min-height: 34px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 750;
}

#v2-server-disconnect-alert,
#v2-debug {
  font-size: 12px;
  letter-spacing: 0;
}

#pane-api-input,
.settings-nav-item[data-pane="api-input"],
#pane-api-input .settings-card:has(#providerKey-apimart),
#pane-api-input .settings-card:has(#providerUrl-apimart),
#pane-api-input .settings-card:has(#providerKey-grsai),
#pane-api-input .settings-card:has(#providerUrl-grsai),
#pane-api-input .settings-card:has(#providerKey-ppio),
#pane-api-input .settings-card:has(#providerUrl-ppio),
#pane-api-input .settings-card:has(#providerKey-runninghub),
#pane-api-input .settings-card:has(#providerUrl-runninghub),
#pane-api-input .settings-card:has(#providerKey-runninghub-model),
#dreaminaSettingsCard,
#providerTestStatus-apimart,
#providerTestStatus-grsai,
#providerTestStatus-ppio,
#providerTestStatus-runninghub {
  display: none !important;
}

@media (max-width: 900px) {
  :root,
  :root[data-theme="dark"] {
    --header-h: 52px;
  }

  .header {
    padding: 0 14px;
  }

  .logo-title {
    max-width: 136px;
    font-size: 14px;
  }

  .canvas-tabs-wrap {
    max-width: calc(100vw - 190px);
  }

  .sidebar-floating {
    left: 12px;
    transform: translateY(-50%) scale(0.94);
    transform-origin: left center;
  }

  .canvas-controls-floating {
    left: 12px;
    right: 12px;
    width: auto;
    justify-content: center;
  }

  .zoom-slider {
    width: 92px;
  }

  .settings-modal {
    width: calc(100vw - 24px);
  }

  .settings-nav {
    width: 154px;
  }

  .settings-row {
    grid-template-columns: 1fr;
  }

  .settings-row > :last-child {
    justify-self: stretch;
  }
}
