:root {
  color-scheme: light;
  --bg: #eef0f6;
  --panel: rgba(255, 255, 255, 0.88);
  --surface: #f6f7fb;
  --surface-strong: #ffffff;
  --border: #cfd4e2;
  --text: #222631;
  --muted: #80879a;
  --primary: #5b91dc;
  --primary-strong: #4f86d6;
  --shadow: 0 16px 40px rgba(123, 137, 168, 0.18);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #fbfcff 0%, #edf0f6 36%, #e3e7f0 100%);
  overflow: hidden;
}

button,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.9) 0, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.6) 0, rgba(255, 255, 255, 0) 25%);
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  margin: 0;
  padding: 24px;
  border-radius: 0;
  background: transparent;
  display: grid;
  grid-template-columns: minmax(180px, 208px) minmax(0, 1fr);
  gap: 14px;
}

.sidebar-card,
.table-toolbar-card,
.workspace-card,
.settings-card,
.preview-card {
  background: var(--panel);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(205, 210, 223, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.sidebar-card {
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 48px);
  min-height: 0;
  overflow: hidden;
}

.episode-sidebar-card {
  gap: 12px;
}

.sidebar-toolbar {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(214, 220, 231, 0.9);
}

.sidebar-toolbar .file-hint {
  min-height: 0;
  text-align: left;
}

.sidebar-toolbar .primary-button {
  width: 100%;
  min-height: 46px;
  font-size: 15px;
}

.sidebar-toolbar .episode-table-settings-button {
  width: 100%;
  justify-self: stretch;
}

.visually-hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.episode-sidebar-head {
  display: grid;
  gap: 8px;
}

.episode-sidebar-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.sidebar-episode-list {
  flex: 1;
  min-height: 0;
  gap: 8px;
  overflow: auto;
  padding: 4px 6px 0 2px;
}

.sidebar-episode-list .list-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 14px;
}

.sidebar-episode-list .list-item:not(.is-active) {
  border-bottom: 1px solid #d6d9e3;
  border-radius: 0;
}

.lists-wrap {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.list-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.list-group h2 {
  margin: 2px 0 16px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
}

.list-note {
  margin: -4px 0 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.item-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 4px 0;
}

.list-item {
  min-height: 52px;
  padding: 0 10px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.list-item:not(.is-active) {
  border-bottom: 1px solid #d6d9e3;
  border-radius: 0;
}

.list-item:hover,
.list-item:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.list-item.is-active {
  background: #edf3ff;
  border-color: #d9e4f7;
}

.list-item.muted {
  color: var(--muted);
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 16px;
  color: #f7fbff;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(180deg, #6ca0e6 0%, var(--primary-strong) 100%);
  box-shadow: 0 10px 20px rgba(85, 129, 206, 0.24);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(85, 129, 206, 0.3);
  filter: saturate(1.08);
}

.button-icon {
  font-size: 20px;
  line-height: 1;
}

.file-hint {
  margin: 0;
  min-height: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.main-panel {
  display: flex;
  height: calc(100vh - 48px);
  min-height: 0;
  overflow: hidden;
}

.table-toolbar-card {
  padding: 24px 28px;
  display: grid;
  gap: 12px;
}

.table-toolbar-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.table-page-title {
  margin: 0 0 8px;
  color: #354153;
  font-size: 28px;
  line-height: 1.15;
}

.table-toolbar-card .file-hint {
  min-height: 0;
  text-align: left;
}

.table-toolbar-label {
  color: #7b8598;
  font-size: 14px;
  font-weight: 700;
}

.workspace-card {
  padding: 20px;
  display: flex;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.workspace-detail-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  overflow: hidden;
}

.episode-table-card {
  flex: 1;
  width: 100%;
  min-height: 0;
  background: var(--surface);
  border: 1px solid rgba(205, 210, 223, 0.8);
  border-radius: 26px;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.episode-table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.episode-table-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: min(100%, 780px);
  flex: 1 1 780px;
}

.episode-global-settings.settings-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.94);
}

.episode-global-settings-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #edf4ff;
  color: #547ebb;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.episode-global-settings-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 8px;
}

.episode-global-settings .setting-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(154, 184, 235, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.episode-global-settings .setting-row label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7a90;
  line-height: 1.2;
}

.episode-global-settings .setting-row select {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(207, 212, 226, 0.88);
  background: #f8fbff;
  box-shadow: none;
  font-size: 12px;
}

.episode-global-settings .setting-row select:focus {
  background: #ffffff;
}

.episode-table-secondary-side .episode-table-settings-button {
  align-self: flex-end;
}

.episode-table-secondary-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding-top: 2px;
}

.episode-table-secondary-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.episode-table-secondary-side {
  margin-left: auto;
}

.episode-table-batch-button,
.episode-table-settings-button {
  min-height: 38px;
  padding: 0 16px;
}

.episode-table-settings-button {
  flex-shrink: 0;
}

.episode-table-title {
  color: #495467;
  font-size: 18px;
  font-weight: 700;
}

.episode-table-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.episode-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: 20px;
  border: 1px solid #dbe2ee;
  background: rgba(255, 255, 255, 0.92);
}

.episode-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.episode-table th,
.episode-table td {
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e3e9f2;
}

.episode-table td {
  font-size: 12px;
  line-height: 1.45;
}

.episode-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f8fd;
  color: #4f5a6d;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.episode-table th:nth-child(1) {
  width: 72px;
}

.episode-table th:nth-child(2) {
  width: 220px;
}

.episode-table th:nth-child(3) {
  width: 360px;
}

.episode-table th:nth-child(4) {
  width: 300px;
}

.episode-table th:nth-child(5) {
  width: 260px;
}

.episode-table th:nth-child(6) {
  width: 280px;
}


.episode-check-cell {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 48px;
  margin: 0 auto;
  border-radius: 12px;
  cursor: pointer;
}

.episode-check-cell:hover {
  background: rgba(91, 145, 220, 0.08);
}

.episode-segment-select-label {
  display: grid;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0 10px;
  border-radius: 12px;
  color: #354153;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  cursor: pointer;
}

.episode-segment-select-label:hover {
  background: rgba(91, 145, 220, 0.08);
}

.episode-meta-cell {
  display: grid;
  gap: 10px;
}

.episode-meta-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.episode-meta-cell .episode-segment-select-label {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid rgba(154, 184, 235, 0.28);
  background: rgba(255, 255, 255, 0.72);
}

.episode-meta-cell .episode-segment-select-label:hover {
  background: rgba(248, 251, 255, 0.96);
}

.episode-segment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.episode-segment-action-button {
  min-height: 40px;
  padding: 0 12px;
  flex-shrink: 0;
}

.episode-segment-action-button.is-danger {
  border-color: #f0cbcb;
  background: #fff3f3;
  color: #c25656;
}

.episode-segment-action-button.is-danger:hover,
.episode-segment-action-button.is-danger:focus-visible {
  border-color: #e4a5a5;
  background: #ffe9e9;
}

.episode-meta-field-list {
  display: grid;
  gap: 10px;
}

.episode-meta-field {
  display: grid;
  gap: 6px;
}

.episode-meta-field-label {
  padding-left: 4px;
  color: #6b7a90;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.episode-meta-field-value {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 4px;
}

.episode-combined-editor-cell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.episode-combined-editor-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.episode-combined-editor-field + .episode-combined-editor-field {
  padding-top: 10px;
  border-top: 1px dashed rgba(154, 184, 235, 0.38);
}

.episode-combined-editor-label {
  padding-left: 4px;
  color: #6b7a90;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.episode-meta-field-value.is-wrap {
  align-items: flex-start;
}

.episode-meta-setting-editor-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.episode-meta-setting-editor {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.episode-meta-setting-editor-label {
  padding-left: 4px;
  color: #6b7a90;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.episode-meta-setting-select.is-single-line {
  min-height: 36px;
  padding: 0 10px;
}

.episode-check-header {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 6px;
  min-width: 52px;
  min-height: 52px;
  margin: 0 auto;
  border-radius: 14px;
  color: #4f5a6d;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.episode-check-header:hover {
  background: rgba(91, 145, 220, 0.08);
}

.episode-row-checkbox,
.episode-header-checkbox {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--primary-strong);
  cursor: pointer;
}

.episode-table-row {
  cursor: pointer;
}

.episode-table-row td {
  background: rgba(255, 255, 255, 0.92);
  transition: background 180ms ease;
}

.episode-table-row:hover td {
  background: #f8fbff;
}

.episode-table-row.is-active td {
  background: #edf4ff;
}

.episode-table-cell-text {
  max-height: 148px;
  overflow: auto;
  color: #394252;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.episode-table-editor-shell {
  width: 100%;
}

.episode-table-editor {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: #394252;
  outline: none;
  font: inherit;
  line-height: 1.55;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.episode-table-editor:hover {
  background: rgba(248, 251, 255, 0.96);
}

.episode-table-editor:focus {
  border-color: #9ab8eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(91, 145, 220, 0.14);
}

.episode-table-editor.is-single-line {
  min-height: 42px;
  padding: 0 12px;
}

.episode-table-editor.is-multiline {
  min-height: 96px;
  padding: 10px 12px;
  overflow-y: hidden;
  resize: none;
}

.episode-prompt-editor-shell {
  position: relative;
}

.episode-prompt-display {
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: #394252;
  cursor: text;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.episode-prompt-display:hover {
  background: rgba(248, 251, 255, 0.96);
}

.episode-prompt-display:focus-visible {
  border-color: #9ab8eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(91, 145, 220, 0.14);
  outline: none;
}

.episode-prompt-editor-shell.is-editing .episode-prompt-display {
  display: none;
}

.episode-prompt-editor {
  display: none;
}

.episode-prompt-editor-shell.is-editing .episode-prompt-editor {
  display: block;
}

.prompt-selection-action-button {
  position: fixed;
  z-index: 36;
  transform: translateX(-100%);
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(142, 174, 228, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  color: #4f6fa7;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(33, 55, 91, 0.2);
  cursor: pointer;
}

.prompt-selection-action-button:hover,
.prompt-selection-action-button:focus-visible {
  outline: none;
  border-color: #7c9fdd;
  background: #edf4ff;
}

.episode-prompt-marker-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.episode-prompt-marker-title {
  flex: 0 0 auto;
  padding-top: 4px;
  color: #7f8ba1;
  font-size: 11px;
  font-weight: 700;
}

.episode-prompt-marker-list {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
}

.episode-prompt-preview-text {
  color: #394252;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.episode-prompt-marker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
  white-space: nowrap;
}

.episode-prompt-marker.is-inline {
  display: inline;
  min-height: auto;
  padding: 0 0.22em;
  margin: 0;
  border-radius: 0.45em;
  line-height: inherit;
  white-space: nowrap;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.episode-prompt-marker.is-replaceable:hover,
.episode-prompt-marker.is-replaceable:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(91, 145, 220, 0.18);
  filter: brightness(0.98);
}

.episode-prompt-nowrap-group,
.episode-prompt-nowrap-suffix {
  white-space: nowrap;
}

.episode-prompt-marker.is-scene {
  background: rgba(87, 129, 214, 0.16);
  color: #3f62a7;
}

.episode-prompt-marker.is-character {
  background: rgba(115, 94, 214, 0.16);
  color: #624db0;
}

.episode-prompt-marker.is-prop {
  background: rgba(221, 126, 71, 0.18);
  color: #a55728;
}

.episode-prompt-marker.is-generic {
  background: rgba(113, 129, 155, 0.16);
  color: #556277;
}

.episode-prompt-marker-tooltip {
  position: fixed;
  z-index: 1600;
  width: 220px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(19, 26, 38, 0.96);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.28);
  color: #f5f8ff;
  pointer-events: none;
}

.episode-prompt-marker-tooltip-card {
  display: grid;
  gap: 10px;
}

.episode-prompt-marker-tooltip-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.episode-prompt-marker-tooltip-image.is-empty {
  display: grid;
  place-items: center;
  color: rgba(245, 248, 255, 0.72);
  font-size: 12px;
}

.episode-prompt-marker-tooltip-title {
  font-size: 13px;
  font-weight: 700;
}

.episode-prompt-marker-tooltip-note {
  margin-top: 2px;
  color: rgba(245, 248, 255, 0.72);
  font-size: 11px;
  line-height: 1.45;
}

.episode-table-empty,
.episode-table-empty-row {
  color: #93a0b5;
  font-size: 13px;
}

.episode-table-empty-row {
  padding: 28px 18px !important;
  text-align: center;
}

.episode-duration-pill,
.episode-table-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.episode-duration-pill {
  background: #edf4ff;
  color: #5378b5;
}

.episode-video-cell {
  display: grid;
  gap: 8px;
  align-content: start;
}

.episode-setting-cell {
  display: grid;
  gap: 8px;
}

.episode-setting-list {
  display: grid;
  gap: 8px;
}

.episode-setting-empty {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.episode-setting-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.episode-setting-toolbar.is-picker {
  align-items: stretch;
}

.episode-setting-inline-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.episode-setting-inline-button.is-secondary {
  border-color: #d7dde9;
  background: #f7f9fc;
  color: #6f7b91;
}

.episode-setting-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  min-height: 104px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid #d8e1ef;
  background: rgba(255, 255, 255, 0.84);
}

.episode-setting-card.is-clickable {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.episode-setting-card.is-clickable:hover,
.episode-setting-card.is-clickable:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(126, 156, 214, 0.46);
  box-shadow: 0 10px 24px rgba(59, 86, 135, 0.08);
}

.episode-setting-media {
  display: grid;
  align-items: center;
  justify-items: center;
  min-width: 0;
}

.episode-setting-card.is-scene {
  background: rgba(91, 145, 220, 0.08);
  border-color: rgba(91, 145, 220, 0.22);
}

.episode-setting-card.is-character {
  background: rgba(120, 110, 255, 0.08);
  border-color: rgba(120, 110, 255, 0.2);
}

.episode-setting-card.is-prop {
  background: rgba(255, 178, 75, 0.1);
  border-color: rgba(255, 178, 75, 0.26);
}

.episode-setting-thumb {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  object-fit: cover;
  background: #eef3fa;
  border: 1px solid rgba(207, 218, 235, 0.9);
}

.episode-setting-thumb.is-fallback {
  display: grid;
  place-items: center;
  font-size: 30px;
}

.episode-setting-element-id {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 10px;
  background: #eef8f1;
  color: #2f7d55;
  box-sizing: border-box;
}

.episode-setting-element-id.is-empty {
  background: #f3f5f9;
  color: #7b8798;
}

.episode-setting-element-label {
  color: #6f7b91;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.25;
}

.episode-setting-element-value {
  margin-top: 2px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.episode-setting-content {
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: start;
}

.episode-setting-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.episode-setting-remove-button {
  flex-shrink: 0;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(224, 117, 117, 0.28);
  background: rgba(255, 239, 239, 0.92);
  color: #b45454;
  font-size: 10px;
  font-weight: 700;
}

.episode-setting-remove-button:hover,
.episode-setting-remove-button:focus-visible {
  outline: none;
  border-color: rgba(214, 94, 94, 0.45);
  background: rgba(255, 231, 231, 0.98);
}

.episode-setting-title {
  color: #354153;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.episode-setting-meta {
  color: #7c8799;
  font-size: 10px;
  line-height: 1.3;
}

.episode-video-cell.is-inline-player {
  min-width: 0;
}

.episode-inline-player {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.episode-inline-frame {
  position: relative;
  width: auto;
  max-width: 100%;
  height: 156px;
  justify-self: center;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(29, 57, 85, 0.5) 0%, rgba(6, 18, 30, 0.88) 42%, rgba(3, 10, 17, 0.98) 100%),
    linear-gradient(135deg, #263547 0%, #0f151c 100%);
}

.episode-inline-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050b12;
}

.episode-inline-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(7, 18, 32, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.episode-inline-player.is-playing .episode-inline-play {
  opacity: 0.92;
}

.episode-inline-status {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
}

.episode-inline-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.episode-inline-control {
  min-height: 28px;
  padding: 0 8px;
}

.episode-inline-time {
  min-width: 74px;
}

.episode-table-status.is-success {
  background: rgba(60, 210, 152, 0.14);
  color: #20845c;
}

.episode-table-status.is-pending {
  background: rgba(96, 173, 255, 0.14);
  color: #346fb6;
}

.episode-table-status.is-error {
  background: rgba(255, 94, 125, 0.14);
  color: #ba4460;
}

.episode-table-status.is-muted {
  background: #f1f4f9;
  color: #8490a3;
}

.episode-video-note {
  color: #7e879a;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.episode-video-sync-note {
  color: #93a0b5;
  font-size: 11px;
  line-height: 1.4;
}

.episode-video-request-button {
  justify-self: flex-start;
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}
.episode-video-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.episode-video-delete-button {
  border-color: #f0cbcb;
  background: #fff3f3;
  color: #c25656;
}

.episode-video-delete-button:hover,
.episode-video-delete-button:focus-visible {
  border-color: #e4a5a5;
  background: #ffe9e9;
}

.prompt-card {
  min-height: 0;
  background: var(--surface);
  border: 1px solid rgba(205, 210, 223, 0.8);
  border-radius: 26px;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.prompt-label {
  color: #9aa1b1;
  font-size: 18px;
  font-weight: 700;
}


#promptInput {
  width: 100%;
  flex: 1;
  min-height: 220px;
  resize: none;
  overflow: auto;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
}

#promptInput::placeholder {
  color: #c0c5d1;
}

.asset-section {
  min-height: 0;
  background: var(--surface);
  border: 1px solid rgba(205, 210, 223, 0.8);
  border-radius: 26px;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.asset-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.asset-section-title {
  color: #495467;
  font-size: 18px;
  font-weight: 700;
}

.asset-section-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-left: auto;
  max-width: 420px;
}

.asset-grid {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px 18px;
  align-content: start;
}

.setting-library-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(205, 210, 223, 0.72);
  display: grid;
  gap: 12px;
}

.setting-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.setting-library-title {
  color: #495467;
  font-size: 16px;
  font-weight: 700;
}

.setting-library-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.setting-library-note-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.setting-library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.setting-library-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #748096;
  font-size: 13px;
}

.setting-library-progress {
  display: grid;
  gap: 8px;
}

.setting-library-progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf6;
  box-shadow: inset 0 1px 2px rgba(41, 56, 85, 0.08);
}

.setting-library-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #87b6ff 0%, #4f8df2 100%);
  transition: width 160ms ease;
}

.setting-library-progress-text {
  color: #5f6f87;
  font-size: 12px;
  line-height: 1.6;
}

.setting-library-progress-segment {
  display: inline;
}

.setting-library-progress-action {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: #3f73c9;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 1px dashed rgba(63, 115, 201, 0.45);
}

.setting-library-progress-action:hover,
.setting-library-progress-action:focus-visible {
  outline: none;
  color: #2f5ca9;
  border-bottom-color: rgba(47, 92, 169, 0.8);
}

.setting-library-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
  align-content: start;
}

.setting-library-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #d7deeb;
  background: rgba(247, 249, 253, 0.96);
  align-content: start;
}

.setting-library-item-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: #eef3fb;
}

.setting-library-thumbs,
.setting-library-thumb-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 16px;
}

.setting-library-thumbs {
  position: relative;
  overflow: hidden;
}

.setting-library-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  object-fit: cover;
  border: 0;
  background: #eef3fb;
  box-shadow: none;
}

.setting-library-thumb-more {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 48, 73, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.setting-library-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef3fb, #dde7f4);
  color: #728094;
  font-size: 12px;
  font-weight: 700;
  border: 1px dashed #c4d1e2;
}

.setting-library-item-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.setting-library-item-name {
  color: #334154;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  min-width: 0;
  flex: 1 1 auto;
  word-break: break-word;
}

.setting-library-item-meta {
  color: #738094;
  font-size: 12px;
  line-height: 1.5;
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.inline-tip-button {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(124, 141, 170, 0.55);
  background: rgba(238, 243, 251, 0.96);
  color: #5d708f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.inline-tip-button:hover,
.inline-tip-button:focus-visible {
  outline: none;
  background: #dfe9f8;
  border-color: rgba(86, 114, 170, 0.72);
  color: #35578b;
  transform: translateY(-1px);
}

.setting-library-item-tip-button {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(7, 18, 32, 0.68);
  color: #ffffff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.setting-library-delete-button {
  appearance: none;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(191, 85, 96, 0.9);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border-style: solid;
  border-width: 1px;
  font-size: 16px;
  font-weight: 700;
  font-family: Arial, sans-serif;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, visibility 160ms ease, background 160ms ease, border-color 160ms ease;
}

.setting-library-item:hover .setting-library-item-tip-button,
.setting-library-item:hover .setting-library-delete-button,
.setting-library-item:focus-within .setting-library-item-tip-button,
.setting-library-item:focus-within .setting-library-delete-button {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.setting-library-delete-button:hover,
.setting-library-delete-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(191, 85, 96, 1);
}

.setting-library-delete-button:disabled {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(127, 138, 158, 0.72);
  color: rgba(255, 255, 255, 0.86);
}

.setting-library-item-tip-button:hover,
.setting-library-item-tip-button:focus-visible {
  background: rgba(7, 18, 32, 0.84);
  border-color: rgba(255, 255, 255, 0.62);
  color: #ffffff;
}

.setting-library-empty {
  grid-column: 1 / -1;
  min-height: 96px;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed #d4dbe8;
  background: rgba(245, 247, 252, 0.92);
  color: #7b8496;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.asset-empty-state {
  grid-column: 1 / -1;
  min-height: 164px;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 22px;
  border: 1px dashed #d4dbe8;
  background: rgba(245, 247, 252, 0.92);
  color: #7b8496;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.asset-card {
  position: relative;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid #d4dbe8;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 247, 252, 0.95) 100%);
  display: grid;
  gap: 10px;
  align-content: start;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.asset-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.asset-slot-label {
  font-size: 14px;
  font-weight: 700;
  color: #637086;
}

.asset-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef3fb;
  color: #6d7a92;
  font-size: 12px;
  font-weight: 700;
}

.asset-thumb {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 116px;
  padding: 10px 8px;
  border-radius: 18px;
  border: 1px dashed #ccd5e4;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, #eef3fb 0%, #e5ebf6 100%);
  color: #8b95a8;
  overflow: hidden;
}

.asset-thumb::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.asset-thumb-icon {
  position: relative;
  z-index: 1;
  font-size: 30px;
  line-height: 1;
}

.asset-thumb-tip {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  word-break: break-all;
}

.asset-thumb.has-image {
  padding: 0;
  border-style: solid;
  background: #eef3fb;
}

.asset-thumb.has-image::before {
  display: none;
}

.asset-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.asset-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

.asset-meta,
.asset-count {
  color: #7b8496;
  font-size: 12px;
  line-height: 1.45;
}

.asset-count:empty {
  display: none;
}

.asset-card:hover,
.asset-card:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.asset-card.is-linked {
  border-color: #bfd0ef;
}

.asset-card.is-selected {
  border-color: #91b4ea;
  background: linear-gradient(180deg, #fbfdff 0%, #eef4ff 100%);
  box-shadow: 0 10px 22px rgba(90, 136, 212, 0.14);
}

.asset-card.is-selected .asset-thumb,
.asset-card.is-linked .asset-thumb {
  border-color: #9ab8eb;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, #edf5ff 0%, #dceafe 100%);
  color: #547ebb;
}

.asset-card.is-empty .asset-source-pill {
  background: #f1f3f8;
  color: #8b95a8;
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(340px, 1.05fr);
  gap: 22px;
  min-height: 420px;
}

.settings-card,
.preview-card {
  padding: 20px;
}

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

.setting-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 140px);
  align-items: center;
  gap: 14px;
}

.setting-row label {
  font-size: 20px;
  font-weight: 700;
}

.setting-row select {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid #cfd4e2;
  background: #ffffff;
  color: var(--text);
  font-size: 18px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8893a8 50%),
    linear-gradient(135deg, #8893a8 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px),
    100% 0;
  background-size: 6px 6px, 6px 6px, 2.5em 2.5em;
  background-repeat: no-repeat;
}



.preview-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
}

body.has-preview-overlay,
body.has-setting-picker-overlay,
body.has-settings-library-overlay,
body.has-request-detail-overlay,
body.has-app-dialog-overlay {
  overflow: hidden;
}

.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}

.preview-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 18, 0.84);
}

.preview-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 14px;
}

.preview-overlay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}

.preview-overlay-title {
  color: #f8fbff;
  font-size: 20px;
  font-weight: 700;
}

.preview-overlay-note {
  margin-top: 6px;
  color: rgba(240, 246, 255, 0.76);
  font-size: 14px;
  line-height: 1.5;
}

.preview-overlay-close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 18px;
}

.preview-overlay-close:hover,
.preview-overlay-close:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
}

.setting-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 12px;
}

.setting-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 31, 0.56);
  backdrop-filter: blur(8px);
}

.setting-picker-panel {
  position: relative;
  z-index: 1;
  width: min(1360px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.setting-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}

.setting-picker-title {
  color: #f8fbff;
  font-size: 20px;
  font-weight: 700;
}

.setting-picker-note {
  margin-top: 6px;
  color: rgba(240, 246, 255, 0.76);
  font-size: 14px;
  line-height: 1.5;
}

.setting-picker-close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 18px;
}

.setting-picker-close:hover,
.setting-picker-close:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
}

.setting-picker-card {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(216, 225, 239, 0.78);
  background: rgba(248, 251, 255, 0.98);
  box-shadow: 0 18px 42px rgba(13, 24, 45, 0.18);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  height: min(82vh, 820px);
  max-height: calc(100vh - 72px);
  overflow: hidden;
}

.setting-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.setting-picker-filters {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
}

.setting-picker-limit-notice {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(237, 180, 92, 0.4);
  background: rgba(255, 246, 228, 0.96);
  color: #9a6a18;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.setting-picker-filter {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #cfdaeb;
  background: #ffffff;
  color: #5a6981;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.setting-picker-filter:hover,
.setting-picker-filter:focus-visible {
  outline: none;
  border-color: #9eb8e8;
  background: #f4f8ff;
}

.setting-picker-filter.is-active {
  border-color: #8fb0e8;
  background: #edf4ff;
  color: #476cae;
}

.setting-picker-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(111, 135, 168, 0.12);
  color: inherit;
  font-size: 11px;
  line-height: 1;
}

.setting-picker-search {
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid #cfd8ea;
  background: #ffffff;
  color: #39465a;
  font-size: 14px;
}

.setting-picker-search:focus-visible {
  outline: none;
  border-color: #94b3eb;
  box-shadow: 0 0 0 3px rgba(148, 179, 235, 0.22);
}

.setting-picker-summary {
  color: #67748a;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.setting-picker-results {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  align-content: start;
  padding-right: 6px;
}

.setting-picker-empty {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px dashed #cfdaeb;
  background: rgba(243, 246, 251, 0.92);
  color: #7b8798;
  font-size: 14px;
}

.setting-picker-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  align-content: start;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid #d7deeb;
  background: rgba(255, 255, 255, 0.96);
  text-align: left;
}

.setting-picker-item:hover,
.setting-picker-item:focus-visible {
  outline: none;
  border-color: #9eb8e8;
  background: #f4f8ff;
  transform: translateY(-1px);
}

.setting-picker-item-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #eef3fa;
  border: 1px solid rgba(207, 218, 235, 0.9);
}

.setting-picker-item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.setting-picker-item-thumb.is-fallback {
  color: #7a89a2;
  font-size: 24px;
  font-weight: 800;
}

.setting-picker-item-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 4px;
}

.setting-picker-item-title {
  color: #334052;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.setting-picker-item-meta {
  color: #617289;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.setting-picker-item-category {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #476cae;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-all;
}

.setting-picker-item-element {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef8f1;
  color: #2f7d55;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-all;
}

.setting-picker-item-element.is-empty {
  background: #f3f5f9;
  color: #7b8798;
}

.setting-picker-item-note {
  color: #7c8799;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.settings-library-overlay {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: grid;
  place-items: center;
  padding: 24px;
}

.settings-library-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 31, 0.56);
  backdrop-filter: blur(8px);
}

.settings-library-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 14px;
}

.settings-library-overlay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}

.settings-library-overlay-title {
  color: #f8fbff;
  font-size: 20px;
  font-weight: 700;
}

.settings-library-overlay-note {
  margin-top: 6px;
  color: rgba(240, 246, 255, 0.76);
  font-size: 14px;
  line-height: 1.5;
}

.settings-library-overlay-note-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-library-overlay-note-inline .inline-tip-button {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.settings-library-overlay-note-inline .inline-tip-button:hover,
.settings-library-overlay-note-inline .inline-tip-button:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.44);
  color: #ffffff;
}

.settings-library-overlay-close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 18px;
}

.settings-library-overlay-close:hover,
.settings-library-overlay-close:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
}

.request-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 38;
  display: grid;
  place-items: center;
  padding: 16px;
}

.request-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 31, 0.56);
  backdrop-filter: blur(8px);
}

.request-detail-panel {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.request-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}

.request-detail-title {
  color: #f8fbff;
  font-size: 20px;
  font-weight: 700;
}

.request-detail-note {
  margin-top: 6px;
  color: rgba(240, 246, 255, 0.76);
  font-size: 14px;
  line-height: 1.5;
}

.request-detail-close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 18px;
}

.request-detail-close:hover,
.request-detail-close:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
}

.request-detail-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98) 0%, rgba(240, 245, 255, 0.96) 100%);
  border: 1px solid rgba(190, 204, 228, 0.78);
  box-shadow: 0 28px 72px rgba(11, 18, 31, 0.28);
}

.request-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.request-detail-toolbar-note {
  color: #73819a;
  font-size: 13px;
  line-height: 1.5;
}

.request-detail-copy-button {
  flex-shrink: 0;
}

.request-detail-content {
  min-height: 0;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border-radius: 20px;
  border: 1px solid #d7deeb;
  background: #0f1724;
  color: #dce6f8;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.settings-library-modal-card {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(216, 225, 239, 0.78);
  background: rgba(248, 251, 255, 0.98);
  box-shadow: 0 18px 42px rgba(13, 24, 45, 0.18);
  min-height: min(74vh, 760px);
  max-height: calc(100vh - 120px);
  overflow: hidden;
}

.setting-library-panel-modal {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  height: 100%;
  min-height: 0;
}

.setting-library-panel-modal .setting-library-list {
  max-height: min(56vh, 620px);
}

.app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 31, 0.56);
  backdrop-filter: blur(8px);
}

.app-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 48px));
}

.app-dialog-card {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(216, 225, 239, 0.8);
  background: rgba(248, 251, 255, 0.98);
  box-shadow: 0 18px 42px rgba(13, 24, 45, 0.22);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
}

.app-dialog-panel.is-danger .app-dialog-icon {
  background: rgba(255, 94, 125, 0.14);
  border-color: rgba(255, 94, 125, 0.24);
  color: #d94d6d;
}

.app-dialog-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(96, 173, 255, 0.14);
  border: 1px solid rgba(96, 173, 255, 0.22);
  color: #3f73c9;
  font-size: 22px;
  font-weight: 800;
}

.app-dialog-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.app-dialog-title {
  color: #334052;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

.app-dialog-note {
  color: #617289;
  font-size: 13px;
  line-height: 1.5;
}

.app-dialog-message {
  color: #4b596f;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.app-dialog-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.app-dialog-cancel,
.app-dialog-confirm {
  min-width: 96px;
}

.app-dialog-confirm.is-danger {
  border-color: #d55a76;
  background: linear-gradient(135deg, #f56c88 0%, #e34d70 100%);
  box-shadow: 0 12px 24px rgba(227, 77, 112, 0.24);
}

.app-dialog-confirm.is-danger:hover,
.app-dialog-confirm.is-danger:focus-visible {
  background: linear-gradient(135deg, #f77490 0%, #dc4569 100%);
}

.preview-card-modal {
  padding: 24px;
  max-height: calc(100vh - 120px);
}

.preview-card-modal .preview-frame {
  min-height: min(70vh, 620px);
}

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

.preview-frame {
  position: relative;
  min-height: 360px;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(29, 57, 85, 0.5) 0%, rgba(6, 18, 30, 0.88) 42%, rgba(3, 10, 17, 0.98) 100%),
    linear-gradient(135deg, #263547 0%, #0f151c 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
  background: #050b12;
}

@media (max-width: 900px) {
  .setting-picker-overlay {
    padding: 10px;
  }

  .setting-picker-panel {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
  }

  .setting-picker-card {
    height: min(84vh, 760px);
    max-height: calc(100vh - 56px);
    padding: 16px;
  }

  .setting-picker-toolbar {
    grid-template-columns: 1fr;
  }

  .setting-picker-results {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

[hidden] {
  display: none !important;
}

.preview-frame::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1;
  pointer-events: none;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 34px;
  background: rgba(7, 18, 32, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.preview-controls {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 56px;
  z-index: 2;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(6, 14, 24, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.preview-control-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.preview-control-button:hover,
.preview-control-button:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.preview-seek-range {
  width: 100%;
  accent-color: #8cc7ff;
}

.preview-time-label {
  min-width: 96px;
  text-align: right;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.preview-meta {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.preview-status-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  backdrop-filter: blur(6px);
}

.preview-status-badge.is-error {
  background: rgba(255, 94, 125, 0.18);
  border-color: rgba(255, 94, 125, 0.3);
}

.preview-status-badge.is-success {
  background: rgba(60, 210, 152, 0.18);
  border-color: rgba(60, 210, 152, 0.3);
}

.preview-status-badge.is-pending {
  background: rgba(96, 173, 255, 0.18);
  border-color: rgba(96, 173, 255, 0.3);
}

.preview-meta span,
.floating-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  backdrop-filter: blur(6px);
}

.floating-tag {
  position: absolute;
  animation: floatFade 2.1s ease forwards;
  pointer-events: none;
  z-index: 3;
}

@keyframes floatFade {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.92);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -28px) scale(0.98);
  }
}

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

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

  .sidebar-card {
    height: auto;
    min-height: 0;
  }

  .sidebar-episode-list {
    max-height: 260px;
  }

  .main-panel {
    height: auto;
    min-height: auto;
    grid-template-rows: auto minmax(720px, auto);
    overflow: visible;
  }

  .workspace-detail-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .table-toolbar-card,
  .sidebar-card,
  .workspace-card,
  .settings-card,
  .preview-card {
    padding: 18px;
  }

  .table-toolbar-main {
    flex-direction: column;
    align-items: stretch;
  }

  .table-page-title {
    font-size: 20px;
  }

  .asset-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .asset-section-note {
    margin-left: 0;
    max-width: none;
  }

  .setting-library-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .setting-library-actions {
    width: 100%;
  }

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

  .preview-actions {
    grid-template-columns: 1fr;
  }

  .episode-table-head {
    flex-direction: column;
    align-items: stretch;
  }

  .episode-table-head-side {
    min-width: 0;
    width: 100%;
    align-items: stretch;
  }

  .episode-global-settings.settings-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .episode-global-settings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .episode-table-secondary-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .episode-table-secondary-buttons {
    width: 100%;
  }

  .episode-table-secondary-side {
    margin-left: 0;
  }

  .preview-overlay,
  .settings-library-overlay,
  .app-dialog-overlay {
    padding: 14px;
  }

  .preview-overlay-panel {
    width: calc(100vw - 28px);
    max-height: calc(100vh - 28px);
  }

  .settings-library-overlay-panel,
  .app-dialog-panel {
    width: calc(100vw - 28px);
  }

  .preview-overlay-title {
    font-size: 20px;
  }

  .preview-card-modal {
    padding: 16px;
  }

  .settings-library-modal-card {
    padding: 16px;
    min-height: min(72vh, 720px);
  }

  .app-dialog-card {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .app-dialog-icon {
    width: 40px;
    height: 40px;
  }

  .app-dialog-actions {
    justify-content: stretch;
  }

  .app-dialog-cancel,
  .app-dialog-confirm {
    flex: 1 1 0;
  }

  .setting-row {
    grid-template-columns: 88px 1fr;
  }

  .episode-global-settings .setting-row {
    padding: 8px 10px;
  }

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

  .setting-library-panel-modal .setting-library-list {
    max-height: min(52vh, 560px);
  }
}


.asset-card-shell {
  display: grid;
  gap: 10px;
  align-content: start;
}

.asset-card {
  width: 100%;
}

.section-action-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #b9c8e4;
  background: #f4f8ff;
  color: #4f6fa7;
  font-size: 13px;
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.section-action-button:hover,
.section-action-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: #8eaee4;
  background: #edf4ff;
}

.section-action-button:disabled {
  cursor: default;
  opacity: 0.6;
  transform: none;
}

.asset-card-status-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.asset-element-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef8f1;
  color: #2f7d55;
  font-size: 12px;
  font-weight: 700;
  word-break: break-all;
}

.asset-task-note {
  min-height: 18px;
  color: #6f7b91;
  font-size: 12px;
  line-height: 1.5;
}

.asset-task-note:empty {
  display: none;
}

.asset-task-note.is-error {
  color: #bf5b58;
}

.asset-task-note.is-success {
  color: #2f7d55;
}

.asset-task-note.is-pending {
  color: #547ebb;
}
