:root {
  color-scheme: dark;
  --bg: #141a1f;
  --panel: #1c252c;
  --line: #303d46;
  --text: #edf4f5;
  --muted: #94a5af;
  --accent: #b4e4ff;
  font:
    14px Inter,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  background: transparent;
  color: inherit;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px 12px;
  min-height: 36px;
  cursor: pointer;
}
button:hover {
  background: #ffffff0b;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input,
select,
textarea {
  border: 1px solid #3c4b54;
  background: #202c34;
  color: var(--text);
  padding: 8px;
  border-radius: 6px;
  min-height: 34px;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  padding: 0;
  min-height: 20px;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  min-height: 0;
}
input[type="color"] {
  padding: 3px;
  width: 45px;
}
textarea {
  resize: vertical;
  min-height: 65px;
  width: 100%;
  line-height: 1.6;
}
.primary {
  background: var(--accent);
  color: #16303f;
  font-weight: 650;
}
.primary:hover {
  background: #d2efff;
}
.outline {
  border-color: #445660;
}
.danger {
  color: #f7a0a0;
}
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.spacer {
  flex: 1;
}
.active {
  background: #b4e4ff13;
  color: var(--accent);
}
.shell {
  height: 100dvh;
  min-height: 710px;
  display: grid;
  grid-template-rows: 66px minmax(320px, 1fr) 215px 32px;
  grid-template-columns: minmax(0, 1fr);
}
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 0 26px;
  background: #1a2228;
}
.brand {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.8px;
  white-space: nowrap;
}
.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #183441;
  border-radius: 9px;
  margin-right: 9px;
  font-size: 17px;
}
.project-name {
  border: 0;
  background: transparent;
  width: 150px;
  padding: 5px;
}
.saved {
  font-size: 12px;
  color: var(--muted);
}
.topbar .primary {
  padding: 9px 23px;
}
.workspace {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr) 234px;
  min-height: 0;
  min-width: 0;
}
.media-panel {
  border-right: 1px solid var(--line);
  padding: 18px 15px;
  overflow: auto;
  background: #192127;
}
.panel-title {
  font-size: 14px;
  font-weight: 550;
  margin: 0 0 17px;
}
.import-btn {
  width: 100%;
  margin-bottom: 20px;
  border-style: dashed;
  border-color: #5a7483;
  color: #c3e2ed;
  padding: 12px 10px;
}
.media-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.media-card {
  border: 1px solid var(--line);
  background: #202c34;
  border-radius: 7px;
  padding: 8px;
  cursor: pointer;
  position: relative;
  text-align: left;
  width: 100%;
}
.media-card:hover {
  border-color: #92becf;
}
.media-thumb {
  height: 74px;
  border-radius: 4px;
  background: #111a20;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 24px;
  color: #9ec1d3;
}
.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
  padding-top: 8px;
}
.media-info strong {
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 125px;
}
.media-info span {
  font-size: 11px;
  color: #98aeb9;
}
.media-empty {
  padding: 24px 10px;
  color: #8197a4;
  font-size: 13px;
  line-height: 1.9;
}
.preview-panel {
  min-width: 0;
  min-height: 0;
  padding: 16px 24px 12px;
  display: flex;
  flex-direction: column;
}
.preview-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  min-height: 34px;
}
.preview-top h1 {
  font-size: 15px;
  font-weight: 550;
  margin: 0;
}
.preview-top select {
  font-size: 12px;
  padding: 4px 6px;
  min-height: 29px;
}
.stage {
  position: relative;
  flex: 1;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1014;
  border: 1px solid #273640;
  border-radius: 8px;
  overflow: hidden;
}
.stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.empty-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #10191f;
  gap: 13px;
  padding: 20px;
  text-align: center;
}
.empty-symbol {
  font-size: 30px;
  color: #b4e4ff;
  border: 1px solid #3b5565;
  background: #b4e4ff09;
  width: 67px;
  height: 55px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  margin-bottom: 3px;
}
.empty-stage h2 {
  font-size: 19px;
  font-weight: 550;
  margin: 0;
}
.empty-stage p {
  color: #8da6b3;
  font-size: 13px;
  margin: 0 0 5px;
}
.empty-stage .secondary {
  color: #aac5d3;
  font-size: 12px;
}
.empty-stage.hidden {
  display: none;
}
.transport {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 48px;
  padding-top: 10px;
}
.play {
  background: var(--accent);
  color: #143448;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  font-size: 16px;
}
.play:hover {
  background: #d4f0ff;
}
.time {
  font:
    12px Consolas,
    monospace;
  color: #b1c6d0;
  white-space: nowrap;
  min-width: 118px;
}
.scrub {
  flex: 1;
  min-width: 50px;
}
.inspector {
  border-left: 1px solid var(--line);
  padding: 19px 17px;
  overflow: auto;
  background: #192127;
}
.inspector-empty {
  color: #8197a4;
  font-size: 13px;
  line-height: 1.9;
  padding-top: 30px;
}
.property {
  margin: 15px 0;
  display: block;
}
.property > span,
.property-label {
  font-size: 12px;
  color: #9db0bd;
  display: block;
  margin-bottom: 7px;
}
.property input:not([type="checkbox"]):not([type="color"]),
.property select {
  width: 100%;
}
.property .row input {
  width: 0 !important;
  min-width: 0;
  flex: 1;
}
.property .row span {
  font-size: 12px;
  color: var(--muted);
}
.inspector h2 {
  font-size: 15px;
  font-weight: 550;
  margin: 0 0 20px;
}
.inspector hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}
.inspector small {
  font-size: 11px;
  color: #8198a7;
  line-height: 1.6;
  display: block;
}
.clip-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.clip-actions button {
  font-size: 12px;
  padding: 7px;
}
.timeline {
  border-top: 1px solid #41525c;
  background: #19232a;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.timeline-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 21px;
  height: 49px;
  border-bottom: 1px solid #2c3c46;
  flex-shrink: 0;
}
.timeline-toolbar button {
  font-size: 13px;
  min-height: 31px;
  padding: 5px 9px;
}
.timeline-toolbar h2 {
  font-size: 14px;
  font-weight: 550;
  margin: 0 17px 0 0;
}
.timeline-scroll {
  overflow: auto;
  position: relative;
  flex: 1;
  min-height: 0;
}
.timeline-content {
  position: relative;
  min-height: 151px;
  min-width: 100%;
  padding-bottom: 10px;
}
.ruler {
  height: 27px;
  position: relative;
  background: #1c2932;
}
.ruler span {
  position: absolute;
  top: 8px;
  color: #819cae;
  font:
    11px Consolas,
    monospace;
  border-left: 1px solid #47606e;
  padding-left: 7px;
  height: 19px;
}
.lane {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 51px;
  margin: 4px 0 5px 81px;
  position: relative;
}
.lane-label {
  position: sticky;
  left: 0;
  width: 80px;
  background: #19232a;
  z-index: 4;
  display: flex;
  align-items: center;
  padding-left: 20px;
  font-size: 12px;
  color: #99b6c7;
  flex-shrink: 0;
  position: absolute;
  top: 44px;
  height: 40px;
}
.lane-label.audio {
  top: 103px;
}
.timeline-clip {
  position: absolute;
  top: 0;
  height: 48px;
  flex-shrink: 0;
  background: #658ca3;
  color: #12222d;
  border: 1px solid #b8d6e5;
  border-radius: 5px;
  padding: 7px 9px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}
.timeline-clip.selected {
  outline: 2px solid #e2f4ff;
  outline-offset: 1px;
  background: #abd8ef;
}
.timeline-clip strong {
  font-size: 12px;
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-clip .meta {
  font:
    10px Consolas,
    monospace;
  margin-top: 5px;
  opacity: 0.7;
}
.timeline-clip.card {
  background: #a6a4ca;
  border-color: #d6cff6;
}
.timeline-clip .fade-badge {
  position: absolute;
  right: 5px;
  bottom: 5px;
  font-size: 10px;
}
.audio-lane {
  height: 30px;
  position: relative;
  margin-left: 81px;
  margin-top: 7px;
}
.audio-clip {
  position: absolute;
  height: 26px;
  background: #477b70;
  border: 1px solid #6cae9e;
  border-radius: 4px;
  top: 0;
  overflow: hidden;
  color: #d6f1e8;
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.audio-clip.selected {
  outline: 2px solid #d6f1e8;
}
.timeline-empty {
  color: #668293;
  font-size: 12px;
  padding: 14px 15px;
  white-space: nowrap;
}
.playhead {
  position: absolute;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: #eef8ff;
  z-index: 5;
  pointer-events: none;
}
.playhead:before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  width: 9px;
  height: 9px;
  background: #dff5ff;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.subtitle-mark {
  position: absolute;
  top: 24px;
  height: 3px;
  background: #e3c27b;
  z-index: 2;
}
.footer {
  border-top: 1px solid var(--line);
  padding: 0 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #192127;
  font-size: 12px;
  color: #7f98a6;
}
.footer button {
  font-size: 12px;
  min-height: 25px;
  padding: 4px 8px;
}
.drop-active .stage {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.tabs {
  display: flex;
  gap: 3px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.tabs button {
  font-size: 13px;
  flex: 1;
  min-height: 30px;
  padding: 5px;
}
.caption-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  padding: 10px;
  font-size: 12px;
  margin: 5px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.caption-item.active {
  border-color: var(--accent);
}
.mobile-action {
  display: none;
}
#notice {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #b4e4ff;
  color: #172e3b;
  border-radius: 8px;
  padding: 12px 20px;
  z-index: 100;
  opacity: 0;
  transition: 0.2s;
  pointer-events: none;
  max-width: 90vw;
  font-size: 14px;
  box-shadow: 0 10px 35px #0005;
}
#notice.show {
  opacity: 1;
  transform: translateX(-50%);
}
dialog {
  color: var(--text);
  background: #1b2831;
  border: 1px solid #476171;
  border-radius: 13px;
  width: 490px;
  max-width: 95vw;
  padding: 26px;
  box-shadow: 0 25px 100px #0009;
}
dialog::backdrop {
  background: #050c11bf;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font-size: 21px;
  margin: 0 0 13px;
}
dialog p {
  color: #a8bdc9;
  font-size: 14px;
  line-height: 1.8;
}
dialog .actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
dialog .choice {
  width: 100%;
  text-align: left;
  border: 1px solid #3d5563;
  margin: 7px 0;
  padding: 15px;
}
dialog .choice strong {
  display: block;
  margin-bottom: 5px;
}
dialog .choice span {
  color: var(--muted);
  font-size: 12px;
}
progress {
  width: 100%;
  height: 10px;
  accent-color: var(--accent);
  margin: 16px 0;
}
.export-stat {
  font:
    26px Consolas,
    monospace;
  color: var(--accent);
  text-align: center;
  padding: 15px;
}
.export-note {
  font-size: 12px !important;
}
.error-detail {
  color: #efa9a9 !important;
}
.busy {
  cursor: progress;
}
.busy .workspace,
.busy .timeline {
  pointer-events: none;
  opacity: 0.65;
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: 250px minmax(0, 1fr) 265px;
  }
  .media-thumb {
    height: 95px;
  }
  .shell {
    grid-template-rows: 70px minmax(380px, 1fr) 235px 32px;
  }
  .stage {
    min-height: 240px;
  }
}
@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 175px minmax(0, 1fr) 205px;
  }
  .topbar {
    padding: 0 17px;
    gap: 12px;
  }
  .saved {
    display: none;
  }
  .preview-panel {
    padding: 13px 16px;
  }
  .media-panel {
    padding: 17px 11px;
  }
  .inspector {
    padding: 17px 13px;
  }
  .media-thumb {
    height: 60px;
  }
  .time {
    min-width: 105px;
    font-size: 11px;
  }
  .transport {
    gap: 8px;
  }
}
@media (max-width: 780px) {
  .shell {
    min-height: 760px;
    grid-template-rows: 58px minmax(430px, 1fr) 225px 32px;
  }
  .topbar {
    gap: 8px;
    padding: 0 12px;
  }
  .brand {
    font-size: 13px;
    letter-spacing: 0;
  }
  .logo {
    width: 27px;
    height: 27px;
    margin-right: 6px;
    font-size: 14px;
  }
  .project-name {
    width: 95px;
    font-size: 13px;
  }
  .topbar button {
    font-size: 12px;
    padding: 6px 8px;
  }
  .topbar .primary {
    padding: 7px 12px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    position: relative;
  }
  .media-panel,
  .inspector {
    display: none;
    position: absolute;
    inset: 0 auto 0 0;
    width: 235px;
    z-index: 12;
    box-shadow: 15px 0 60px #000a;
  }
  .media-panel.open,
  .inspector.open {
    display: block;
  }
  .inspector {
    left: auto;
    right: 0;
  }
  .mobile-action {
    display: inline-block;
  }
  .preview-panel {
    padding: 12px 14px 8px;
  }
  .preview-top {
    gap: 7px;
  }
  .preview-top h1 {
    display: none;
  }
  .empty-stage h2 {
    font-size: 18px;
  }
  .timeline-toolbar {
    padding: 8px 10px;
    gap: 3px;
    flex-wrap: wrap;
    height: auto;
    min-height: 49px;
  }
  .timeline-toolbar h2 {
    display: none;
  }
  .timeline-toolbar button {
    font-size: 12px;
    padding: 6px 7px;
  }
  .footer {
    padding: 0 12px;
    font-size: 11px;
  }
  .footer .hide-small {
    display: none;
  }
  .preview-top select {
    max-width: 105px;
  }
  .time {
    font-size: 11px;
    min-width: 95px;
  }
  .timeline-toolbar .zoom-label {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
