/* crosscore shared base styles (batch3 single-source)
 * 来源：12 站 styles.css 顶层节点字节精确全同集合（规则 + 整个 @media 块 + at-rule）。
 * 生成：scratch/shared-audit/css-extract-shared.mjs（v1，勿手改）；v2 于 2026-09-19 手工增量修改：
 * 主题按用户隔离 + 亮色舞台（--stage* 系列与舞台控件变量化）；变更必须 bump 版本并重跑批次 3/批次 4 验收探针。
 * 加载：各站 index.html <link> 于站内打包样式之前；由 crosscore /shared/ 托管（immutable）。
 */

:root {
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #e7edf5;
  background: #0c1016;
  font-synthesis: none;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

body {
  overflow: hidden;
}

.app-error-boundary {
  display: grid;
  width: 100%;
  min-height: 100%;
  place-items: center;
  padding: 24px;
  background: #0c1016;
}

.app-error-panel {
  display: grid;
  width: min(620px, 100%);
  gap: 14px;
  border: 1px solid rgba(244, 101, 121, 0.42);
  border-radius: 8px;
  background: rgba(18, 23, 31, 0.96);
  padding: 24px;
  color: #ffc2ca;
}

.app-error-panel h1,
.app-error-panel p {
  margin: 0;
}

.app-error-panel h1 {
  margin-bottom: 6px;
  color: #f1f7fb;
  font-size: 20px;
}

.app-error-panel p {
  color: #b9cad9;
  line-height: 1.6;
}

.app-error-eyebrow {
  color: #ff8fa1 !important;
  font-size: 12px;
}

.app-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-error-actions button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(244, 101, 121, 0.64);
  background: rgba(218, 58, 83, 0.16);
  color: #ffe3e8;
  cursor: pointer;
  padding: 7px 11px;
}

.app-error-actions button.secondary {
  border-color: rgba(124, 148, 170, 0.36);
  background: rgba(255, 255, 255, 0.045);
  color: #d6e3ee;
}

.app-error-panel details {
  border-top: 1px solid rgba(124, 148, 170, 0.2);
  padding-top: 12px;
  color: #9fb1c0;
}

.app-error-panel summary {
  cursor: pointer;
}

.app-error-panel pre {
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #f1c5cc;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.preview-error-boundary {
  display: contents;
}

.preview-runtime-error {
  display: grid;
  width: min(520px, calc(100% - 32px));
  min-height: 180px;
  align-content: center;
  justify-items: start;
  gap: 12px;
  margin: auto;
  border: 1px solid rgba(244, 101, 121, 0.42);
  border-radius: 8px;
  background: rgba(20, 24, 31, 0.94);
  padding: 22px;
  color: #ffc2ca;
}

.preview-runtime-error h2,
.preview-runtime-error p {
  margin: 0;
}

.preview-runtime-error h2 {
  margin-bottom: 5px;
  color: #f1f7fb;
  font-size: 18px;
}

.preview-runtime-error p,
.preview-runtime-error details {
  color: #b9cad9;
  line-height: 1.55;
}

.preview-runtime-error-eyebrow {
  color: #f46579 !important;
  font-size: 12px;
  font-weight: 700;
}

.preview-runtime-error button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(244, 101, 121, 0.54);
  border-radius: 5px;
  background: rgba(244, 101, 121, 0.12);
  padding: 8px 11px;
  color: #ffd2d8;
  cursor: pointer;
}

.preview-runtime-error button:hover {
  background: rgba(244, 101, 121, 0.2);
}

.preview-runtime-error details {
  width: 100%;
  border-top: 1px solid rgba(124, 148, 170, 0.2);
  padding-top: 10px;
}

.preview-runtime-error summary {
  cursor: pointer;
}

.preview-runtime-error pre {
  overflow: auto;
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #f1c5cc;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 352px;
  width: 100%;
  height: 100%;
  min-height: 720px;
  background:
    linear-gradient(135deg, rgba(46, 200, 224, 0.12), transparent 31%),
    linear-gradient(225deg, rgba(229, 57, 84, 0.1), transparent 28%),
    #0c1016;
}

.archive-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 352px;
  width: 100%;
  height: 100%;
  min-height: 720px;
  background:
    linear-gradient(135deg, rgba(46, 200, 224, 0.12), transparent 31%),
    linear-gradient(225deg, rgba(229, 57, 84, 0.1), transparent 28%),
    #0c1016;
}

.app-shell > .sidebar,
.archive-shell > .sidebar {
  grid-column: 1;
  grid-row: 1;
}

.app-shell > .workspace,
.archive-shell > .workspace {
  grid-column: 2;
  grid-row: 1;
}

.app-shell > .layer-debug-dock,
.archive-shell > .layer-debug-dock {
  grid-column: 3;
  grid-row: 1;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 352px;
}

.archive-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 352px;
}

.app-shell.layer-sidebar-collapsed {
  grid-template-columns: 260px minmax(0, 1fr) 0;
}

.archive-shell.layer-sidebar-collapsed {
  grid-template-columns: 260px minmax(0, 1fr) 0;
}

.app-shell.sidebar-collapsed.layer-sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}

.archive-shell.sidebar-collapsed.layer-sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}

.sidebar,
.inspector {
  min-height: 0;
  border-color: rgba(124, 148, 170, 0.18);
  background: rgba(13, 18, 25, 0.92);
  backdrop-filter: blur(12px);
}

.sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  padding: 20px 16px;
  border-right: 1px solid rgba(124, 148, 170, 0.2);
  transition: padding 160ms ease;
}

.sidebar.sidebar-collapsed-shell {
  position: absolute;
  top: 14px;
  left: 12px;
  z-index: 6;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  gap: 0;
  background: transparent;
  border-right: 0;
  backdrop-filter: none;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(96, 226, 255, 0.48);
  background: linear-gradient(145deg, rgba(55, 213, 242, 0.22), rgba(236, 68, 99, 0.14));
  color: #c8f6ff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-block h1,
.topbar h2,
.inspector h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand-block h1 {
  font-size: 18px;
  line-height: 1.1;
}

.brand-block p,
.topbar p,
.preview-caption,
.sidebar-foot,
.kv dt,
.kv dd,
.tree-title small,
.ui-node-card small {
  color: #8ea1b5;
}

.brand-block p {
  margin: 4px 0 0;
  font-size: 12px;
}

.brand-copy {
  min-width: 0;
  flex: 1;
}

.page-navigation {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  width: 100%;
}

.page-navigation-primary {
  display: inline-flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--ui-line);
  background: var(--ui-surface-muted);
  color: var(--ui-muted);
  cursor: pointer;
  font-size: 12px;
}

/* 角色页入口维持原有蓝色选中态，零改动。 */
.page-navigation-primary:hover,
.page-navigation-primary.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ui-ink);
}

.page-navigation-other { min-width: 0; }

.page-navigation-other > .page-navigation-primary { width: 100%; }

/* 「更多资源」入口（2026-09-28）：紫青渐变高亮，与角色页蓝色组件明确区分。
   展开态用实心渐变，收起态用渐变描边 + 渐变软底，保证两种状态都有强引导。 */
.page-navigation-other > .page-navigation-primary {
  position: relative;
  min-height: 38px;
  border-color: var(--moreres-line);
  background: var(--moreres-grad-soft);
  color: var(--moreres-ink);
  font-weight: 700;
}

.page-navigation-other > .page-navigation-primary::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--moreres-grad);
}

.page-navigation-other > .page-navigation-primary svg {
  transition: transform 160ms ease;
}

.page-navigation-other > .page-navigation-primary[aria-expanded='true'] {
  border-color: transparent;
  background: var(--moreres-grad);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(162, 28, 175, 0.35);
}

.page-navigation-other > .page-navigation-primary[aria-expanded='true']::before {
  display: none;
}

.page-navigation-other > .page-navigation-primary[aria-expanded='true'] svg {
  transform: rotate(180deg);
}

.page-navigation-other > .page-navigation-primary:hover {
  border-color: transparent;
  background: var(--moreres-grad);
  color: #ffffff;
}

.page-navigation-menu {
  position: absolute;
  z-index: 24;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: min(240px, 100%);
  overflow: hidden;
  border: 1px solid var(--moreres-line);
  border-radius: 10px;
  background: var(--ui-surface-strong);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
}

/* 下拉面板顶部渐变条：即使只看一眼也能识别这是「更多资源」块。 */
.page-navigation-menu::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--moreres-grad);
}

.page-navigation-menu button {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  background: transparent;
  color: var(--ui-ink);
  cursor: pointer;
  padding: 9px 11px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
}

.page-navigation-menu button:last-child { border-bottom: 0; }

.page-navigation-menu button:hover,
.page-navigation-menu button.active {
  background: var(--moreres-grad-soft);
  color: var(--moreres-ink);
}

.sidebar-toggle {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  padding: 0;
}

.sidebar-toggle {
  width: 30px;
  height: 30px;
}

.sidebar-toggle:hover {
  border-color: rgba(96, 226, 255, 0.54);
  background: rgba(96, 226, 255, 0.12);
}

.sidebar-toggle:hover {
  border-color: rgba(96, 226, 255, 0.54);
  background: rgba(96, 226, 255, 0.12);
}

.sidebar-collapsed .sidebar {
  align-items: center;
  padding: 12px 8px;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mode-switch.compact {
  width: 100%;
  grid-template-columns: 1fr;
  margin-bottom: 12px;
}

.mode-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.035);
  color: #9db2c8;
  cursor: pointer;
  padding: 0 10px;
}

.mode-switch button.active {
  border-color: rgba(94, 225, 255, 0.5);
  background: rgba(61, 209, 238, 0.12);
  color: #ecf7ff;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.045);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e7edf5;
  font-size: 13px;
}

.rarity-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rarity-filter button {
  min-width: 0;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.035);
  color: #9db2c8;
  cursor: pointer;
  padding: 5px 9px;
  font-size: 12px;
  line-height: 1;
}

.rarity-filter button.active {
  border-color: rgba(94, 225, 255, 0.5);
  background: rgba(61, 209, 238, 0.12);
  color: #ecf7ff;
}

.character-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 3px;
}

.workspace,
.character-list,
.asset-strip,
.layer-debug-list,
.layer-picked-list,
.inspector,
.ui-grid {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.workspace::-webkit-scrollbar,
.character-list::-webkit-scrollbar,
.asset-strip::-webkit-scrollbar,
.layer-debug-list::-webkit-scrollbar,
.layer-picked-list::-webkit-scrollbar,
.inspector::-webkit-scrollbar,
.ui-grid::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.character-row {
  display: grid;
  grid-template-columns: 42px 1fr 16px;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  padding: 7px;
  text-align: left;
  content-visibility: auto;
  contain-intrinsic-size: auto 56px;
}

.character-row.card-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 88px;
  border: 1px solid transparent;
  background-color: rgba(255, 255, 255, 0.035);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
  content-visibility: auto;
  contain-intrinsic-size: auto 88px;
  overflow: hidden;
}

.character-row.card-row > *,
.character-skin-row.card-row > * {
  position: relative;
  z-index: 1;
}

.character-row:not(.card-row):hover,
.character-row:not(.card-row).active {
  border-color: rgba(94, 225, 255, 0.46);
  background: rgba(61, 209, 238, 0.1);
}

.character-row.card-row:hover,
.character-row.card-row.active {
  border-color: rgba(94, 225, 255, 0.46);
  background-color: rgba(61, 209, 238, 0.08);
}

.character-entry {
  display: flex;
  flex-direction: column;
}

.character-skin-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 22px;
}

.character-skin-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.character-skin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  padding: 6px 8px;
  text-align: left;
  color: #9db2c8;
  font-size: 12px;
}

.character-skin-row.card-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 58px;
  border: 1px solid transparent;
  background-color: rgba(255, 255, 255, 0.025);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
  color: #9db2c8;
  font-size: 12px;
  overflow: hidden;
}

.character-skin-row.card-row::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
}

.character-skin-row:not(.card-row):hover,
.character-skin-row:not(.card-row).active {
  border-color: rgba(94, 225, 255, 0.46);
  background: rgba(61, 209, 238, 0.1);
  color: #ecf7ff;
}

.character-skin-row.card-row:hover,
.character-skin-row.card-row.active {
  border-color: rgba(94, 225, 255, 0.46);
  background-color: rgba(61, 209, 238, 0.08);
  color: #ecf7ff;
}

.character-skin-group.favorited > .character-skin-row,
.character-skin-row.favorited {
  border-color: rgba(246, 195, 67, 0.7);
  background-color: rgba(241, 164, 42, 0.08);
  color: #fff3d1;
  box-shadow: inset 0 0 0 1px rgba(255, 226, 158, 0.18);
}

.character-skin-group.favorited > .character-skin-row::before,
.character-skin-row.favorited::before {
  background: linear-gradient(180deg, rgba(246, 195, 67, 0.18), rgba(241, 164, 42, 0.12));
}

.character-skin-group.favorited > .character-skin-row:hover {
  border-color: rgba(255, 220, 130, 0.95);
  background-color: rgba(241, 164, 42, 0.12);
  color: #fffaeb;
}

.character-skin-group.favorited > .character-skin-row:hover::before {
  background: linear-gradient(180deg, rgba(246, 195, 67, 0.28), rgba(241, 164, 42, 0.18));
}

.live2d-skin-list {
  padding-top: 2px;
}

.live2d-card-group {
  margin-top: 0;
}

.character-skin-group.favorited .character-skin-asset.active {
  border-color: rgba(246, 195, 67, 0.7);
  background: rgba(246, 195, 67, 0.16);
  color: #fff3d1;
}

.skin-favorite-mark {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: #f6c343;
  filter: drop-shadow(0 0 4px rgba(246, 195, 67, 0.45));
}

.character-skin-assets {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 14px;
}

.character-skin-asset {
  display: flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  padding: 4px 8px;
  text-align: left;
  color: #8ea1b5;
  font-size: 11px;
}

.character-skin-asset:hover,
.character-skin-asset.active {
  border-color: rgba(94, 225, 255, 0.46);
  background: rgba(61, 209, 238, 0.1);
  color: #ecf7ff;
}

.skin-thumb {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(124, 148, 170, 0.18);
  background: #171f2a;
  color: #bdefff;
  font-weight: 700;
  font-size: 10px;
}

.skin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.skin-thumb-empty {
  opacity: 0.8;
}

.skin-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portrait {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  background: #171f2a;
  color: #bdefff;
  font-weight: 700;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.row-copy {
  min-width: 0;
}

.card-row .row-copy {
  position: relative;
  z-index: 1;
  align-self: end;
}

.row-copy strong,
.row-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-copy strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.row-copy strong span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-copy small {
  margin-top: 3px;
  color: #8ea1b5;
  font-size: 11px;
}

.card-row .row-copy strong {
  font-size: 15px;
  color: #f2f8ff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

.card-row .row-copy small {
  color: #c5d5e5;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.rarity-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin-left: 8px;
  padding: 0;
  font-style: normal;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 0.8px rgba(39, 20, 6, 0.82);
  paint-order: stroke fill;
  filter: drop-shadow(0 0 6px rgba(255, 209, 96, 0.32));
}

.rarity-badge.tier-6 {
  color: #ffd54d;
  text-shadow:
    0 0 3px rgba(255, 228, 148, 0.95),
    0 0 12px rgba(255, 189, 58, 0.82),
    0 2px 6px rgba(0, 0, 0, 0.52);
}

.rarity-badge.tier-5 {
  color: #92f2ff;
  text-shadow:
    0 0 3px rgba(223, 253, 255, 0.92),
    0 0 12px rgba(110, 233, 255, 0.78),
    0 2px 6px rgba(0, 0, 0, 0.5);
}

.rarity-badge.tier-4 {
  color: #d5a8ff;
  text-shadow:
    0 0 3px rgba(247, 228, 255, 0.9),
    0 0 12px rgba(198, 129, 255, 0.72),
    0 2px 6px rgba(0, 0, 0, 0.5);
}

.rarity-badge.tier-default {
  color: #d6deea;
  text-shadow:
    0 0 2px rgba(244, 247, 255, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.46);
}

.rarity-badge.large {
  margin-left: 10px;
  font-size: 19px;
  transform: translateY(1px);
}

.sidebar-foot {
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(124, 148, 170, 0.16);
  padding-top: 12px;
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-footer-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-service-actions {
  display: none !important;
}

.sidebar-service-action {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.035);
  color: #9db2c8;
  cursor: pointer;
  padding: 0;
}

.sidebar-service-action:hover {
  border-color: rgba(94, 225, 255, 0.5);
  background: rgba(61, 209, 238, 0.12);
  color: #ecf7ff;
}

.sidebar-service-action.active {
  border-color: rgba(94, 225, 255, 0.5);
  background: rgba(61, 209, 238, 0.12);
  color: #ecf7ff;
}

.sidebar-service-action.danger:hover {
  border-color: rgba(255, 117, 136, 0.65);
  background: rgba(229, 57, 84, 0.16);
  color: #ffd9df;
}

.sidebar-service-action.guide:hover {
  border-color: rgba(207, 172, 255, 0.62);
  background: rgba(157, 111, 214, 0.15);
  color: #f0e4ff;
}

.sidebar-service-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

.sidebar-service-error {
  min-width: 0;
  color: #ff9eac;
  font-size: 11px;
  line-height: 1.35;
}

.usage-guide-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 8, 12, 0.76);
  backdrop-filter: blur(8px);
}

.usage-guide-dialog {
  display: flex;
  width: min(760px, 100%);
  max-height: min(760px, calc(100dvh - 48px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(124, 148, 170, 0.28);
  background: #111821;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  outline: none;
}

.usage-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(124, 148, 170, 0.18);
  padding: 22px 24px 18px;
}

.usage-guide-header-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.usage-guide-lan-entry {
  display: flex;
  width: min(360px, 100%);
  align-items: center;
  gap: 9px;
  margin-top: 15px;
  border: 1px solid rgba(94, 225, 255, 0.28);
  background: rgba(61, 209, 238, 0.08);
  color: #dff9ff;
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
}

.usage-guide-lan-entry:hover {
  border-color: rgba(94, 225, 255, 0.62);
  background: rgba(61, 209, 238, 0.15);
}

.usage-guide-lan-entry > svg:first-child {
  flex: 0 0 auto;
  color: #72dff3;
}

.usage-guide-lan-entry > svg:last-child {
  flex: 0 0 auto;
  margin-left: auto;
  color: #8ca9bb;
}

.usage-guide-lan-entry span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.usage-guide-lan-entry strong {
  font-size: 12px;
  font-weight: 650;
}

.usage-guide-lan-entry small {
  color: #91afbe;
  font-size: 10px;
  line-height: 1.35;
}

.lan-access-panel {
  display: grid;
  width: 180px;
  flex: 0 0 180px;
  gap: 7px;
  align-content: start;
  border-left: 1px solid rgba(124, 148, 170, 0.18);
  padding-left: 18px;
}

.lan-access-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e7f8ff;
  font-size: 12px;
}

.lan-access-heading svg {
  color: #72dff3;
}

.lan-access-qr,
.lan-access-qr-placeholder {
  display: block;
  width: 148px;
  height: 148px;
  justify-self: start;
  border: 5px solid #fff;
  background: #fff;
  object-fit: contain;
}

.lan-access-qr-placeholder {
  display: grid;
  place-items: center;
  padding: 12px;
  color: #71859a;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.lan-access-details {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #9fb1c3;
  font-size: 10px;
  line-height: 1.4;
}

.lan-access-details code {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  color: #d8f7ff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lan-access-details small {
  color: #71859a;
  font-size: 10px;
}

.lan-access-muted {
  color: #c9aab0;
}

.lan-access-dialog {
  width: min(720px, 100%);
}

.lan-access-dialog-content {
  overflow-y: auto;
}

.lan-access-dialog-top {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  padding: 22px 24px 26px;
}

.lan-access-dialog-top > .lan-access-panel {
  width: auto;
  flex: 0 1 auto;
  border-left: 0;
  border-right: 1px solid rgba(124, 148, 170, 0.18);
  padding: 0 28px 0 0;
}

.lan-access-help {
  display: grid;
  gap: 24px;
  align-content: start;
}

.lan-access-help-section {
  display: grid;
  gap: 9px;
}

.lan-access-help-section h3 {
  margin: 0;
  color: #e7edf5;
  font-size: 14px;
  line-height: 1.35;
}

.lan-access-help-section ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 21px;
}

.lan-access-help-section li,
.lan-access-help-section dd {
  color: #a9b8c8;
  font-size: 13px;
  line-height: 1.6;
}

.lan-access-help-section dl {
  display: grid;
  gap: 13px;
  margin: 0;
}

.lan-access-help-section dl div {
  display: grid;
  gap: 3px;
}

.lan-access-help-section dt {
  color: #dbe9f3;
  font-size: 12px;
  font-weight: 650;
}

.lan-access-help-section dd {
  margin: 0;
}

.usage-guide-header h2,
.usage-guide-header p,
.usage-guide-section h3,
.usage-guide-section p,
.usage-guide-section ol,
.usage-guide-section ul {
  margin: 0;
}

.usage-guide-header h2 {
  margin-top: 5px;
  color: #f2f7fc;
  font-size: 22px;
  line-height: 1.2;
}

.usage-guide-header p:last-child {
  margin-top: 8px;
  color: #8ea1b5;
  font-size: 12px;
  line-height: 1.5;
}

.usage-guide-eyebrow {
  color: #72dff3;
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.usage-guide-close {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid rgba(124, 148, 170, 0.24);
  background: rgba(255, 255, 255, 0.04);
  color: #9db2c8;
  cursor: pointer;
  padding: 0;
}

.usage-guide-close:hover {
  border-color: rgba(94, 225, 255, 0.5);
  background: rgba(61, 209, 238, 0.12);
  color: #ecf7ff;
}

.usage-guide-content {
  display: grid;
  gap: 20px;
  overflow-y: auto;
  padding: 20px 24px 26px;
}

.usage-guide-section {
  display: grid;
  gap: 9px;
  border-top: 1px solid rgba(124, 148, 170, 0.16);
  padding-top: 16px;
}

.usage-guide-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.usage-guide-section h3 {
  color: #e7edf5;
  font-size: 14px;
  line-height: 1.35;
}

.usage-guide-section p,
.usage-guide-section li {
  color: #a9b8c8;
  font-size: 13px;
  line-height: 1.65;
}

.usage-guide-section ol,
.usage-guide-section ul {
  display: grid;
  gap: 6px;
  padding-left: 21px;
}

.usage-guide-section code {
  border: 1px solid rgba(124, 148, 170, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #d8e8f5;
  padding: 1px 5px;
  font-size: 12px;
}

.usage-guide-link {
  color: #72dff3;
  text-decoration: underline;
  text-decoration-color: rgba(114, 223, 243, 0.45);
  text-underline-offset: 2px;
}

.usage-guide-link:hover {
  color: #ecf7ff;
  text-decoration-color: currentColor;
}

.usage-guide-note {
  border-top-color: rgba(94, 225, 255, 0.24);
}

.settings-grid {
  display: grid;
  gap: 16px;
  align-content: start;
}

.settings-page-shell {
  width: 100%;
  height: 100%;
  overflow: auto;
  background:
    linear-gradient(135deg, rgba(46, 200, 224, 0.12), transparent 31%),
    linear-gradient(225deg, rgba(229, 57, 84, 0.1), transparent 28%),
    #0c1016;
}

.settings-page {
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.settings-page-header {
  display: grid;
  gap: 16px;
}

.settings-page-copy {
  display: grid;
  gap: 6px;
}

.settings-page-copy h1,
.settings-page-copy p {
  margin: 0;
}

.settings-page-copy h1 {
  font-size: 28px;
  line-height: 1.1;
}

.settings-page-copy > p:last-child {
  color: #8ea1b5;
  line-height: 1.6;
}

.settings-back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 38px;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.035);
  color: #d8e3ef;
  cursor: pointer;
  padding: 0 14px;
}

.settings-back-button:hover,
.settings-action:hover,
.sidebar-service-action:hover {
  border-color: rgba(94, 225, 255, 0.5);
  background: rgba(61, 209, 238, 0.12);
}

.settings-card {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-card-header h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.settings-eyebrow {
  margin: 0;
  color: #8ea1b5;
  font-size: 12px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.settings-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.035);
  color: #d8e3ef;
  cursor: pointer;
  padding: 0 12px;
}

.settings-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.settings-action .is-spinning {
  animation: settings-spin 1s linear infinite;
}

.settings-status-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(255, 255, 255, 0.025);
}

.settings-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.settings-status-badge.comparison-update-available {
  color: #ffe0a8;
  background: rgba(255, 182, 72, 0.14);
}

.settings-status-badge.comparison-up-to-date {
  color: #d9f8ff;
  background: rgba(61, 209, 238, 0.14);
}

.settings-status-badge.comparison-baseline-missing,
.settings-status-badge.comparison-remote-unavailable {
  color: #ffd8dc;
  background: rgba(229, 57, 84, 0.14);
}

.settings-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-kv-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(255, 255, 255, 0.025);
}

.settings-kv-card span,
.settings-kv-card small {
  color: #8ea1b5;
}

.settings-kv-card strong {
  font-size: 18px;
  color: #f1f6fb;
}

.settings-note-list {
  display: grid;
  gap: 12px;
}

.settings-note-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(255, 255, 255, 0.025);
}

.settings-note-item p,
.settings-error {
  margin: 0;
  color: #8ea1b5;
  line-height: 1.6;
}

.settings-error {
  color: #ffb6c0;
}

.settings-source-link {
  color: #9fe8ff;
  text-decoration: none;
}

.settings-source-link:hover {
  text-decoration: underline;
}

@keyframes settings-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.layer-debug-dock {
  position: relative;
  display: block;
  min-height: 0;
  height: 100%;
  border-left: 1px solid rgba(124, 148, 170, 0.2);
  background: rgba(13, 18, 25, 0.92);
  overflow: hidden;
  overscroll-behavior: contain;
  backdrop-filter: blur(12px);
}

.layer-debug-dock.collapsed {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  min-width: 0;
  min-height: 0;
  display: block;
  overflow: visible;
  border-left: 0;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.layer-debug-toggle-collapsed {
  position: absolute;
  top: 14px;
  right: 12px;
  z-index: 6;
  pointer-events: auto;
}

.layer-debug-toggle-expanded {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
}

.layer-debug-dock.collapsed .layer-debug-panel {
  display: none;
}

.app-shell.sidebar-collapsed > .workspace,
.archive-shell.sidebar-collapsed > .workspace {
  padding-left: 12px;
}

.app-shell.layer-sidebar-collapsed > .workspace,
.archive-shell.layer-sidebar-collapsed > .workspace {
  padding-right: 12px;
}

.app-shell.sidebar-collapsed.layer-sidebar-collapsed > .workspace,
.archive-shell.sidebar-collapsed.layer-sidebar-collapsed > .workspace {
  padding-left: 12px;
  padding-right: 12px;
}

.layer-debug-toggle,
.layer-debug-group-toggle {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  padding: 0;
}

.layer-debug-toggle {
  width: 30px;
  height: 30px;
}

.layer-debug-toggle:hover,
.layer-debug-group-toggle:hover {
  border-color: rgba(96, 226, 255, 0.54);
  background: rgba(96, 226, 255, 0.12);
}

.layer-debug-panel {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.layer-debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-left: 42px;
}

.layer-debug-header small,
.layer-debug-row small,
.layer-debug-empty {
  color: #8ea1b5;
}

.layer-debug-actions {
  display: flex;
  gap: 8px;
}

.layer-debug-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  width: 30px;
  min-width: 30px;
  padding: 0;
}

.layer-debug-actions button:hover {
  border-color: rgba(96, 226, 255, 0.54);
  background: rgba(96, 226, 255, 0.12);
}

.layer-debug-actions button.active {
  border-color: rgba(248, 185, 88, 0.48);
  background: rgba(248, 185, 88, 0.14);
  color: #ffe0a8;
}

.layer-debug-outline-button {
  align-self: center;
  width: fit-content;
  min-width: 0;
  padding: 4px 10px;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  color: #d3e2ef;
  cursor: pointer;
  font-size: 11px;
  backdrop-filter: blur(18px) saturate(170%);
}

.layer-debug-outline-button:hover {
  border-color: rgba(150, 174, 198, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.04);
  color: #f3f8fd;
}

.layer-debug-outline-button.active {
  border-color: rgba(248, 185, 88, 0.52);
  background:
    linear-gradient(180deg, rgba(248, 185, 88, 0.18), rgba(248, 185, 88, 0.06)),
    rgba(248, 185, 88, 0.08);
  color: #ffe8bc;
  box-shadow:
    0 0 0 1px rgba(248, 185, 88, 0.16),
    0 0 12px rgba(248, 185, 88, 0.12);
  text-shadow: none;
}

.layer-debug-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.045);
  padding: 0 10px;
}

.layer-debug-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e7edf5;
  font-size: 12px;
}

.layer-debug-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 2px;
}

.layer-picked-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(248, 185, 88, 0.24);
  background: rgba(248, 185, 88, 0.08);
  padding: 10px;
}

.layer-picked-list {
  display: flex;
  max-height: 132px;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.layer-picked-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid rgba(248, 185, 88, 0.2);
  background: rgba(255, 255, 255, 0.04);
  padding: 7px 8px;
}

.layer-picked-row input {
  margin: 2px 0 0;
}

.layer-picked-copy {
  min-width: 0;
}

.layer-picked-copy strong {
  display: block;
  color: #ffe6b7;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-picked-copy small {
  display: block;
  color: #c2a978;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-debug-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layer-debug-group-row {
  display: grid;
  grid-template-columns: 20px 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(255, 255, 255, 0.04);
  padding: 7px 8px;
}

.layer-debug-group-row.muted {
  opacity: 0.48;
}

.layer-debug-group-row.partial {
  border-color: rgba(248, 185, 88, 0.28);
}

.layer-debug-group-row.picked {
  border-color: rgba(248, 185, 88, 0.48);
  background: rgba(248, 185, 88, 0.1);
}

.layer-debug-group-toggle {
  width: 20px;
  height: 20px;
}

.layer-debug-group-toggle svg {
  transition: transform 140ms ease;
}

.layer-debug-group-toggle svg.expanded {
  transform: rotate(90deg);
}

.layer-debug-group-copy {
  min-width: 0;
}

.layer-debug-group-copy strong,
.layer-debug-group-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-debug-group-copy strong {
  color: #e7edf5;
  font-size: 12px;
}

.layer-debug-group-copy small {
  margin-top: 2px;
  color: #8ea1b5;
  font-size: 11px;
}

.layer-debug-group-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 0;
}

.layer-debug-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 8px;
}

.layer-debug-row-main {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
}

.layer-debug-row input {
  margin: 2px 0 0;
}

.layer-debug-row.muted {
  opacity: 0.46;
}

.layer-debug-row.outlined {
  border-color: rgba(124, 148, 170, 0.18);
  background: rgba(255, 255, 255, 0.01);
  box-shadow: none;
  filter: none;
}

.layer-debug-row.outlined .layer-debug-copy strong,
.layer-debug-row.outlined .layer-debug-copy small {
  text-shadow: none;
}

.layer-debug-row.picked {
  border-color: rgba(248, 185, 88, 0.48);
  background: rgba(248, 185, 88, 0.12);
}

.layer-debug-copy {
  min-width: 0;
}

.layer-debug-copy strong,
.layer-debug-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-debug-copy strong {
  color: #e7edf5;
  font-size: 12px;
}

.layer-debug-copy small {
  margin-top: 2px;
  font-size: 11px;
}

.layer-debug-empty {
  padding: 8px 2px;
  font-size: 12px;
}

.workspace {
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  padding: 18px 22px 24px;
}

.preview-workspace {
  position: relative;
  height: 100%;
  min-height: 0;
}

.preview-stage {
  height: 100%;
  min-height: 0;
}

.preview-stage-panel {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.preview-stage-panel .spine-shell,
.preview-stage-panel .static-preview,
.preview-stage-panel .preview-frame,
.preview-stage-panel .archive-preview-frame {
  height: 100%;
  margin-top: 0;
}

.preview-stage-panel .preview-caption {
  display: none;
}

.preview-stage-panel .dragonbones-shell,
.preview-stage-panel .dragonbones-canvas {
  height: 100%;
  min-height: 0;
}

.preview-stage-panel .spine-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}

.archive-variant-strip {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 12px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 96px);
}

.archive-variant-strip button {
  min-width: 42px;
  min-height: 30px;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(7, 10, 15, 0.74);
  color: #bfd3e4;
  cursor: pointer;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1;
  backdrop-filter: blur(18px);
}

.archive-variant-strip button[aria-label="切换形态"] {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.archive-variant-strip button:hover {
  border-color: rgba(96, 226, 255, 0.54);
  background: rgba(96, 226, 255, 0.12);
  color: #ecf7ff;
}

.archive-variant-strip button.active {
  border-color: rgba(96, 226, 255, 0.72);
  background: rgba(96, 226, 255, 0.16);
  color: #f3fbff;
}

.archive-variant-strip .mod-variant-button {
  min-width: 34px;
  min-height: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(248, 185, 88, 0.24);
  background:
    linear-gradient(180deg, rgba(248, 185, 88, 0.18), rgba(210, 138, 35, 0.1)),
    rgba(7, 10, 15, 0.74);
  color: #ffe1ac;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.1),
    0 8px 16px rgba(0, 0, 0, 0.1);
}

.archive-variant-strip .mod-variant-button:hover {
  border-color: rgba(255, 220, 130, 0.92);
  background:
    linear-gradient(180deg, rgba(248, 185, 88, 0.32), rgba(210, 138, 35, 0.16)),
    rgba(7, 10, 15, 0.78);
  color: #fff7dc;
}

.archive-variant-strip .mod-variant-button.active {
  border-color: rgba(255, 224, 166, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 224, 166, 0.34), rgba(218, 150, 40, 0.18)),
    rgba(7, 10, 15, 0.8);
  color: #fff8e7;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.1),
    0 0 0 1px rgba(255, 226, 158, 0.16),
    0 8px 18px rgba(0, 0, 0, 0.12);
}

.preview-drawer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  height: 48px;
  border: 1px solid rgba(124, 148, 170, 0.18);
  background: rgba(8, 13, 20, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.34);
}

.preview-drawer.is-open {
  top: 0;
  height: 100%;
}

.preview-drawer-handle {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(10, 15, 23, 0.98);
}

.preview-drawer-tabs {
  display: flex;
  min-width: 0;
  flex: 1;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.preview-drawer-tabs::-webkit-scrollbar {
  display: none;
}

.preview-drawer-status {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  max-width: min(28vw, 220px);
}

.preview-drawer-status-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.preview-drawer-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: #d7e4ef;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-drawer-status-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: #d7e4ef;
  cursor: pointer;
  flex: 0 0 auto;
}

.preview-drawer-status-icon-button:hover:not(:disabled) {
  border-color: rgba(239, 110, 110, 0.55);
  background: rgba(239, 110, 110, 0.1);
}

.preview-drawer-status-icon-button.danger {
  color: #f3c7c7;
}

.preview-drawer-status-icon-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.preview-drawer-tabs button,
.preview-drawer-toggle,
.drawer-chip-row span {
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.045);
}

.preview-drawer-tabs button {
  flex: 0 0 auto;
  padding: 7px 12px;
  color: #bfd4e5;
  font-size: 12px;
  cursor: pointer;
}

.preview-drawer-tabs button.active {
  border-color: rgba(96, 226, 255, 0.68);
  background: rgba(96, 226, 255, 0.1);
  color: #d9f6ff;
}

.preview-drawer-toggle {
  flex: 0 0 auto;
  padding: 7px 12px;
  color: #d6e7f3;
  font-size: 12px;
  cursor: pointer;
}

.preview-drawer-panel {
  min-height: 0;
  flex: 1;
}

.preview-drawer-scroll {
  height: 100%;
  overflow: auto;
  padding: 16px;
}

.preview-drawer-section {
  display: grid;
  gap: 14px;
}

.voice-ui-section {
  display: grid;
  gap: 14px;
}

.voice-runtime-panel { display: grid; gap: 12px; }

.voice-runtime-summary, .voice-runtime-missing, .voice-runtime-categories, .voice-runtime-tags { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

.voice-runtime-summary span, .voice-runtime-missing span, .voice-runtime-tags span { border: 1px solid rgba(124,148,170,.22); background: rgba(255,255,255,.045); color: #b6c8da; font-size: 12px; padding: 5px 8px; }

.voice-runtime-summary .voice-runtime-warning, .voice-runtime-error { color: #ffb38a; }

.voice-runtime-toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }

.voice-runtime-categories button { border: 1px solid rgba(124,148,170,.25); background: rgba(255,255,255,.04); color: #a9bed0; padding: 6px 10px; cursor: pointer; }

.voice-runtime-categories button.active { border-color: rgba(96,226,255,.65); color: #ecfbff; background: rgba(96,226,255,.12); }

.voice-runtime-search { display: flex; flex: 1 1 min(280px, 100%); align-items: center; gap: 6px; border: 1px solid rgba(124,148,170,.25); padding: 6px 8px; min-width: 0; color: #8ea1b5; }

.voice-runtime-search input { border: 0; outline: 0; background: transparent; color: #ecf5fb; width: 100%; }

.voice-runtime-transport { padding: 7px 10px; border: 1px solid rgba(96,226,255,.28); background: rgba(96,226,255,.06); }

.voice-runtime-list { display: grid; gap: 8px; }

.voice-runtime-row { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; align-items: center; padding: 10px; border: 1px solid rgba(124,148,170,.16); background: rgba(255,255,255,.03); }

.voice-runtime-row.playing { border-color: rgba(96,226,255,.55); background: rgba(96,226,255,.07); }

.voice-runtime-play { display: grid; place-items: center; border: 1px solid rgba(96,226,255,.35); background: transparent; color: #b9efff; width: 30px; height: 30px; cursor: pointer; }

.voice-runtime-copy { min-width: 0; display: grid; gap: 4px; }

.voice-runtime-copy strong { color: #ecf5fb; }

.voice-runtime-copy small { color: #8ea1b5; font-size: 11px; }

.voice-runtime-copy p { margin: 0; color: #dbe8f3; line-height: 1.5; }

.voice-runtime-no-subtitle { color: #8194a8 !important; font-style: italic; }

.voice-runtime-fallback { color: #e9c98f !important; }

.voice-runtime-error { color: #ffb38a !important; }

.voice-runtime-active-player { width: 100%; height: 34px; }

.live2d-shell { position: relative; }

.live2d-loading-shell .spine-canvas { display: grid; place-items: center; }

.live2d-debug-dock { position: absolute; right: 10px; bottom: 28px; width: min(360px, 44%); max-height: 54%; overflow: auto; padding: 10px; border: 1px solid rgba(124,148,170,.26); background: rgba(7,11,17,.88); backdrop-filter: blur(8px); z-index: 3; }

.live2d-debug-title, .live2d-hit-areas { display: flex; gap: 6px; align-items: center; color: #dcebf5; font-size: 12px; }

.live2d-debug-title small { margin-left: auto; color: #8ea1b5; }

.live2d-hit-areas { margin-top: 7px; color: #9bd8b8; font-size: 11px; }

.live2d-drawable-search { display: grid; gap: 4px; margin-top: 8px; color: #8ea1b5; font-size: 10px; }

.live2d-drawable-search input { width: 100%; min-height: 28px; border: 1px solid rgba(124,148,170,.24); background: rgba(255,255,255,.04); color: #e5f2fb; padding: 5px 7px; font-size: 11px; }

.live2d-drawable-search input:focus { border-color: rgba(96,226,255,.65); outline: 2px solid rgba(96,226,255,.18); outline-offset: 1px; }

.live2d-drawable-list { position: relative; height: 220px; margin-top: 8px; overflow: auto; overscroll-behavior: contain; }

.live2d-drawable-virtual-spacer { position: relative; min-width: 100%; }

.live2d-drawable-row { position: absolute; right: 0; left: 0; display: grid; grid-template-columns: 24px minmax(0,1fr) auto auto; gap: 5px; align-items: center; box-sizing: border-box; height: 30px; padding: 4px; border: 1px solid transparent; color: #b6c8da; cursor: pointer; }

.live2d-drawable-row:hover, .live2d-drawable-row.selected { border-color: rgba(96,226,255,.55); background: rgba(96,226,255,.08); }

.live2d-drawable-row.hidden { opacity: .5; }

.live2d-drawable-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }

.live2d-drawable-row small { color: #71869b; font-size: 10px; }

.live2d-drawable-row button { border: 1px solid rgba(124,148,170,.25); background: transparent; color: #9fb8ca; padding: 2px 5px; cursor: pointer; font-size: 10px; }

.live2d-drawable-row button.active { color: #63e6ff; border-color: #63e6ff; }

.live2d-drawable-row:focus-visible { border-color: rgba(96,226,255,.8); outline: 2px solid rgba(96,226,255,.24); outline-offset: -1px; }

.live2d-drawable-empty { display: grid; height: 100%; place-items: center; color: #8ea1b5; font-size: 11px; }

@media (max-width: 760px) {
  .live2d-debug-dock { width: calc(100% - 20px); max-height: 40%; }
}

.static-drawer-shell {
  height: 100%;
  min-height: 0;
}

.drawer-card,
.drawer-summary {
  border: 1px solid rgba(124, 148, 170, 0.18);
  background: rgba(13, 18, 25, 0.72);
}

.drawer-card {
  min-width: 0;
  padding: 14px;
}

.drawer-summary {
  padding: 14px;
}

.voice-debug-panel {
  display: grid;
  gap: 12px;
}

.voice-debug-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-debug-summary span,
.voice-candidate-flags span,
.voice-skin-stats span,
.voice-existing-tag {
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: #b6c8da;
  font-size: 12px;
}

.voice-debug-summary span,
.voice-skin-stats span,
.voice-existing-tag {
  padding: 6px 9px;
}

.voice-debug-list {
  display: grid;
  gap: 12px;
}

.voice-skin-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(8, 13, 20, 0.62);
  padding: 12px;
}

.voice-skin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.voice-skin-copy {
  min-width: 0;
}

.voice-skin-copy strong,
.voice-skin-copy small {
  display: block;
}

.voice-skin-copy strong {
  color: #e7edf5;
  font-size: 14px;
}

.voice-skin-copy small {
  margin-top: 3px;
  color: #8ea1b5;
  font-size: 11px;
  word-break: break-all;
}

.voice-skin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.voice-existing-lines {
  display: grid;
  gap: 8px;
}

.voice-existing-line {
  display: grid;
  gap: 6px;
  border-left: 2px solid rgba(96, 226, 255, 0.38);
  padding-left: 10px;
}

.voice-existing-line p,
.voice-candidate-text,
.voice-empty-text {
  margin: 0;
  color: #dbe8f3;
  line-height: 1.6;
}

.voice-candidate-copy {
  display: grid;
  gap: 6px;
}

.voice-candidate-translation {
  margin: 0;
  color: #9bd8b8;
  line-height: 1.6;
}

.voice-candidate-list {
  display: grid;
  gap: 10px;
}

.voice-candidate-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
}

.voice-candidate-card.quality-strong {
  border-color: rgba(96, 226, 255, 0.34);
  background: rgba(96, 226, 255, 0.06);
}

.voice-candidate-card.quality-usable {
  border-color: rgba(248, 185, 88, 0.28);
}

.voice-candidate-card.quality-noise {
  opacity: 0.72;
}

.voice-candidate-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.voice-candidate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.voice-candidate-meta strong {
  color: #ecf5fb;
  font-size: 13px;
}

.voice-candidate-meta span {
  color: #8ea1b5;
  font-size: 12px;
}

.voice-candidate-header audio {
  width: min(420px, 100%);
  height: 34px;
}

.voice-candidate-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.voice-candidate-flags span {
  padding: 4px 8px;
}

.drawer-summary-header p {
  margin: 0 0 5px;
  color: #8ea1b5;
  font-size: 12px;
}

.drawer-summary-header h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  line-height: 1;
}

.drawer-summary-header h2 .alt-name {
  margin-left: 0;
  color: #60e2ff;
  font-size: 16px;
  font-weight: 500;
}

.drawer-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.drawer-chip-row span {
  padding: 7px 10px;
  color: #b6c8da;
  font-size: 12px;
}

.topbar {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(124, 148, 170, 0.18);
  margin-bottom: 16px;
}

.topbar p {
  margin: 0 0 5px;
  font-size: 12px;
}

.topbar h2 {
  font-size: 30px;
  line-height: 1;
}

.topbar h2 span {
  margin-left: 12px;
  color: #60e2ff;
  font-size: 17px;
  font-weight: 500;
}

.topbar-stats {
  display: flex;
  gap: 8px;
}

.topbar-stats span,
.preview-caption strong,
.component-tags span,
.asset-thumb span,
.animation-grid button,
.prefab-tabs button {
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.045);
}

.topbar-stats span {
  padding: 7px 10px;
  color: #b6c8da;
  font-size: 12px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.art-panel,
.spine-panel,
.ui-reference,
.inspector,
.inspector-section {
  border: 1px solid rgba(124, 148, 170, 0.18);
  background: rgba(13, 18, 25, 0.68);
}

.art-panel,
.spine-panel {
  min-width: 0;
  padding: 14px;
}

.panel-title,
.inspector h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d8e8f5;
  font-size: 13px;
  font-weight: 700;
}

.static-preview {
  margin-top: 12px;
}

.static-preview-layout {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  flex: 1;
}

.preview-frame {
  position: relative;
  display: grid;
  height: clamp(230px, 34vh, 320px);
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(124, 148, 170, 0.16);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 36px 36px,
    radial-gradient(circle at 50% 15%, rgba(93, 224, 255, 0.16), transparent 38%),
    #101722;
}

.preview-frame::before {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(96, 226, 255, 0.18);
  content: "";
  pointer-events: none;
}

.character-art {
  position: relative;
  max-width: 96%;
  max-height: 96%;
  object-fit: contain;
  filter: drop-shadow(0 26px 36px rgba(0, 0, 0, 0.45));
}

.static-drawer-card {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.static-drawer-layout {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 12px;
}

.static-preview-main {
  min-height: 0;
  flex: 1;
}

.static-preview-strip {
  flex: 0 0 auto;
  border-top: 1px solid rgba(124, 148, 170, 0.14);
  padding-top: 12px;
}

.static-preview-frame {
  flex: 1;
  height: 100%;
  min-height: 0;
  cursor: grab;
  touch-action: none;
}

.static-preview-frame.is-dragging {
  cursor: grabbing;
}

.static-preview-canvas {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
  transform-origin: center center;
  will-change: transform;
}

.static-character-art {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 920px);
  max-height: 100%;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.static-preview-toolbar {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.static-preview-action,
.static-preview-zoom {
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(7, 10, 15, 0.7);
  color: #d9edf9;
  font-size: 12px;
}

.static-preview-action {
  padding: 6px 10px;
  cursor: pointer;
}

.static-preview-zoom {
  padding: 6px 8px;
}

.archive-preview-frame {
  height: 100%;
  min-height: 0;
}

.archive-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: rgba(7, 11, 17, 0.72);
}

.empty-preview {
  display: grid;
  place-items: center;
  gap: 10px;
  color: #8ea1b5;
}

.preview-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
}

.preview-caption span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-badges {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.preview-caption strong {
  padding: 4px 8px;
  color: #c6eefd;
  font-size: 11px;
}

.preview-caption .warning-badge {
  border-color: rgba(248, 185, 88, 0.4);
  color: #ffd38a;
}

.asset-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 8px;
  margin-top: 12px;
  max-height: 210px;
  overflow-y: auto;
}

.static-preview-strip .asset-strip {
  margin-top: 0;
  max-height: 190px;
}

.asset-thumb {
  position: relative;
  height: 78px;
  overflow: hidden;
  border: 1px solid rgba(124, 148, 170, 0.18);
  background: #121a25;
  cursor: pointer;
  padding: 0;
}

.asset-thumb.active {
  border-color: rgba(96, 226, 255, 0.72);
}

.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.asset-thumb span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 2px 5px;
  background: rgba(7, 10, 15, 0.75);
  color: #d6e7f3;
  font-size: 10px;
}

.asset-thumb i {
  position: absolute;
  left: 4px;
  bottom: 4px;
  border: 1px solid rgba(248, 185, 88, 0.4);
  background: rgba(48, 34, 12, 0.82);
  color: #ffd58e;
  font-size: 10px;
  font-style: normal;
  padding: 2px 5px;
}

.spine-shell {
  position: relative;
  margin-top: 12px;
}

.dragonbones-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 280px;
  overflow: hidden;
  background: #080b10;
}

.dragonbones-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.dragonbones-canvas.is-dragging {
  cursor: grabbing;
}

.dragonbones-runtime-host {
  position: absolute;
  inset: 0;
}

.dragonbones-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.dragonbones-control-layout .spine-row small {
  color: #7f96aa;
}

.stage-toolbar {
  position: absolute;
  z-index: 4;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  justify-content: flex-start;
  width: fit-content;
  pointer-events: none;
}

.stage-toolbar > * {
  pointer-events: auto;
}

.stage-toolbar .current-animation {
  width: fit-content;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 8px;
  border: 1px solid rgba(163, 185, 205, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(7, 10, 15, 0.06);
  color: #d8f6ff;
  font-size: 12px;
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 22px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-toolbar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.stage-toolbar-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  justify-content: flex-start;
  padding: 6px 8px;
  color: #bcd2e2;
  font-size: 11px;
  border: 1px solid rgba(163, 185, 205, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.015);
  backdrop-filter: blur(28px) saturate(160%);
}

.stage-toolbar-actions button > span {
  color: #f7fbff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.58);
  transition: color 160ms ease, text-shadow 160ms ease;
}

.stage-toolbar-actions button.toolbar-tone-dark > span {
  color: #101923;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.58);
}

.stage-toolbar-actions button:hover:not(:disabled) {
  border-color: rgba(96, 226, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(96, 226, 255, 0.1), rgba(96, 226, 255, 0.05)),
    rgba(96, 226, 255, 0.04);
}

.stage-toolbar-actions button.active {
  border-color: rgba(96, 226, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(96, 226, 255, 0.12), rgba(96, 226, 255, 0.06)),
    rgba(96, 226, 255, 0.05);
  color: #d9f8ff;
}

.stage-toolbar-actions button:disabled {
  cursor: default;
}

.stage-toolbar-actions button {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spine-canvas {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(640px, calc(100vh - 180px), 1680px);
  overflow: hidden;
  border: 0;
  background:
    linear-gradient(135deg, rgba(229, 57, 84, 0.13), transparent 30%),
    radial-gradient(circle at 50% 20%, rgba(96, 226, 255, 0.12), transparent 42%),
    #0e141d;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.spine-canvas.is-dragging {
  cursor: grabbing;
}

.spine-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.spine-subtitle-overlay {
  position: absolute;
  z-index: 5;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(8, 11, 16, 0.74), rgba(8, 11, 16, 0.9));
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.spine-subtitle-overlay.is-playing {
  border-color: rgba(96, 226, 255, 0.24);
}

.spine-subtitle-source {
  color: rgba(225, 234, 242, 0.68);
  font-size: 11px;
  line-height: 1.45;
}

.spine-subtitle-text {
  color: #f4f8fb;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 600;
}

.spine-favorite {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 6;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #bcd2e2;
  cursor: pointer;
  transition:
    color 140ms ease,
    transform 120ms ease;
}

.spine-favorite:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.spine-favorite:hover:not(:disabled) {
  color: #ff7a8c;
  transform: scale(1.12);
}

.spine-favorite.active {
  color: #ff5570;
  filter: drop-shadow(0 0 6px rgba(255, 85, 112, 0.45));
}

.spine-variant-switch {
  position: absolute;
  top: 22px;
  left: 62px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 52px;
  height: 36px;
  padding: 0 6px;
  border: 1px solid rgba(102, 208, 224, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(74, 186, 208, 0.24), rgba(35, 112, 143, 0.16)),
    rgba(10, 18, 24, 0.28);
  color: #bfeef5;
  cursor: pointer;
  transition:
    color 140ms ease,
    transform 120ms ease,
    border-color 140ms ease,
    background 140ms ease;
  backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(224, 252, 255, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.12);
}

.spine-variant-switch span {
  min-width: 20px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.spine-variant-switch:hover {
  border-color: rgba(161, 241, 249, 0.92);
  background:
    linear-gradient(180deg, rgba(88, 207, 226, 0.36), rgba(38, 132, 161, 0.22)),
    rgba(10, 18, 24, 0.32);
  color: #effcff;
  transform: translateY(-1px);
}

.spine-mod-switch {
  position: absolute;
  top: 22px;
  left: 62px;
  z-index: 6;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(248, 185, 88, 0.22);
  background:
    linear-gradient(180deg, rgba(248, 185, 88, 0.2), rgba(210, 138, 35, 0.12)),
    rgba(10, 10, 12, 0.18);
  color: #ffe1ac;
  cursor: pointer;
  transition:
    color 140ms ease,
    transform 120ms ease,
    border-color 140ms ease,
    background 140ms ease;
  backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.1),
    0 8px 18px rgba(0, 0, 0, 0.12);
}

.spine-mod-switch:hover {
  border-color: rgba(255, 220, 130, 0.9);
  background:
    linear-gradient(180deg, rgba(248, 185, 88, 0.34), rgba(210, 138, 35, 0.18)),
    rgba(10, 10, 12, 0.22);
  color: #fff7dc;
  transform: translateY(-1px);
}

.spine-mod-switch.active {
  border-color: rgba(255, 224, 166, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 224, 166, 0.38), rgba(218, 150, 40, 0.2)),
    rgba(10, 10, 12, 0.24);
  color: #fff8e7;
  filter: drop-shadow(0 0 8px rgba(248, 185, 88, 0.28));
}

.spine-mod-switch.has-variant-switch {
  left: 122px;
}

.spine-placeholder {
  color: #8ea1b5;
  font-size: 12px;
}

.control-panel {
  margin-top: 12px;
}

.spine-control-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.spine-control-main {
  min-width: 0;
}

.spine-control-rail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c4d8e8;
  font-size: 12px;
  font-weight: 700;
}

.panel-heading-with-actions {
  justify-content: space-between;
  gap: 12px;
}

.panel-heading-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel-action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  border: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: #bcd2e2;
  cursor: pointer;
  padding: 6px 9px;
  font-size: 11px;
  backdrop-filter: blur(16px) saturate(160%);
}

.panel-action-button:hover:not(:disabled) {
  border-color: rgba(96, 226, 255, 0.58);
  background: rgba(96, 226, 255, 0.1);
}

.panel-action-button:disabled {
  cursor: default;
  opacity: 0.58;
}

.panel-action-button.saved {
  border-color: rgba(96, 226, 255, 0.68);
  background: rgba(96, 226, 255, 0.12);
  color: #d9f8ff;
}

.panel-action-button.error {
  border-color: rgba(248, 185, 88, 0.54);
  background: rgba(248, 185, 88, 0.12);
  color: #ffe1a6;
}

.spine-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.spine-group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.spine-group-row {
  border: 1px solid rgba(124, 148, 170, 0.18);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 10px;
  color: #c7d9e7;
  font-size: 12px;
}

.spine-group-row small {
  color: #8ea1b5;
  font-size: 11px;
}

.spine-group-row.active {
  border-color: rgba(96, 226, 255, 0.68);
  background: rgba(96, 226, 255, 0.1);
}

.spine-row,
.animation-grid button,
.prefab-tabs button {
  border: 1px solid rgba(124, 148, 170, 0.18);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.spine-row {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  text-align: left;
}

.spine-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.spine-row small {
  color: #8ea1b5;
  font-size: 11px;
}

.spine-row.active,
.animation-grid button.active,
.prefab-tabs button.active {
  border-color: rgba(96, 226, 255, 0.68);
  background: rgba(96, 226, 255, 0.1);
}

.spine-row.blocked {
  border-color: rgba(248, 185, 88, 0.28);
  color: #ffe0a8;
}

.spine-row.blocked small,
.warning-text {
  color: #f8b958 !important;
}

.spine-rail-panel {
  border: 1px solid rgba(124, 148, 170, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    rgba(10, 15, 22, 0.22);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 34px rgba(0, 0, 0, 0.14);
  padding: 10px;
}

.spine-rail-save {
  align-self: stretch;
  justify-content: center;
}

.animation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 6px;
}

.spine-rail-animation-grid {
  margin-top: 0;
}

.animation-grid button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  color: #bcd2e2;
  font-size: 11px;
  border: 1px solid rgba(124, 148, 170, 0.14);
  background: rgba(255, 255, 255, 0.028);
  backdrop-filter: blur(14px) saturate(160%);
  min-width: 0;
  justify-content: center;
}

.ui-reference {
  min-width: 0;
  padding: 14px;
}

.resource-strip-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
  margin-top: 16px;
}

.archive-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.archive-stage-stack {
  display: grid;
  gap: 18px;
}

.archive-secondary-panel {
  min-width: 0;
}

.archive-info-panel {
  min-width: 0;
  margin-top: 18px;
  border: 1px solid rgba(124, 148, 170, 0.18);
  background: rgba(13, 18, 25, 0.88);
}

.prefab-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.prefab-tabs button {
  padding: 7px 10px;
  color: #bfd4e5;
  font-size: 12px;
}

.ui-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.ui-node-card {
  min-width: 0;
  border: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.ui-node-card strong,
.tree-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.ui-node-card small,
.tree-title small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.component-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.component-tags span {
  padding: 2px 5px;
  font-size: 10px;
}

.tone-static {
  border-color: rgba(96, 226, 255, 0.34) !important;
  color: #bcefff;
}

.tone-behavior {
  border-color: rgba(248, 185, 88, 0.34) !important;
  color: #ffd58e;
}

.tone-record {
  border-color: rgba(188, 126, 255, 0.34) !important;
  color: #d6b7ff;
}

.inspector {
  min-width: 0;
  margin-top: 14px;
  padding: 14px;
}

.inspector-section {
  padding: 13px;
}

.inspector-section + .inspector-section {
  margin-top: 12px;
}

.inspector h2 {
  font-size: 13px;
}

.kv {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 9px 10px;
  margin: 12px 0 0;
  font-size: 12px;
}

.kv dt {
  white-space: nowrap;
}

.kv dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.prefab-summary {
  display: grid;
  grid-template-columns: 1fr repeat(3, auto);
  gap: 6px;
  align-items: center;
  margin-top: 12px;
  font-size: 11px;
}

.prefab-summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.prefab-summary span {
  color: #8ea1b5;
}

.interaction-rule-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.interaction-rule-list.compact {
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.interaction-rule-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  border: 1px solid rgba(124, 148, 170, 0.14);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  font-size: 11px;
}

.interaction-rule-card strong {
  color: #d8e8f5;
}

.interaction-rule-card span {
  min-width: 0;
  overflow: hidden;
  color: #b7cadd;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.interaction-rule-card small {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  color: #7f93a7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-rule-text {
  margin: 0;
  color: #8ea1b5;
  font-size: 12px;
}

.component-tree {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.tree-node {
  border: 1px solid rgba(124, 148, 170, 0.14);
  background: rgba(255, 255, 255, 0.03);
  padding: 9px;
}

.prefab-trigger-list {
  margin-top: 14px;
  border-top: 1px solid rgba(124, 148, 170, 0.14);
  padding-top: 12px;
}

.load-state {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 24px;
  background: #0c1016;
  text-align: center;
}

.load-state h1 {
  margin: 0;
  font-size: 22px;
}

.load-state p {
  max-width: 520px;
  color: #8ea1b5;
}

.catalog-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 720px;
  background:
    linear-gradient(135deg, rgba(46, 200, 224, 0.12), transparent 31%),
    linear-gradient(225deg, rgba(229, 57, 84, 0.1), transparent 28%),
    #0c1016;
}

.catalog-sidebar {
  grid-column: 1;
  grid-row: 1;
}

.catalog-workspace {
  grid-column: 2;
  grid-row: 1;
  overflow-y: auto;
}

.catalog-collection-list,
.catalog-item-list {
  display: grid;
  gap: 6px;
}

.catalog-collection-list button,
.catalog-item-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(124, 148, 170, 0.18);
  background: rgba(255, 255, 255, 0.035);
  color: #b6c8da;
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

.catalog-collection-list button:hover,
.catalog-collection-list button.active,
.catalog-item-row:hover,
.catalog-item-row.active {
  border-color: rgba(94, 225, 255, 0.52);
  background: rgba(61, 209, 238, 0.1);
  color: #ecf7ff;
}

.catalog-collection-list button small,
.catalog-item-copy small,
.catalog-item-placeholder,
.catalog-empty-copy,
.catalog-eyebrow,
.catalog-collection-description,
.catalog-detail-summary p,
.catalog-override-row span,
.catalog-voice-row small {
  color: #8ea1b5;
  font-size: 11px;
}

.catalog-search {
  margin: 4px 0;
}

.catalog-item-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

.catalog-item-row {
  justify-content: flex-start;
  min-height: 58px;
}

.catalog-item-row img,
.catalog-item-placeholder {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(124, 148, 170, 0.2);
  background: rgba(0, 0, 0, 0.24);
  object-fit: cover;
}

.catalog-item-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.catalog-item-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.catalog-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: start;
  gap: 16px;
}

.catalog-detail-main {
  min-width: 0;
}

.catalog-detail-aside {
  display: grid;
  gap: 12px;
}

.catalog-detail-summary {
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(124, 148, 170, 0.18);
  background: rgba(13, 18, 25, 0.68);
  padding: 12px;
}

.catalog-detail-summary img {
  width: 100px;
  height: 68px;
  flex: 0 0 100px;
  border: 1px solid rgba(124, 148, 170, 0.2);
  background: rgba(0, 0, 0, 0.24);
  object-fit: cover;
}

.catalog-detail-summary p {
  margin: 0 0 9px;
  line-height: 1.5;
}

.catalog-variant-card {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(124, 148, 170, 0.18);
  background: rgba(13, 18, 25, 0.68);
  padding: 14px;
}

.catalog-variant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.catalog-variant-tabs button {
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.035);
  color: #9db2c8;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 12px;
}

.catalog-variant-tabs button:hover,
.catalog-variant-tabs button.active {
  border-color: rgba(94, 225, 255, 0.58);
  background: rgba(61, 209, 238, 0.12);
  color: #ecf7ff;
}

.catalog-variant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.catalog-eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.catalog-variant-header h3 {
  margin: 0;
  font-size: 17px;
}

.catalog-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid rgba(124, 148, 170, 0.24);
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.catalog-status-ready { border-color: rgba(88, 220, 165, 0.55); color: #a9f5d1; background: rgba(60, 190, 130, 0.12); }

.catalog-status-partial { border-color: rgba(248, 185, 88, 0.55); color: #ffe1ac; background: rgba(210, 138, 35, 0.12); }

.catalog-status-metadata { border-color: rgba(166, 153, 255, 0.55); color: #d6d0ff; background: rgba(111, 91, 220, 0.12); }

.catalog-status-blocked { border-color: rgba(244, 101, 121, 0.6); color: #ffc2ca; background: rgba(218, 58, 83, 0.14); }

.catalog-status-unknown { color: #b6c8da; }

.catalog-issue,
.catalog-audit-warning,
.catalog-audit-error,
.catalog-audit-info {
  margin: 0;
  border-left: 2px solid rgba(248, 185, 88, 0.75);
  background: rgba(248, 185, 88, 0.08);
  color: #ffe1ac;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
}

.catalog-audit-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.catalog-audit-error { border-left-color: rgba(244, 101, 121, 0.8); background: rgba(218, 58, 83, 0.1); color: #ffc2ca; }

.catalog-audit-info { border-left-color: rgba(96, 226, 255, 0.7); background: rgba(61, 209, 238, 0.08); color: #bcefff; }

.catalog-static-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.catalog-static-card {
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(255, 255, 255, 0.025);
  padding: 8px;
}

.catalog-static-open {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  padding: 0;
}

.catalog-static-open:hover img {
  filter: brightness(1.08);
}

.catalog-static-card img {
  display: block;
  width: 100%;
  height: 180px;
  background: rgba(0, 0, 0, 0.24);
  object-fit: contain;
}

.catalog-static-card figcaption {
  display: grid;
  gap: 4px;
  padding: 8px 2px 2px;
}

.catalog-static-card figcaption strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.catalog-static-card figcaption small { color: #8ea1b5; font-size: 10px; }

.catalog-static-gallery {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
}

.catalog-static-preview-main {
  position: relative;
  min-height: 0;
}

.catalog-static-preview-main > .archive-static-preview {
  display: flex;
  height: clamp(280px, 46vh, 520px);
  min-height: 0;
  margin-top: 0;
  flex-direction: column;
}

.catalog-static-preview-main .archive-preview-frame {
  height: auto;
  min-height: 0;
  flex: 1;
}

.catalog-static-fullscreen {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(7, 10, 15, 0.7);
  color: #d9edf9;
  cursor: pointer;
}

.catalog-static-fullscreen:hover {
  border-color: rgba(96, 226, 255, 0.72);
  background: rgba(96, 226, 255, 0.16);
  color: #f3fbff;
}

.catalog-lightbox-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 5, 9, 0.86);
  padding: 28px;
  backdrop-filter: blur(10px);
}

.catalog-lightbox {
  position: relative;
  display: grid;
  max-width: min(94vw, 1500px);
  max-height: 94vh;
  justify-items: center;
  gap: 10px;
  border: 1px solid rgba(124, 148, 170, 0.3);
  background: #0c1016;
  padding: 14px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

.catalog-lightbox img {
  display: block;
  max-width: calc(94vw - 28px);
  max-height: calc(94vh - 86px);
  object-fit: contain;
}

.catalog-lightbox p {
  margin: 0;
  color: #b6c8da;
  font-size: 12px;
}

.catalog-lightbox-close {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(124, 148, 170, 0.3);
  background: rgba(7, 10, 15, 0.78);
  color: #dcebf5;
  cursor: pointer;
}

.catalog-lightbox-close:hover { border-color: rgba(96, 226, 255, 0.62); color: #fff; }

.catalog-spine-stage {
  height: 430px;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid rgba(124, 148, 170, 0.16);
  background: #080b10;
}

.catalog-spine-stage .spine-shell,
.catalog-spine-stage .spine-canvas {
  height: 100%;
  min-height: 0;
}

.catalog-live2d-stage {
  height: 430px;
  overflow: hidden;
  border: 1px solid rgba(124, 148, 170, 0.16);
}

.catalog-live2d-stage .spine-shell,
.catalog-live2d-stage .spine-canvas { height: 100%; min-height: 0; }

.catalog-runtime-empty {
  border: 1px dashed rgba(124, 148, 170, 0.28);
  color: #8ea1b5;
  padding: 18px;
  font-size: 12px;
  text-align: center;
}

.catalog-voice-section,
.catalog-overrides {
  border-top: 1px solid rgba(124, 148, 170, 0.15);
  padding-top: 12px;
}

.catalog-voice-list,
.catalog-overrides {
  display: grid;
  gap: 8px;
}

.catalog-voice-row,
.catalog-override-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(124, 148, 170, 0.12);
  background: rgba(255, 255, 255, 0.025);
  padding: 8px 10px;
}

.catalog-voice-row > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.catalog-voice-row audio { width: min(290px, 50%); height: 30px; }

.catalog-override-row span { text-align: right; }

.catalog-collection-description { margin: -6px 0 14px; }

.catalog-empty-state { min-height: 420px; }

@media (max-width: 1040px) {
  .catalog-detail-layout { grid-template-columns: 1fr; }
  .catalog-detail-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .catalog-shell { grid-template-columns: 1fr; }
  .catalog-sidebar { grid-column: 1; grid-row: auto; max-height: 45vh; overflow-y: auto; }
  .catalog-sidebar .catalog-item-list { flex: 0 0 auto; min-height: 80px; max-height: 220px; }
  .catalog-workspace { grid-column: 1; grid-row: auto; }
  .catalog-detail-aside { grid-template-columns: 1fr; }
  .catalog-voice-row { align-items: stretch; flex-direction: column; }
  .catalog-voice-row audio { width: 100%; }
}

.catalog-collection-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.catalog-collection-filter button {
  display: inline-flex;
  min-width: 0;
  flex: 1 1 42%;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
}

.catalog-collection-filter button small {
  color: #8ea1b5;
  font-size: 10px;
}

.catalog-search-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.catalog-search-row .search-box {
  min-width: 0;
  flex: 1;
}

.catalog-favorite-filter {
  display: grid;
  width: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: #aebfd0;
  cursor: pointer;
}

.catalog-favorite-filter:hover,
.catalog-favorite-filter.active {
  border-color: rgba(255, 95, 119, 0.66);
  background: rgba(255, 85, 112, 0.13);
  color: #ff7890;
}

.catalog-row-favorite {
  flex: 0 0 auto;
  color: #ff647d;
}

.catalog-character-list {
  min-height: 0;
}

.catalog-preview-stage {
  display: flex;
  min-height: 0;
  align-items: stretch;
  justify-content: center;
}

.catalog-preview-stage .catalog-spine-stage,
.catalog-preview-stage .catalog-live2d-stage,
.catalog-preview-stage .catalog-stage-static,
.catalog-preview-stage .catalog-video-stage,
.catalog-preview-stage .catalog-audio-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}

.catalog-preview-stage .catalog-video-stage,
.catalog-preview-stage .catalog-audio-stage {
  align-self: start;
  height: calc(100% - 48px);
}

.catalog-stage-static {
  display: block;
  overflow: hidden;
  background: #080b10;
}

.catalog-stage-static > .static-preview {
  width: 100%;
  height: 100%;
}

.catalog-stage-static > .spine-favorite {
  top: 58px;
}

.catalog-video-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #05070a;
}

.catalog-video-frame {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  background: #000;
}

.catalog-video-stage video {
  display: block;
  width: min(100%, 1280px);
  max-height: 100%;
  background: #000;
  object-fit: contain;
}

.catalog-video-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #d5e7f5;
  font-size: 12px;
  pointer-events: none;
}

.catalog-video-transport,
.voice-runtime-transport {
  display: grid;
  grid-template-columns: 30px auto minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(7, 10, 15, 0.96);
  color: #b6c8da;
  padding: 7px 14px;
  font-size: 12px;
}

.catalog-media-transport-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(96, 226, 255, 0.45);
  background: rgba(96, 226, 255, 0.08);
  color: #b9efff;
  cursor: pointer;
}

.catalog-video-transport > span,
.voice-runtime-transport > span {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.catalog-video-transport input[type="range"],
.voice-runtime-transport input[type="range"] {
  width: 100%;
  min-width: 0;
  accent-color: #60e2ff;
  cursor: pointer;
}

.catalog-video-transport input[type="range"]:disabled,
.voice-runtime-transport input[type="range"]:disabled {
  cursor: wait;
}

.catalog-video-meta,
.catalog-audio-stage-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  border-top: 1px solid rgba(124, 148, 170, 0.16);
  background: rgba(9, 13, 19, 0.96);
  color: #90a7ba;
  padding: 10px 14px;
  font-size: 12px;
}

.catalog-video-meta > div,
.catalog-audio-stage-heading > div {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  color: #e7f4ff;
}

.catalog-video-meta strong,
.catalog-audio-stage-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-video-meta > span:not(:first-of-type),
.catalog-video-meta > span:last-child {
  color: #7ecde5;
}

.catalog-video-error {
  position: absolute;
  bottom: 14px;
  left: 14px;
  margin: 0;
  border-left: 2px solid var(--danger);
  background: var(--ui-surface-strong);
  color: var(--ui-ink);
  padding: 7px 9px;
  font-size: 12px;
}

.catalog-video-list { display: grid; gap: 6px; }

.catalog-video-list button { display: flex; justify-content: space-between; gap: 12px; width: 100%; border: 0; border-bottom: 1px solid var(--ui-line); background: transparent; color: var(--ui-ink); cursor: pointer; padding: 7px 0; font-size: 12px; text-align: left; }

.catalog-video-list button:hover, .catalog-video-list button.active { background: var(--accent-soft); }

.catalog-video-list span { color: var(--ui-muted); }

.catalog-stage-selectors {
  position: absolute;
  z-index: 7;
  /* The first row belongs exclusively to .stage-leading-actions. */
  top: 56px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 28px);
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.catalog-variant-strip,
.catalog-runtime-strip {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.catalog-variant-strip button,
.catalog-runtime-strip button {
  min-height: 30px;
  border: 1px solid rgba(124, 148, 170, 0.22);
  background: rgba(7, 10, 15, 0.74);
  color: #bfd3e4;
  cursor: pointer;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1;
  backdrop-filter: blur(18px);
}

.catalog-variant-strip button:hover,
.catalog-variant-strip button.active,
.catalog-runtime-strip button:hover,
.catalog-runtime-strip button.active {
  border-color: rgba(96, 226, 255, 0.72);
  background: rgba(96, 226, 255, 0.16);
  color: #f3fbff;
}

.catalog-runtime-strip button {
  max-width: min(230px, calc(100vw - 48px));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-stage-selectors > .spine-variant-switch,
.catalog-stage-selectors > .spine-mod-switch {
  position: static;
  height: 34px;
  margin: 0;
}

.catalog-stage-selectors > .spine-variant-switch {
  width: 52px;
  min-width: 52px;
}

.catalog-stage-selectors > .spine-mod-switch {
  width: 34px;
  min-width: 34px;
}

.catalog-drawer-card {
  display: grid;
  gap: 12px;
}

.catalog-audio-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #080b10;
}

.catalog-audio-stage-heading {
  border-top: 0;
  justify-content: space-between;
}

.catalog-audio-stage > .voice-runtime-panel {
  min-height: 0;
  margin: 0;
  overflow: auto;
  border: 0;
  background: transparent;
  padding: 14px;
}

@media (max-width: 700px) {
  .catalog-video-meta,
  .catalog-audio-stage-heading {
    align-items: flex-start;
    padding: 9px 11px;
  }

  .catalog-video-meta > div,
  .catalog-audio-stage-heading > div {
    width: 100%;
  }

  .catalog-audio-stage > .voice-runtime-panel { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .app-shell,
  .archive-shell {
    grid-template-columns: 250px minmax(0, 1fr);
    height: auto;
    min-height: 100%;
  }

  .app-shell.sidebar-collapsed,
  .archive-shell.sidebar-collapsed {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .app-shell.layer-sidebar-collapsed,
  .archive-shell.layer-sidebar-collapsed,
  .app-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .layer-debug-dock {
    display: none;
  }

  .preview-drawer.is-open {
    top: 0;
    height: 100%;
  }

  .preview-frame {
    height: clamp(280px, 42vh, 420px);
  }

  .ui-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .component-tree {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .usage-guide-backdrop {
    align-items: end;
    padding: 12px;
  }

  .usage-guide-dialog {
    max-height: calc(100dvh - 24px);
  }

  .usage-guide-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 17px 17px 14px;
  }

  .usage-guide-lan-entry {
    width: 100%;
  }

  .lan-access-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    width: auto;
    border-top: 1px solid rgba(124, 148, 170, 0.18);
    border-left: 0;
    padding-top: 14px;
    padding-left: 0;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
  }

  .lan-access-heading {
    grid-column: 1 / -1;
  }

  .lan-access-qr,
  .lan-access-qr-placeholder {
    width: 92px;
    height: 92px;
  }

  .lan-access-details {
    align-self: center;
  }

  .lan-access-dialog-top {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 17px 17px 21px;
  }

  .lan-access-dialog-top > .lan-access-panel {
    width: 100%;
    grid-row: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(124, 148, 170, 0.18);
    padding: 0 0 20px;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
  }

  .lan-access-dialog-top > .lan-access-panel .lan-access-heading {
    grid-column: 1 / -1;
  }

  .lan-access-dialog-top > .lan-access-panel .lan-access-qr,
  .lan-access-dialog-top > .lan-access-panel .lan-access-qr-placeholder {
    width: 92px;
    height: 92px;
  }

  .lan-access-dialog-top > .lan-access-panel .lan-access-details {
    align-self: center;
  }

  .usage-guide-content {
    gap: 17px;
    padding: 17px 17px 21px;
  }
}

@media (orientation: landscape) and (min-width: 900px) and (max-width: 1500px) and (max-height: 1050px) {
  body {
    overflow: hidden;
  }

  .app-shell,
  .archive-shell {
    grid-template-columns: 232px minmax(0, 1fr) 304px;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  .app-shell.sidebar-collapsed,
  .archive-shell.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 304px;
  }

  .app-shell.layer-sidebar-collapsed,
  .archive-shell.layer-sidebar-collapsed {
    grid-template-columns: 232px minmax(0, 1fr) 0;
  }

  .app-shell.sidebar-collapsed.layer-sidebar-collapsed,
  .archive-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 0;
  }

  .sidebar {
    gap: 12px;
    padding: 14px 12px;
  }

  .brand-block {
    gap: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-block h1 {
    font-size: 16px;
  }

  .character-list {
    min-height: 0;
  }

  .workspace {
    padding: 12px 16px 18px;
  }

  .spine-panel,
  .art-panel,
  .ui-reference,
  .inspector {
    padding: 10px;
  }

  .spine-shell {
    margin-top: 8px;
  }

  .spine-canvas {
    height: 100%;
  }

  .stage-toolbar {
    top: 8px;
    right: 8px;
  }

  .control-panel {
    margin-top: 10px;
  }

  .preview-frame {
    height: clamp(260px, 36dvh, 360px);
  }

  .layer-debug-dock {
    display: block;
  }

  .layer-debug-toggle-collapsed {
    top: 12px;
    right: 10px;
  }
}

@media (orientation: landscape) and (min-width: 1024px) and (max-width: 1920px) and (max-height: 1280px) {
  body {
    overflow: hidden;
  }

  .app-shell,
  .archive-shell {
    grid-template-columns: 240px minmax(0, 1fr) 320px;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  .app-shell.sidebar-collapsed,
  .archive-shell.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 320px;
  }

  .app-shell.layer-sidebar-collapsed,
  .archive-shell.layer-sidebar-collapsed {
    grid-template-columns: 240px minmax(0, 1fr) 0;
  }

  .app-shell.sidebar-collapsed.layer-sidebar-collapsed,
  .archive-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 0;
  }

  .sidebar {
    gap: 14px;
    padding: 16px 14px;
  }

  .brand-block {
    gap: 10px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand-block h1 {
    font-size: 17px;
  }

  .character-row {
    min-height: 60px;
    padding: 10px;
  }

  .character-row.card-row {
    min-height: 76px;
    padding: 10px;
  }

  .character-list {
    min-height: 0;
  }

  .workspace {
    padding: 14px 18px 20px;
  }

  .spine-panel,
  .art-panel,
  .ui-reference,
  .inspector {
    padding: 12px;
  }

  .spine-shell {
    margin-top: 10px;
  }

  .spine-canvas {
    height: 100%;
  }

  .stage-toolbar {
    top: 10px;
    right: 10px;
  }

  .control-panel {
    margin-top: 12px;
  }

  .preview-frame {
    height: clamp(280px, 38dvh, 400px);
  }

  .layer-debug-dock {
    display: block;
  }

  .layer-debug-toggle-collapsed {
    top: 14px;
    right: 12px;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .app-shell,
  .archive-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
  }

  .app-shell > .sidebar,
  .archive-shell > .sidebar {
    grid-column: 1;
    grid-row: 1;
  }

  .app-shell > .workspace,
  .archive-shell > .workspace {
    grid-column: 1;
    grid-row: 2;
    height: clamp(420px, 72dvh, 560px);
  }

  .layer-debug-dock,
  .layer-debug-dock.collapsed {
    display: none;
  }

  .app-shell.sidebar-collapsed,
  .archive-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .app-shell.layer-sidebar-collapsed,
  .app-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(124, 148, 170, 0.2);
  }

  .character-list {
    max-height: 220px;
  }

  .preview-frame {
    height: 420px;
  }

  .spine-canvas {
    height: 560px;
  }

  .stage-toolbar {
    left: 10px;
    right: 10px;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .stage-toolbar-actions {
    width: 100%;
    max-height: 180px;
  }

  .spine-control-layout {
    grid-template-columns: 1fr;
  }

  .spine-list,
  .ui-grid,
  .component-tree {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1280px) and (orientation: landscape) and (min-height: 681px) {
  body {
    overflow: hidden;
  }

  .app-shell,
  .archive-shell {
    grid-template-columns:
      clamp(224px, 18vw, 260px)
      minmax(0, 1fr)
      clamp(288px, 24vw, 352px);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  .app-shell.sidebar-collapsed,
  .archive-shell.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) clamp(288px, 24vw, 352px);
  }

  .app-shell.layer-sidebar-collapsed,
  .archive-shell.layer-sidebar-collapsed {
    grid-template-columns: clamp(224px, 18vw, 260px) minmax(0, 1fr) 0;
  }

  .app-shell.sidebar-collapsed.layer-sidebar-collapsed,
  .archive-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 0;
  }

  .sidebar {
    padding: clamp(14px, 1.4vw, 20px) clamp(12px, 1.2vw, 16px);
  }

  .workspace {
    padding: clamp(12px, 1.5vw, 22px) clamp(16px, 1.8vw, 28px) clamp(18px, 2vw, 24px);
  }
}

@media (min-width: 760px) and (max-width: 1279px),
  (orientation: portrait) and (min-width: 760px) and (max-width: 1439px),
  (orientation: landscape) and (min-width: 760px) and (max-height: 680px) {
  body {
    overflow: hidden;
  }

  .app-shell,
  .archive-shell {
    grid-template-columns: clamp(212px, 28vw, 250px) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  .app-shell.sidebar-collapsed,
  .archive-shell.sidebar-collapsed {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .app-shell.layer-sidebar-collapsed,
  .archive-shell.layer-sidebar-collapsed,
  .app-shell.sidebar-collapsed.layer-sidebar-collapsed,
  .archive-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: clamp(212px, 28vw, 250px) minmax(0, 1fr);
  }

  .layer-debug-dock,
  .layer-debug-dock.collapsed {
    display: none;
  }

  .workspace {
    padding: clamp(10px, 1.8vw, 16px);
  }

  .sidebar {
    padding: 14px 12px;
  }

  .brand-block {
    gap: 10px;
  }

  .brand-block h1 {
    font-size: 16px;
    white-space: nowrap;
  }

  .brand-block p {
    font-size: 11px;
  }

  .preview-drawer.is-open {
    top: 0;
    height: 100%;
  }

  .preview-stage-panel .spine-canvas {
    height: 100%;
  }
}

@media (max-width: 759px) and (orientation: portrait) {
  body {
    overflow: auto;
  }

  .app-shell,
  .archive-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 46dvh) minmax(360px, 54dvh);
    height: auto;
    min-height: 100dvh;
  }

  .app-shell > .sidebar,
  .archive-shell > .sidebar {
    grid-column: 1;
    grid-row: 1;
    height: 46dvh;
    max-height: 46dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
  }

  .app-shell > .workspace,
  .archive-shell > .workspace {
    grid-column: 1;
    grid-row: 2;
    height: max(360px, 54dvh);
    min-height: max(360px, 54dvh);
    overflow: hidden;
    padding: 12px;
  }

  .character-list {
    max-height: none;
  }

  .preview-stage-panel .spine-canvas {
    height: 100%;
  }
}

@media (max-width: 759px) and (orientation: landscape) {
  body {
    overflow: hidden;
  }

  .app-shell,
  .archive-shell {
    grid-template-columns: clamp(152px, 26vw, 184px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  .app-shell.sidebar-collapsed,
  .archive-shell.sidebar-collapsed {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .app-shell.layer-sidebar-collapsed,
  .archive-shell.layer-sidebar-collapsed,
  .app-shell.sidebar-collapsed.layer-sidebar-collapsed,
  .archive-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: clamp(152px, 26vw, 184px) minmax(0, 1fr);
  }

  .app-shell > .sidebar,
  .archive-shell > .sidebar {
    grid-column: 1;
    grid-row: 1;
    height: auto;
    max-height: none;
    overflow: hidden;
    padding: 10px 8px;
    gap: 8px;
    border-right: 1px solid rgba(124, 148, 170, 0.2);
    border-bottom: 0;
  }

  .app-shell > .workspace,
  .archive-shell > .workspace {
    grid-column: 2;
    grid-row: 1;
    height: auto;
    min-height: 0;
    overflow: hidden;
    padding: 8px 10px 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-block {
    gap: 7px;
  }

  .brand-block h1 {
    font-size: 14px;
  }

  .brand-block p {
    margin-top: 2px;
    font-size: 10px;
  }

  .mode-switch {
    gap: 4px;
  }

  .mode-switch button {
    min-height: 32px;
    padding: 0;
    font-size: 0;
  }

  .mode-switch button svg {
    width: 15px;
    height: 15px;
  }

  .search-box {
    height: 34px;
    padding: 0 8px;
  }

  .search-box input {
    font-size: 11px;
  }

  .character-list {
    gap: 4px;
    min-height: 64px;
  }

  .character-row,
  .character-row.card-row {
    min-height: 54px;
    padding: 6px;
  }

  .preview-stage-panel .spine-canvas {
    height: 100%;
  }

  .stage-toolbar-actions {
    max-height: calc(100dvh - 74px);
  }
}

@media (orientation: landscape) and (min-width: 760px) and (max-height: 680px) {
  .sidebar {
    gap: 8px;
    padding: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-block {
    gap: 7px;
  }

  .brand-block h1 {
    font-size: 14px;
    white-space: nowrap;
  }

  .brand-block p {
    margin-top: 2px;
    font-size: 10px;
  }

  .mode-switch {
    gap: 4px;
  }

  .mode-switch button {
    min-height: 32px;
    padding: 0 6px;
    font-size: 11px;
  }

  .search-box {
    height: 34px;
    padding: 0 8px;
  }

  .search-box input {
    font-size: 11px;
  }

  .character-list {
    min-height: 76px;
    gap: 4px;
  }

  .character-row,
  .character-row.card-row {
    min-height: 54px;
    padding: 6px;
  }

  .sidebar-foot {
    padding-top: 8px;
  }
}

@media (max-width: 1023px) {
  .preview-drawer:not(.is-open) {
    height: auto;
    min-height: 48px;
  }

  .catalog-preview-stage .catalog-video-stage,
  .catalog-preview-stage .catalog-audio-stage {
    height: calc(100% - 78px);
  }

  .preview-drawer-handle {
    min-height: 0;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 8px;
  }

  .preview-drawer-tabs {
    flex: 1 1 100%;
    width: 100%;
    flex-wrap: wrap;
    gap: 4px;
    overflow: visible;
  }

  .preview-drawer-tabs button {
    flex: 1 0 auto;
    padding: 6px 8px;
    font-size: 11px;
  }

  .preview-drawer-status {
    min-width: 0;
    max-width: calc(100% - 62px);
    margin-left: auto;
  }

  .preview-drawer-status-actions {
    gap: 6px;
  }

  .preview-drawer-status-chip,
  .preview-drawer-toggle {
    padding: 6px 8px;
    font-size: 11px;
  }
}

@media (max-width: 359px) {
  .preview-drawer-tabs button {
    flex-basis: calc(33.333% - 4px);
  }
}

@media (max-width: 759px) and (orientation: portrait) and (max-height: 700px) {
  .app-shell,
  .archive-shell {
    grid-template-rows: max(330px, 46dvh) max(360px, 54dvh);
  }

  .app-shell > .sidebar,
  .archive-shell > .sidebar {
    height: auto;
    max-height: none;
    gap: 8px;
    padding: 10px 12px;
  }

  .sidebar-footer-stack {
    gap: 8px;
  }

  .sidebar-foot {
    padding-top: 8px;
  }

  .character-list {
    min-height: 56px;
    flex: 1 1 56px;
  }
}

:root {
  --ui-page: #0a0a0b;
  --ui-surface: #111214;
  --ui-surface-strong: #17181b;
  --ui-surface-muted: #1d1f23;
  --ui-ink: #f2f3f5;
  --ui-muted: #92969f;
  --ui-line: #292c32;
  --ui-line-strong: #3a3e46;
  --stage: #090a0c;
  --stage-raised: #111216;
  --stage-line: #2a2d34;
  --stage-text: #f2f3f5;
  --stage-muted: #92969f;
  --stage-overlay: rgba(17, 18, 22, 0.94);
  --stage-overlay-soft: rgba(17, 18, 22, 0.92);
  --stage-overlay-strong: rgba(17, 18, 22, 0.9);
  --stage-hairline: rgba(255, 255, 255, 0.04);
  --accent: #4f8cff;
  --accent-hover: #78a7ff;
  --accent-soft: rgba(79, 140, 255, 0.14);
  --accent-bright: #78a7ff;
  --warning: #e3a34b;
  --warning-soft: rgba(227, 163, 75, 0.14);
  --danger: #ef6b78;
  --danger-soft: rgba(239, 107, 120, 0.14);
  /* 「更多资源」入口专用配色（2026-09-28）：与角色页的蓝色 accent 明确区分，
     使用独立的 --moreres-* 命名空间，不污染既有 accent 体系。 */
  --moreres-from: #a21caf;
  --moreres-to: #06b6d4;
  --moreres-grad: linear-gradient(135deg, #a21caf 0%, #06b6d4 100%);
  --moreres-grad-soft: linear-gradient(135deg, rgba(162, 28, 175, 0.22) 0%, rgba(6, 182, 212, 0.22) 100%);
  --moreres-ink: #f7f2ff;
  --moreres-line: rgba(186, 122, 240, 0.55);
  color: var(--ui-ink);
  background: var(--ui-page);
  color-scheme: dark;
  text-rendering: optimizeLegibility;
}

/* 2026-09-28：主题固定为暗色，用户不可切换——原 :root[data-theme="light"] 变量块已移除。 */

/* 2026-09-28：原 light 舞台对比度修正规则随主题固定一并移除。 */

*,
*::before,
*::after {
  letter-spacing: 0 !important;
}

body {
  background: var(--ui-page);
  color: var(--ui-ink);
}

button,
input,
select,
textarea {
  border-radius: 4px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
}

::selection {
  background: var(--accent-soft);
  color: var(--ui-ink);
}

.app-shell {
  grid-template-columns: 272px minmax(0, 1fr) 340px;
  min-height: 0;
  background: var(--ui-page);
  color: var(--ui-ink);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 340px;
}

.app-shell.layer-sidebar-collapsed {
  grid-template-columns: 272px minmax(0, 1fr) 0;
}

.app-shell.sidebar-collapsed.layer-sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}

.sidebar,
.inspector {
  border-color: var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-ink);
  backdrop-filter: none;
}

.sidebar {
  gap: 12px;
  padding: 16px 14px;
  border-right: 1px solid var(--ui-line);
}

.sidebar.sidebar-collapsed-shell {
  top: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--stage-line);
  background: rgba(15, 18, 16, 0.88);
  color: var(--stage-text);
  backdrop-filter: blur(8px);
}

.brand-block {
  min-height: 48px;
  gap: 10px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  box-shadow: none;
}

.brand-block h1 {
  color: var(--ui-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-block p,
.sidebar-foot,
.row-copy small,
.character-skin-row small {
  color: var(--ui-muted);
}

.brand-block p {
  margin-top: 3px;
  font-size: 11px;
}

.sidebar-toggle,
.sidebar-service-action,
.layer-debug-toggle,
.layer-debug-actions button,
.layer-debug-group-toggle {
  border: 1px solid var(--ui-line-strong);
  border-radius: 4px;
  background: var(--ui-surface-strong);
  color: var(--ui-muted);
  box-shadow: none;
}

.sidebar-toggle:hover,
.sidebar-service-action:hover,
.sidebar-service-action.active,
.layer-debug-toggle:hover,
.layer-debug-actions button:hover,
.layer-debug-group-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.sidebar-service-action.danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.sidebar-service-action.guide:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.rarity-filter {
  gap: 5px;
}

.rarity-filter button,
.rarity-tag {
  min-height: 28px;
  border: 1px solid var(--ui-line);
  border-radius: 4px;
  background: var(--ui-surface-strong);
  color: var(--ui-muted);
  padding: 5px 8px;
}

.rarity-filter button:hover,
.rarity-filter button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.rarity-filter button.clear {
  color: var(--danger);
}

.search-box {
  height: 38px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 4px;
  background: var(--ui-surface-strong);
  color: var(--ui-muted);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.search-box input {
  color: var(--ui-ink);
}

.search-box input::placeholder {
  color: var(--ui-muted);
}

.character-list {
  gap: 5px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-line-strong) transparent;
}

.character-list::-webkit-scrollbar {
  display: block;
  width: 5px;
}

.character-list::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: var(--ui-line-strong);
}

.character-entry,
.character-skin-group {
  gap: 3px;
}

.character-row.card-row {
  min-height: 58px;
  border: 1px solid var(--ui-line);
  border-radius: 4px;
  background-color: var(--ui-surface-strong);
  color: var(--ui-ink);
  padding: 8px 10px;
  contain-intrinsic-size: auto 58px;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.character-row.card-row.has-preview {
  min-height: 76px;
  border-color: #8d9790;
  color: #ffffff;
  contain-intrinsic-size: auto 76px;
}

.character-row.card-row:hover {
  border-color: var(--accent);
  background-color: var(--ui-surface-muted);
}

.character-row.card-row.active {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.character-row.card-row.has-preview:hover,
.character-row.card-row.has-preview.active {
  border-color: var(--accent-bright);
  background-color: #121722;
}

.catalog-character-list .character-row.card-row {
  grid-template-columns: 42px minmax(0, 1fr) 16px;
}

.card-row .row-copy strong {
  color: var(--ui-ink);
  font-size: 14px;
  text-shadow: none;
}

.card-row .row-copy small {
  color: var(--ui-muted);
  text-shadow: none;
}

.character-row.has-preview .row-copy strong,
.character-row.has-preview .row-copy small {
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.72);
}

.row-arrow {
  color: var(--ui-muted);
}

.character-row.active .row-arrow,
.character-row:hover .row-arrow {
  color: var(--accent);
}

.character-row.has-preview .row-arrow {
  color: #ffffff;
}

.character-skin-list {
  gap: 3px;
  padding: 3px 0 2px 14px;
  border-left: 1px solid var(--ui-line);
}

.character-skin-row.card-row {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--ui-surface-muted);
  color: var(--ui-muted);
  padding: 6px 8px;
  content-visibility: auto;
  contain-intrinsic-size: auto 40px;
}

.character-skin-row.card-row:hover,
.character-skin-row.card-row.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.character-skin-group.favorited > .character-skin-row,
.character-skin-row.favorited {
  border-color: #d7a24c;
  background: var(--warning-soft);
  color: var(--warning);
  box-shadow: none;
}

.character-skin-group.favorited > .character-skin-row::before,
.character-skin-row.favorited::before,
.character-skin-group.favorited > .character-skin-row:hover::before {
  background: transparent;
}

.character-skin-assets {
  gap: 2px;
  padding-left: 10px;
}

.character-skin-asset {
  min-height: 28px;
  border-radius: 3px;
  background: transparent;
  color: var(--ui-muted);
  content-visibility: auto;
  contain-intrinsic-size: auto 28px;
}

.character-skin-asset:hover,
.character-skin-asset.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.skin-favorite-mark {
  color: var(--warning);
  filter: none;
}

.rarity-badge {
  margin-left: 6px;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 800;
  -webkit-text-stroke: 0;
  filter: none;
  text-shadow: none;
}

.rarity-badge.tier-6 {
  color: #b47613;
  text-shadow: none;
}

.rarity-badge.tier-5 {
  color: #147f82;
  text-shadow: none;
}

.rarity-badge.tier-4 {
  color: #76559c;
  text-shadow: none;
}

.rarity-badge.tier-default {
  color: var(--ui-muted);
  text-shadow: none;
}

.sidebar-footer-stack {
  gap: 8px;
}

.sidebar-service-actions {
  display: none !important;
}

.sidebar-service-action {
  width: 34px;
  height: 34px;
}

.sidebar-foot {
  border-top-color: var(--ui-line);
  padding-top: 10px;
  font-size: 11px;
}

.sidebar-service-error {
  color: var(--danger);
}

.workspace {
  padding: 0;
  background: var(--stage);
  color: var(--stage-text);
}

.app-shell.sidebar-collapsed > .workspace,
.app-shell.layer-sidebar-collapsed > .workspace,
.app-shell.sidebar-collapsed.layer-sidebar-collapsed > .workspace {
  padding: 0;
}

.preview-workspace,
.preview-stage,
.preview-stage-panel,
.spine-panel,
.spine-shell,
.spine-canvas {
  border-radius: 0;
  background: var(--stage);
}

.preview-stage-panel,
.preview-stage-panel .spine-shell,
.spine-shell {
  margin: 0;
  padding: 0;
}

.spine-canvas {
  min-height: 0;
  border: 0;
  background: var(--stage);
}

.spine-canvas::after {
  position: absolute;
  right: 0;
  bottom: 47px;
  left: 0;
  height: 1px;
  background: var(--stage-hairline);
  content: "";
  pointer-events: none;
}

.load-state {
  background: var(--stage);
  color: var(--stage-text);
}

.load-state h1 {
  font-size: 20px;
  font-weight: 650;
}

.load-state p,
.spine-placeholder {
  color: var(--stage-muted);
}

.stage-toolbar {
  top: 12px;
  right: 12px;
  gap: 5px;
  max-width: min(260px, calc(100% - 96px));
}

.stage-toolbar .current-animation {
  max-width: 100%;
  min-height: 28px;
  border: 1px solid var(--stage-line);
  border-radius: 4px;
  background: var(--stage-overlay);
  color: var(--stage-text);
  padding: 0 8px;
  font-size: 11px;
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.stage-toolbar-actions {
  gap: 4px;
  max-width: 100%;
  max-height: calc(100dvh - 180px);
  padding: 1px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: var(--stage-line) transparent;
}

.stage-toolbar-actions button {
  width: auto;
  max-width: 100%;
  min-height: 28px;
  border: 1px solid var(--stage-line);
  border-radius: 4px;
  background: var(--stage-overlay-soft);
  color: var(--stage-muted);
  padding: 5px 7px;
  font-size: 11px;
  box-shadow: none;
  backdrop-filter: blur(8px);
  content-visibility: auto;
  contain-intrinsic-size: auto 28px;
}

.stage-toolbar-actions button > span {
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  text-shadow: none;
}

.stage-toolbar-actions button:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.12);
  color: var(--stage-text);
}

.stage-toolbar-actions button.active {
  border-color: var(--accent-bright);
  background: rgba(79, 140, 255, 0.2);
  color: #ffffff;
}

.spine-favorite,
.spine-variant-switch,
.spine-mod-switch {
  top: 14px;
  height: 34px;
  border-radius: 4px;
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.spine-favorite {
  left: 14px;
  width: 34px;
  border: 1px solid var(--stage-line);
  background: var(--stage-overlay-strong);
  color: var(--stage-muted);
}

.spine-favorite:hover:not(:disabled),
.spine-favorite.active {
  border-color: var(--danger);
  background: #382024;
  color: #ff9ba6;
  filter: none;
  transform: none;
}

.spine-variant-switch {
  left: 56px;
  border: 1px solid var(--accent);
  background: rgba(28, 55, 103, 0.9);
  color: #dbe8ff;
}

.spine-variant-switch:hover {
  border-color: var(--accent-bright);
  background: #244a8b;
  color: #ffffff;
  transform: none;
}

.spine-mod-switch {
  left: 56px;
  width: 34px;
  border: 1px solid #8f642d;
  background: rgba(69, 47, 19, 0.92);
  color: #f5cc8e;
}

.spine-mod-switch:hover,
.spine-mod-switch.active {
  border-color: var(--warning);
  background: #5a3d18;
  color: #ffe0ad;
  filter: none;
  transform: none;
}

.spine-mod-switch.has-variant-switch {
  left: 98px;
}

.stage-leading-actions {
  position: absolute;
  z-index: 6;
  top: 14px;
  left: 14px;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  max-width: calc(100% - 28px);
  align-items: center;
  gap: 8px;
}

.stage-leading-actions > .spine-favorite,
.stage-leading-actions > .spine-variant-switch,
.stage-leading-actions > .spine-mod-switch {
  position: static;
  flex: 0 0 auto;
  margin: 0;
  transform: none;
}

.stage-leading-actions > * {
  flex: 0 0 auto;
}

.stage-leading-actions > .spine-favorite,
.stage-leading-actions > .spine-mod-switch {
  width: 34px;
  min-width: 34px;
}

.stage-leading-actions > .spine-variant-switch {
  width: 52px;
  min-width: 52px;
}

.stage-leading-actions > .spine-video-export {
  width: 34px;
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(8, 12, 18, 0.78);
  cursor: pointer;
}

.stage-leading-actions > .spine-video-export:hover:not(:disabled),
.stage-leading-actions > .spine-video-export.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(23, 31, 43, 0.94);
}

.stage-leading-actions > .spine-video-export:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.spine-video-export-message {
  margin: 0;
  max-width: 100%;
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(8, 12, 18, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.4;
}

.preview-drawer-tabs button:has(svg) {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.animation-download-panel { max-width: 680px; }

.animation-download-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.animation-download-button,
.animation-download-cancel {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(96, 226, 255, 0.52);
  background: rgba(96, 226, 255, 0.1);
  color: #ddf9ff;
  font-size: 13px;
  cursor: pointer;
}

.animation-download-button { min-width: 148px; padding: 0 14px; }

.animation-download-button:disabled { opacity: 0.48; cursor: wait; }

.animation-download-cancel { padding: 0 12px; border-color: rgba(244, 157, 157, 0.46); background: rgba(236, 96, 96, 0.1); color: #ffd6d6; }

.app-shell.sidebar-collapsed .stage-leading-actions,
.archive-shell.sidebar-collapsed .stage-leading-actions {
  /* The frozen non-crosscore bundles can emit a later inline/own-shell left
   * offset while the sidebar collapses; keep the leading controls clear of the
   * fixed 14px sidebar toggle in every gallery. */
  left: 56px !important;
}

.app-shell.sidebar-collapsed .catalog-stage-selectors,
.archive-shell.sidebar-collapsed .catalog-stage-selectors {
  left: 56px;
  max-width: calc(100% - 70px);
}

.app-shell.sidebar-collapsed .catalog-stage-static > .spine-favorite,
.archive-shell.sidebar-collapsed .catalog-stage-static > .spine-favorite {
  left: 56px;
}

.spine-subtitle-overlay {
  right: 14px;
  bottom: 58px;
  left: 14px;
  gap: 4px;
  border: 1px solid var(--stage-line);
  border-radius: 4px;
  background: rgba(12, 13, 16, 0.9);
  padding: 9px 11px;
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.spine-subtitle-overlay.is-playing {
  border-color: var(--accent);
}

.spine-subtitle-source {
  color: var(--stage-muted);
}

.spine-subtitle-text {
  color: var(--stage-text);
  font-size: 14px;
}

.preview-drawer {
  z-index: 10;
  height: 48px;
  border: 0;
  border-top: 1px solid var(--stage-line);
  border-radius: 0;
  background: rgba(17, 18, 22, 0.98);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.preview-drawer-handle {
  min-height: 47px;
  border-bottom: 1px solid var(--stage-line);
  background: var(--stage-raised);
  padding: 0 10px;
}

.preview-drawer-tabs {
  gap: 4px;
}

.preview-drawer-tabs button,
.preview-drawer-toggle,
.preview-drawer-status-chip,
.preview-drawer-status-icon-button,
.drawer-chip-row span {
  border: 1px solid var(--stage-line);
  border-radius: 4px;
  background: #1b1d22;
  color: #b4b8c1;
}

.preview-drawer-tabs button {
  padding: 6px 9px;
  color: var(--stage-muted);
  font-size: 11px;
}

.preview-drawer-tabs button:hover,
.preview-drawer-tabs button.active {
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.16);
  color: #e7efff;
}

.preview-drawer-toggle:hover {
  border-color: var(--accent-bright);
  color: #ffffff;
}

.preview-drawer-status-chip {
  color: var(--stage-muted);
  font-size: 11px;
}

.preview-drawer-status-icon-button.danger {
  color: #f3a6ae;
}

.preview-drawer-status-icon-button:hover:not(:disabled) {
  border-color: var(--danger);
  background: #382024;
}

.preview-drawer-panel,
.preview-drawer-scroll {
  background: var(--stage-raised);
  color: var(--stage-text);
}

.preview-drawer-scroll {
  padding: 14px;
  scrollbar-color: var(--stage-line) transparent;
}

.drawer-summary,
.spine-rail-panel,
.voice-runtime-panel,
.control-panel,
.ui-reference {
  border-color: var(--stage-line);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.panel-heading,
.drawer-summary h2,
.drawer-summary strong,
.preview-drawer-section h2,
.preview-drawer-section h3 {
  color: var(--stage-text);
}

.spine-group-row,
.spine-row,
.animation-grid button,
.prefab-tabs button,
.panel-action-button,
.voice-runtime-categories button {
  border-color: var(--stage-line);
  border-radius: 4px;
  background: #1b1d22;
  color: #b4b8c1;
}

.spine-group-row:hover,
.spine-group-row.active,
.spine-row:hover,
.spine-row.active,
.animation-grid button:hover,
.animation-grid button.active,
.prefab-tabs button:hover,
.prefab-tabs button.active,
.panel-action-button:hover:not(:disabled),
.panel-action-button.saved,
.voice-runtime-categories button.active {
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.16);
  color: #e7efff;
}

.warning-text,
.spine-row.blocked small,
.voice-runtime-warning,
.voice-runtime-error {
  color: #f1b55e !important;
}

.layer-debug-dock {
  border-left: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-ink);
  backdrop-filter: none;
}

.layer-debug-panel {
  gap: 9px;
  padding: 12px;
}

.layer-debug-header strong,
.layer-debug-copy strong,
.layer-debug-group-copy strong,
.layer-picked-copy strong {
  color: var(--ui-ink);
}

.layer-debug-header small,
.layer-debug-row small,
.layer-debug-group-copy small,
.layer-picked-copy small,
.layer-debug-empty {
  color: var(--ui-muted);
}

.layer-debug-search {
  border: 1px solid var(--ui-line-strong);
  border-radius: 4px;
  background: var(--ui-surface-strong);
  color: var(--ui-muted);
}

.layer-debug-search:focus-within {
  border-color: var(--accent);
}

.layer-debug-search input {
  color: var(--ui-ink);
}

.layer-debug-list,
.layer-picked-list {
  scrollbar-width: thin;
  scrollbar-color: var(--ui-line-strong) transparent;
}

.layer-debug-group,
.layer-debug-row,
.layer-picked-row {
  border-color: var(--ui-line);
  border-radius: 4px;
  background: var(--ui-surface-strong);
}

.layer-debug-row:hover,
.layer-debug-row.picked,
.layer-debug-group-row.picked {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.layer-debug-row.outlined {
  border-color: #d7a24c;
  background: var(--warning-soft);
}

.layer-debug-actions button.active,
.layer-debug-outline-button.active {
  border-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.layer-debug-outline-button {
  border-color: var(--ui-line);
  border-radius: 3px;
  background: var(--ui-surface-muted);
  color: var(--ui-muted);
}

.layer-debug-outline-button:hover {
  border-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.layer-debug-row input,
.layer-picked-row input {
  accent-color: var(--accent);
}

.inspector .kv code {
  color: var(--accent-hover);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.usage-guide-backdrop {
  background: rgba(7, 8, 10, 0.72);
  backdrop-filter: blur(3px);
}

.usage-guide-dialog,
.lan-access-dialog {
  border: 1px solid var(--ui-line-strong);
  border-radius: 6px;
  background: var(--ui-surface-strong);
  color: var(--ui-ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
}

.usage-guide-header {
  border-bottom-color: var(--ui-line);
  background: var(--ui-surface);
}

.usage-guide-header h2,
.usage-guide-section h3,
.lan-access-help-section h3 {
  color: var(--ui-ink);
}

.usage-guide-header p:last-child,
.usage-guide-section p,
.usage-guide-section li,
.lan-access-details small,
.lan-access-muted,
.lan-access-help-section li,
.lan-access-help-section dd {
  color: var(--ui-muted);
}

.usage-guide-eyebrow,
.settings-eyebrow {
  color: var(--accent);
}

.usage-guide-close,
.usage-guide-lan-entry,
.settings-back-button,
.settings-action {
  border: 1px solid var(--ui-line-strong);
  border-radius: 4px;
  background: var(--ui-surface-strong);
  color: var(--ui-muted);
}

.usage-guide-close:hover,
.usage-guide-lan-entry:hover,
.settings-back-button:hover,
.settings-action:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.usage-guide-section {
  border-top-color: var(--ui-line);
  background: transparent;
}

.usage-guide-section code,
.lan-access-details code {
  border-radius: 3px;
  background: var(--ui-surface-muted);
  color: var(--accent-hover);
}

.usage-guide-link,
.settings-source-link {
  color: var(--accent);
}

.lan-access-panel,
.lan-access-help-section {
  border-color: var(--ui-line);
  background: var(--ui-surface);
}

.lan-access-qr,
.lan-access-qr-placeholder {
  border-color: var(--ui-line);
  background: #ffffff;
}

.settings-page-shell {
  background: var(--ui-page);
  color: var(--ui-ink);
}

.settings-page {
  width: min(1120px, calc(100% - 40px));
  gap: 14px;
  padding: 20px 0 32px;
}

.settings-page-copy h1 {
  color: var(--ui-ink);
  font-size: 25px;
}

.settings-page-copy > p:last-child,
.settings-note-item p,
.settings-kv-card span,
.settings-kv-card small {
  color: var(--ui-muted);
}

.settings-card {
  gap: 14px;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  background: var(--ui-surface-strong);
  padding: 16px 18px;
  box-shadow: none;
}

.settings-card-header h2,
.settings-kv-card strong {
  color: var(--ui-ink);
}

.settings-appearance-card {
  grid-column: 1 / -1;
}

.theme-segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(88px, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  background: var(--ui-surface-muted);
}

.theme-segmented-control button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ui-muted);
  padding: 0 12px;
}

.theme-segmented-control button:hover {
  color: var(--ui-ink);
}

.theme-segmented-control button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.settings-status-banner,
.settings-kv-card,
.settings-note-item {
  border-color: var(--ui-line);
  border-radius: 4px;
  background: var(--ui-surface-muted);
}

.settings-status-badge.comparison-up-to-date {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.settings-status-badge.comparison-update-available {
  background: var(--warning-soft);
  color: #76501d;
}

.settings-status-badge.comparison-baseline-missing,
.settings-status-badge.comparison-remote-unavailable {
  background: var(--danger-soft);
  color: var(--danger);
}

.settings-error {
  color: var(--danger);
}

.app-error-boundary {
  background: var(--ui-page);
}

.app-error-panel {
  border-color: var(--danger);
  border-radius: 6px;
  background: var(--ui-surface-strong);
  color: var(--danger);
}

.app-error-panel h1 {
  color: var(--ui-ink);
}

.app-error-panel p,
.app-error-panel details {
  color: var(--ui-muted);
}

@media (min-width: 1280px) and (orientation: landscape) and (min-height: 681px) {
  .app-shell {
    grid-template-columns: clamp(238px, 18vw, 272px) minmax(0, 1fr) clamp(292px, 23vw, 340px);
    height: 100dvh;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) clamp(292px, 23vw, 340px);
  }

  .app-shell.layer-sidebar-collapsed {
    grid-template-columns: clamp(238px, 18vw, 272px) minmax(0, 1fr) 0;
  }

  .app-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 0;
  }

  .sidebar {
    padding: 16px 14px;
  }

  .workspace {
    padding: 0;
  }
}

@media (min-width: 760px) and (max-width: 1279px),
  (orientation: portrait) and (min-width: 760px) and (max-width: 1439px),
  (orientation: landscape) and (min-width: 760px) and (max-height: 680px) {
  .app-shell,
  .app-shell.layer-sidebar-collapsed,
  .app-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: clamp(220px, 28vw, 252px) minmax(0, 1fr);
    height: 100dvh;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .layer-debug-dock,
  .layer-debug-dock.collapsed {
    display: none;
  }

  .workspace {
    padding: 0;
  }
}

@media (max-width: 759px) and (orientation: portrait) {
  body {
    overflow: auto;
  }

  .app-shell,
  .app-shell.sidebar-collapsed,
  .app-shell.layer-sidebar-collapsed,
  .app-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(300px, 44dvh) minmax(390px, 56dvh);
    min-height: 100dvh;
  }

  .app-shell > .sidebar {
    grid-column: 1;
    grid-row: 1;
    height: 44dvh;
    max-height: 44dvh;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--ui-line);
  }

  .app-shell > .workspace {
    grid-column: 1;
    grid-row: 2;
    height: max(390px, 56dvh);
    min-height: max(390px, 56dvh);
    padding: 0;
  }

  .character-list {
    max-height: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand-block h1 {
    font-size: 15px;
  }

  .stage-toolbar {
    right: 8px;
    left: auto;
    width: min(220px, calc(100% - 68px));
    max-width: none;
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .stage-toolbar-actions {
    width: auto;
    max-height: 150px;
  }

  .live2d-stage-toolbar {
    width: min(200px, calc(100% - 60px));
  }

  .live2d-debug-dock {
    right: 8px;
    bottom: 54px;
    left: 8px;
    width: auto;
    max-height: 44%;
  }

  .preview-drawer-handle {
    padding: 6px 8px;
  }

  .usage-guide-dialog,
  .lan-access-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .settings-page {
    width: calc(100% - 24px);
  }

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

@media (max-width: 759px) and (orientation: landscape) {
  body {
    overflow: hidden;
  }

  .app-shell,
  .app-shell.layer-sidebar-collapsed,
  .app-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: clamp(164px, 27vw, 188px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: 100dvh;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .app-shell > .sidebar {
    grid-column: 1;
    grid-row: 1;
    gap: 7px;
    padding: 8px;
    border-right: 1px solid var(--ui-line);
    border-bottom: 0;
  }

  .app-shell > .workspace {
    grid-column: 2;
    grid-row: 1;
    padding: 0;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .brand-block h1 {
    font-size: 13px;
  }

  .brand-block p {
    font-size: 9px;
  }

  .character-row.card-row,
  .character-row.card-row.has-preview {
    min-height: 50px;
    contain-intrinsic-size: auto 50px;
  }

  .stage-toolbar-actions {
    max-height: calc(100dvh - 70px);
  }

  .live2d-debug-dock {
    bottom: 52px;
    max-height: 58%;
  }
}

@media (max-width: 420px) {
  .rarity-filter button,
  .rarity-tag {
    padding-right: 6px;
    padding-left: 6px;
    font-size: 11px;
  }

  .preview-drawer-tabs button {
    flex: 1 1 calc(33.333% - 4px);
    min-width: 0;
    padding-right: 5px;
    padding-left: 5px;
  }

  .preview-drawer-status {
    max-width: calc(100% - 54px);
  }
}

.app-shell,
.archive-shell,
.spine-shell {
  min-height: 0;
}

.spine-shell {
  height: 100%;
}

.stage-toolbar {
  max-width: min(40vw, 300px);
  max-height: calc(100% - 16px);
}

.stage-toolbar-actions {
  max-width: 100%;
  max-height: min(54dvh, 360px);
  overflow-y: auto;
}

@media (min-width: 761px) and (max-width: 1180px) {
  .app-shell,
  .archive-shell,
  .app-shell.layer-sidebar-collapsed,
  .archive-shell.layer-sidebar-collapsed,
  .app-shell.sidebar-collapsed.layer-sidebar-collapsed,
  .archive-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: 250px minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  .app-shell.sidebar-collapsed,
  .archive-shell.sidebar-collapsed {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .layer-debug-dock,
  .layer-debug-dock.collapsed {
    display: none;
  }
}

@media (max-height: 680px) and (min-width: 761px) {
  .app-shell,
  .archive-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  .workspace { padding: 8px 10px 10px; }
  .sidebar { gap: 8px; padding: 10px 12px; }
  .stage-toolbar-actions { max-height: min(48dvh, 240px); }
}

@media (max-width: 760px) {
  .app-shell,
  .archive-shell,
  .app-shell.sidebar-collapsed,
  .archive-shell.sidebar-collapsed,
  .app-shell.layer-sidebar-collapsed,
  .archive-shell.layer-sidebar-collapsed,
  .app-shell.sidebar-collapsed.layer-sidebar-collapsed,
  .archive-shell.sidebar-collapsed.layer-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(520px, 68dvh);
    height: auto;
    min-height: 100dvh;
  }

  .app-shell > .sidebar,
  .archive-shell > .sidebar {
    grid-column: 1;
    grid-row: 1;
    height: auto;
    max-height: none;
  }

  .app-shell > .workspace,
  .archive-shell > .workspace {
    grid-column: 1;
    grid-row: 2;
    height: min(68dvh, 620px);
    min-height: 520px;
  }
}
/* ---------------------------------------------------------------------------
 * 舞台动作条「收起 / 展开」（2026-09-28，全域 12 站）
 *
 * 背景：动作列表（.stage-toolbar-actions）在移动端/竖屏会占用大量竖向空间遮挡立绘，
 * 用户要求可以收起，且收起按钮要醒目。子站是冻结预构建产物、没有源码，因此由共享
 * panel 在运行时注入按钮，样式集中在这里。
 *
 * 结构（由 gallery-panel.js 注入）：
 *   <div class="stage-toolbar" data-actions-open="true|false">
 *     <button class="stage-toolbar-toggle">…</button>
 *     <div class="stage-toolbar-actions">…</div>
 *   </div>
 * ------------------------------------------------------------------------- */

/* 醒目按钮：高对比底色 + 描边 + 阴影，确保在深色舞台与立绘上都清晰可辨。 */
.stage-toolbar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  background: linear-gradient(135deg, #f0398a 0%, #a21caf 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.stage-toolbar-toggle:hover {
  background: linear-gradient(135deg, #ff4d97 0%, #b81fc4 100%);
  border-color: #ffffff;
  transform: translateY(-1px);
}

.stage-toolbar-toggle:active {
  transform: translateY(0);
}

.stage-toolbar-toggle > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 展开态只保留动作按钮本身，不显示列表容器底框。 */
.stage-toolbar[data-actions-open='true'] .stage-toolbar-actions {
  padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  max-height: min(52dvh, 380px); overflow-y: auto; overscroll-behavior: contain;
}

/* 收起态：动作列表隐藏，只留醒目的展开按钮。 */
.stage-toolbar[data-actions-open='false'] .stage-toolbar-actions {
  display: none !important;
}

/* 收起态下沿用旧版「当前动作」标签时也一并隐藏，避免与按钮重复占位。 */
.stage-toolbar[data-actions-open='false'] .current-animation {
  display: none !important;
}


/* ------------------------------------------------------------------ *
 * 主题固定为暗色（2026-09-28）
 * 用户不再能选择主题：设置页的主题切换入口隐藏；即使旧 bundle 仍写入
 * data-theme="light"，也已无任何 light 变量/规则可命中，视觉恒为暗色。
 * ------------------------------------------------------------------ */
.settings-appearance-card,
.theme-segmented-control,
.settings-card:has(> .settings-card-header > .theme-segmented-control) {
  display: none !important;
}




/* 2026-10-06 stage toolbar: controls row and every action button share the
 * stage's right edge instead of letting the action list inherit the row's left edge. */
.stage-toolbar .current-animation { display:none !important; }
.stage-toolbar-toggle-row { display:inline-flex; align-items:center; justify-content:flex-end; gap:6px; width:fit-content; align-self:flex-end; }
.stage-toolbar-right-sidebar-toggle { display:inline-grid; place-items:center; width:34px; min-width:34px; height:34px; padding:0; border:1px solid rgba(255,255,255,.72); border-radius:8px; color:rgba(255,255,255,.94); background:rgba(255,255,255,.10); cursor:pointer; backdrop-filter:blur(16px) saturate(145%); -webkit-backdrop-filter:blur(16px) saturate(145%); }
.stage-toolbar-right-sidebar-toggle:hover { background:rgba(255,255,255,.18); }
.stage-toolbar-actions { align-self:flex-end; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; }
.stage-toolbar-actions button { align-self:flex-end; }

/* GALLERY-SHELL SHARED UI v20261005 */
/*
 * 全站共享 UI 层：只约束页面壳、字幕、动作条和预览抽屉的共同交互。
 * 角色数据、页面专属内容以及各站 Spine/Live2D/DragonBones 运行时不在此处处理。
 */

/* 语音字幕：保留立绘可见度，并由 suite/panel 按底部抽屉实际高度设置偏移。 */
.spine-subtitle-overlay {
  bottom: var(--gallery-subtitle-bottom, 58px);
  max-width: min(720px, calc(100% - 28px));
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(7, 10, 15, 0.54);
  color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px) saturate(135%);
  transition: bottom 160ms ease, opacity 160ms ease;
}

.spine-subtitle-source {
  color: rgba(255, 255, 255, 0.68);
}

.spine-subtitle-text {
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.72);
}

/* 竖屏动作条：固定在舞台右侧，动作列表从展开按钮下方展开，避免遮住主体立绘。 */
@media (max-width: 759px) and (orientation: portrait) {
  /* 竖屏动作条固定在舞台右上角，不能随舞台垂直居中。 */
  .stage-toolbar {
    top: 10px;
    right: 10px;
    left: auto;
    width: fit-content;
    max-width: min(52vw, 220px);
    max-height: min(64dvh, 430px);
    align-items: flex-end;
    transform: none;
  }

  .stage-toolbar-toggle {
    align-self: flex-end;
    width: fit-content;
    max-width: 100%;
    min-height: 34px;
    padding: 0 10px;
    background:
      linear-gradient(135deg, rgba(255, 79, 164, 0.68), rgba(161, 28, 190, 0.58)),
      rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
  }

  .stage-toolbar-actions {
    width: fit-content;
    max-width: 100%;
    max-height: min(52dvh, 340px);
    align-items: flex-end;
    /* 竖屏仅保留动作按钮本身，不再给按钮列表套额外容器框。 */
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .stage-toolbar-actions button {
    width: fit-content;
    max-width: min(52vw, 220px);
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: left;
    line-height: 1.2;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.035)),
      rgba(10, 14, 22, 0.22);
    border-color: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(16px) saturate(145%);
    -webkit-backdrop-filter: blur(16px) saturate(145%);
  }

  .stage-toolbar-actions button > span {
    min-width: 0;
    max-width: min(42vw, 180px);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
  }
}

/* 底部抽屉保持单行；低优先级页签由 gallery-panel 按语义隐藏。 */
.preview-drawer-handle {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.preview-drawer-tabs {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.preview-drawer-tabs::-webkit-scrollbar {
  display: none;
}

.preview-drawer-tabs button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.preview-drawer-tabs button[data-gallery-hidden='true'] {
  display: none !important;
}

.preview-drawer-status {
  flex: 0 0 auto;
  min-width: 0;
  margin-left: auto;
}

.preview-drawer-status-actions {
  flex-wrap: nowrap;
  white-space: nowrap;
}

@media (max-width: 759px) and (orientation: portrait) {
  .preview-drawer-handle {
    gap: 6px;
    padding: 6px 8px;
  }

  .preview-drawer-tabs {
    flex: 1 1 auto;
    width: auto;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .preview-drawer-tabs button {
    flex: 0 0 auto;
    padding: 6px 8px;
    font-size: 11px;
  }

  .preview-drawer-status {
    max-width: min(34vw, 160px);
  }
}
