.video-active #topbar {
  display: none;
}
.video-page {
  gap: 20px;
}
.video-page h2 {
  font-size: 16px;
  font-weight: 650;
}
.video-page h3 {
  font-size: 15px;
  font-weight: 650;
}
.video-page [hidden] {
  display: none !important;
}
.video-tabs,
.video-segments {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--card2);
}
.video-tabs button,
.video-segments button {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  flex: 1;
  white-space: nowrap;
}
.video-tabs button[aria-selected="true"],
.video-segments button[aria-pressed="true"],
.video-segments button[aria-selected="true"] {
  background: var(--purple-bg);
  color: var(--a1);
  font-weight: 650;
}
.video-tabs button:hover,
.video-segments button:hover {
  background: var(--purple-bg);
}
.video-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.video-layout {
  display: grid;
  grid-template-columns: minmax(310px, 370px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.video-compose {
  padding: 20px;
}
.video-compose fieldset {
  border: 0;
  min-width: 0;
  padding: 0;
  margin: 0;
}
.video-card-head,
.video-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.video-card-head {
  margin-bottom: 16px;
}
.video-card-head p {
  margin-top: 5px;
}
.video-card-head > div {
  min-width: 0;
}
.video-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}
.video-field label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}
.video-field textarea,
.video-field select,
.video-field input:not([type="checkbox"]),
.video-history-tools input,
.video-history-tools select,
.video-library-tools input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--card2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
}
.video-field textarea {
  height: 135px;
  resize: vertical;
}
.video-field select option,
.video-history-tools select option {
  background: var(--card-solid);
  color: var(--text);
}
.video-field textarea:focus,
.video-field select:focus,
.video-field input:focus,
.video-history-tools input:focus,
.video-library-tools input:focus {
  outline: 2px solid var(--a1);
  outline-offset: 2px;
}
.video-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.video-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.video-link {
  border: 0;
  padding: 3px 0;
  background: none;
  color: var(--a1);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.video-template-line {
  margin-top: 14px;
}
.video-submit {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.video-submit .btn-grad {
  width: 100%;
  justify-content: center;
  font-size: 13px;
}
.video-submit .btn-grad:disabled,
.video-page button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.video-drop {
  border: 1px dashed var(--hair);
  background: var(--purple-bg);
  border-radius: 12px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text);
  padding: 14px;
}
.video-drop.dragover {
  border-color: var(--a1);
}
.video-file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.video-file-actions .btn {
  font-size: 12px;
}
.video-source {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--card2);
  min-width: 0;
}
.video-source > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.video-input-preview {
  width: 100%;
  max-height: 185px;
  display: block;
  border-radius: 10px;
  background: #141321;
}
.video-input-audio {
  width: 100%;
  height: 42px;
}
.video-warning {
  color: var(--orange);
}
.video-check {
  display: flex;
  align-items: center;
  gap: 9px;
}
.video-check input {
  accent-color: var(--a1);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.video-audio-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--stroke);
}
.video-audio-tabs {
  margin-top: 12px;
}
.video-enabled-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
}
.video-field input[type="range"] {
  padding: 0;
  accent-color: var(--a1);
}
.video-notice {
  margin: 0 0 14px;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--purple-bg);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.video-notice.error {
  background: var(--err-bg);
  color: var(--red);
}
.video-pending {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.video-pending .btn {
  align-self: flex-start;
}
.video-job {
  padding: 20px;
  margin-bottom: 16px;
  min-width: 0;
}
.video-job .video-card-head {
  align-items: flex-start;
}
.video-job .badge {
  white-space: nowrap;
}
.video-stage-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.video-job-prompt {
  border-bottom: 1px solid var(--stroke);
  padding: 0 0 10px;
  font-size: 13px;
  line-height: 1.8;
}
.video-job-prompt summary {
  color: var(--muted);
  cursor: pointer;
}
.video-job-prompt p {
  padding-top: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 200px;
  overflow: auto;
}
.video-output-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.video-output {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card2);
}
.video-output video {
  width: 100%;
  max-height: 420px;
  display: block;
  background: #141321;
  object-fit: contain;
}
.video-output audio {
  width: calc(100% - 24px);
  display: block;
  margin: 12px;
  height: 44px;
}
.video-output-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 12px;
}
.video-output-actions > .video-hint {
  flex: 1 1 100%;
  min-width: 0;
}
.video-output-actions .btn {
  font-size: 12px;
  padding: 7px 12px;
  text-decoration: none;
}
.video-job-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.video-job-id {
  margin-left: auto;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.video-plan {
  padding: 8px 12px;
  background: var(--purple-bg);
  border-radius: 8px;
  margin-bottom: 12px;
}
.video-ratio-tool {
  padding: 18px 20px;
  margin-top: 18px;
}
.video-ratio-tool summary {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.75;
}
.video-ratio-tool summary .video-hint {
  margin-left: 8px;
  font-weight: 400;
}
.video-tool-body {
  padding-top: 14px;
}
.video-tool-body > .video-line {
  margin-top: 16px;
  align-items: flex-start;
}
.video-tool-body > .video-line .btn {
  flex-shrink: 0;
}
.video-tool-body textarea {
  height: 90px;
}
.video-history-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.video-history-tools input {
  flex: 1;
  min-width: 180px;
}
.video-history-tools select {
  width: 160px;
}
.video-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.video-history-grid .video-job {
  margin-bottom: 0;
}
.video-history-grid .video-output video {
  max-height: 290px;
}
.video-history-grid > .empty-panel,
.video-history-grid > .video-pending {
  grid-column: 1/-1;
}
.video-more {
  grid-column: 1/-1;
  justify-self: center;
  margin-top: 4px;
}
.video-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.video-template {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  min-width: 0;
}
.video-template > p:not(.video-hint) {
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 140px;
  overflow: auto;
  width: 100%;
}
.video-template .video-file-actions {
  margin-top: auto;
}
.video-refs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.video-refs > div {
  position: relative;
  width: 78px;
  height: 78px;
}
.video-refs img {
  width: 100%;
  height: 100%;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  object-fit: cover;
}
.video-refs button {
  position: absolute;
  right: -5px;
  top: -5px;
  width: 23px;
  height: 23px;
  border: 1px solid var(--stroke);
  border-radius: 50%;
  background: var(--card-solid);
  color: var(--text);
  cursor: pointer;
}
.video-library-tools {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.video-library-tools input {
  flex: 1;
}
.video-library-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow: auto;
}
.video-library-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--card2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.video-library-item:hover {
  border-color: var(--a1);
  background: var(--purple-bg);
}
.video-library-item > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.video-library-item > .video-hint {
  flex-shrink: 0;
}
.video-library-pages {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
  font-size: 13px;
}
.video-mobile-menu {
  display: none;
}
.video-page .btn {
  min-height: 33px;
}
.video-page .empty-panel {
  line-height: 1.8;
  padding: 30px 20px;
  text-align: center;
  font-size: 13px;
}
@media (min-width: 1500px) {
  .video-layout {
    grid-template-columns: 390px minmax(0, 1fr);
  }
}
@media (max-width: 1150px) {
  .video-layout {
    grid-template-columns: minmax(290px, 330px) minmax(0, 1fr);
    gap: 16px;
  }
  .video-compose,
  .video-job {
    padding: 17px;
  }
  .video-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .video-history-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 980px) {
  .video-mobile-menu {
    display: inline-flex;
  }
  .video-page .page-head {
    align-items: center;
  }
  .video-tabs button {
    padding: 9px 13px;
  }
  .video-layout {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .video-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .video-page {
    gap: 16px;
  }
  .video-compose {
    padding: 18px;
  }
  .video-board > .video-card-head {
    margin-top: 3px;
  }
  .video-output video {
    max-height: 360px;
  }
  .video-page .page-tools {
    width: auto;
  }
  .video-tabs button {
    font-size: 12px;
    padding: 9px 10px;
  }
  .video-history-tools select {
    width: 140px;
  }
  .video-template-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .video-job-id {
    max-width: 140px;
  }
  .video-ratio-tool {
    padding: 16px;
  }
  .video-tool-body > .video-line {
    flex-wrap: wrap;
  }
  .video-library-item {
    gap: 8px;
    font-size: 13px;
  }
  .video-library-item > .video-hint {
    display: none;
  }
}
@media (max-width: 420px) {
  .video-page .page-head {
    gap: 8px;
    flex-wrap: wrap;
  }
  .video-page .page-title {
    font-size: 18px;
  }
  .video-page .page-tools {
    margin-left: auto;
  }
  .video-tabs button {
    padding: 8px;
  }
  .video-segments button {
    font-size: 12px;
    padding: 9px 7px;
  }
  .video-audio-block > .video-line {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .video-history-tools select {
    flex: 1;
  }
  .video-job-actions .btn {
    font-size: 12px;
    padding: 7px 10px;
  }
  .video-pair {
    gap: 10px;
  }
}
