* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: #ffffff;
  color: #000000;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.shell {
  width: min(1240px, calc(100vw - 40px));
  margin: 28px auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 4px;
}

.menu-tabs {
  display: flex;
  gap: 10px;
  margin: 18px 0 0;
  border-bottom: 2px solid #000000;
}

.menu-tabs button {
  min-height: 44px;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.menu-tabs button.active {
  background: #000000;
  color: #ffffff;
}

.workspace-page {
  margin-top: 16px;
}

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

.cat-logo {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border: 2px solid #000000;
  border-radius: 8px;
  background: #ffffff;
  transform: rotate(-3deg);
}

.cat-logo::before,
.cat-logo::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 18px;
  height: 18px;
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
  background: #ffffff;
}

.cat-logo::before {
  left: 7px;
  transform: rotate(45deg);
}

.cat-logo::after {
  right: 7px;
  transform: rotate(45deg);
}

.cat-eye {
  position: absolute;
  top: 22px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #000000;
}

.cat-eye.left {
  left: 16px;
}

.cat-eye.right {
  right: 16px;
}

.cat-mouth {
  position: absolute;
  left: 50%;
  bottom: 13px;
  width: 16px;
  height: 8px;
  border-bottom: 2px solid #000000;
  border-radius: 0 0 16px 16px;
  transform: translateX(-50%);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

p {
  margin-top: 8px;
  color: #333333;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  align-items: stretch;
  gap: 18px;
  margin: 0 0 14px;
}

.grid > .panel {
  height: 100%;
}

.grid > .panel:first-child {
  display: flex;
  flex-direction: column;
}

.grid > .panel:first-child .primary {
  margin-top: auto;
}

.panel {
  border: 2px solid #000000;
  border-radius: 6px;
  padding: 18px;
  background: #ffffff;
}

textarea,
input[type="file"],
input[type="text"],
select {
  display: block;
  width: 100%;
  margin: 8px 0 16px;
  border: 1.5px solid #000000;
  border-radius: 4px;
  padding: 10px;
  font: inherit;
  background: #ffffff;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

#prompt {
  min-height: 310px;
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 14px;
  margin-top: 10px;
}

.radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

button,
.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 2px solid #000000;
  border-radius: 4px;
  padding: 0 16px;
  background: #ffffff;
  color: #000000;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

button.is-loading {
  gap: 8px;
  cursor: wait;
}

button.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.replace-video {
  margin-left: auto;
}

.primary {
  width: 100%;
  margin-top: 6px;
  background: #000000;
  color: #ffffff;
}

video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f4f4f4;
  border: 1.5px solid #000000;
  margin-bottom: 12px;
}

.download {
  margin-bottom: 0;
}

audio {
  width: 100%;
  margin: 0 0 12px;
}

.status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.pill {
  border: 1.5px solid #000000;
  border-radius: 4px;
  padding: 8px;
  min-height: 40px;
  font-size: 14px;
}

pre {
  min-height: 96px;
  max-height: 150px;
  overflow: auto;
  margin: 0;
  border: 1.5px solid #000000;
  padding: 10px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.45;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-header h2 {
  margin: 0;
}

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

.timeline-block {
  margin: 18px 0 16px;
}

.cue {
  border-left: 3px solid #000000;
  padding: 7px 9px;
  background: #f7f7f7;
  font-size: 13px;
  line-height: 1.35;
}

.time {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal[hidden] {
  display: none;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
}

.modal-dialog {
  position: relative;
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 2px solid #000000;
  border-radius: 6px;
  padding: 18px;
  background: #ffffff;
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header {
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
}

.close-button {
  width: 40px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.narration-editor {
  display: grid;
  gap: 10px;
}

.narration-row {
  display: grid;
  grid-template-columns: 116px 220px 1fr;
  gap: 12px;
  border: 1.5px solid #000000;
  border-radius: 4px;
  padding: 12px;
  background: #fbfbfb;
}

.row-actions {
  display: grid;
  align-content: start;
  gap: 8px;
}

.row-actions strong {
  font-size: 14px;
}

.row-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.time-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.time-inputs input {
  width: 100%;
  margin-top: 6px;
  border: 1.5px solid #000000;
  border-radius: 4px;
  padding: 9px;
  font: inherit;
}

.line-text textarea {
  min-height: 58px;
  margin-bottom: 0;
}

.command-box {
  min-height: 78px;
}

.primary-inline {
  background: #000000;
  color: #ffffff;
}

.voice-panel {
  margin-top: 14px;
}

.voice-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 18px;
  align-items: start;
}

.voice-panel textarea {
  min-height: 92px;
}

@media (max-width: 900px) {
  .grid,
  .timeline,
  .voice-grid {
    grid-template-columns: 1fr;
  }

  .top {
    align-items: flex-start;
    flex-direction: column;
  }

  .replace-video {
    margin-left: 0;
  }

  .narration-row,
  .modal-actions {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
