@import url('./cinema.css');

body.studio-app {
  overflow: hidden;
  position: relative;
}
body.studio-app > *:not(.cinema-bg) { position: relative; z-index: 1; }

/* ---- topbar ---- */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  background: rgba(16, 18, 24, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: flex; align-items: center; gap: 14px;
  font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  min-width: 0; color: inherit; text-decoration: none;
}
.brand:hover { color: inherit; }
.brand .brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  box-shadow: 0 10px 28px rgba(232, 168, 74, 0.32);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.02em;
}
.brand__tag {
  font-size: 10px; color: var(--muted); font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; margin-top: 3px;
}
.env {
  font-size: 12px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.env.ok { color: var(--ok); border-color: rgba(107, 203, 138, 0.3); background: var(--ok-soft); }
.topbar__nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar__nav .btn { padding: 8px 12px; }

.layout {
  display: flex;
  height: calc(100vh - var(--topbar-h));
}

/* ---- sidebar ---- */
.sidebar {
  width: 280px; flex-shrink: 0;
  background: rgba(22, 25, 34, 0.92);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.side-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px; font-weight: 600; font-size: 13px;
  color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.project-list { overflow-y: auto; padding: 12px; flex: 1; }
.proj-card {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 8px; cursor: pointer; background: var(--panel);
  transition: border-color .15s, background .15s, transform .15s;
}
.proj-card:hover { border-color: rgba(232, 168, 74, 0.35); transform: translateY(-1px); }
.proj-card.active {
  border-color: var(--brand);
  background: linear-gradient(135deg, var(--brand-soft), transparent 70%);
  box-shadow: inset 0 0 0 1px rgba(232, 168, 74, 0.15);
}
.proj-card .name { font-weight: 600; font-size: 13.5px; padding-right: 36px; }
.proj-card .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.proj-card .del {
  float: right; color: var(--muted); cursor: pointer; font-size: 12px;
  padding: 2px 6px; border-radius: 6px;
}
.proj-card .del:hover { color: var(--err); background: var(--err-soft); }

/* ---- main ---- */
.main { flex: 1; overflow-y: auto; padding: 22px 28px 48px; }
.welcome {
  max-width: 680px; margin: 8vh auto 0; text-align: left;
  padding: 36px 40px; border-radius: 20px;
  background: linear-gradient(160deg, rgba(232, 168, 74, 0.08), transparent 50%), var(--panel);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: fade-up .4s ease;
}
.welcome h1 {
  font-family: var(--font-display); font-size: 32px; margin: 0 0 12px;
  color: var(--ink); letter-spacing: -0.02em;
}
.welcome h1 em {
  font-style: normal; color: var(--brand);
}
.welcome p { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.welcome__steps {
  display: grid; gap: 10px; margin: 22px 0 26px;
}
.welcome__step {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink); font-size: 13.5px;
}
.welcome__n {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12px;
}
.welcome__links { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- stepper ---- */
.stepper-wrap {
  margin-bottom: 18px;
  padding: 16px 18px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.stepper-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.stepper-head h2 {
  margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700;
}
.stepper-head .hint { font-size: 12.5px; color: var(--muted); }
.stepper {
  display: flex; align-items: stretch; gap: 0; position: relative;
}
.step {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 12px 14px; margin: 0;
  border: 1px solid var(--line); background: var(--bg-2);
  color: var(--muted); cursor: pointer; font: inherit; text-align: left;
  transition: .18s ease; position: relative;
}
.step:first-child { border-radius: 12px 0 0 12px; }
.step:last-child { border-radius: 0 12px 12px 0; }
.step + .step { border-left: none; }
.step:hover { color: var(--ink); background: var(--panel-2); }
.step .step__n {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,.06); color: var(--muted);
}
.step .step__label { font-size: 13px; font-weight: 600; line-height: 1.25; }
.step .step__sub { font-size: 11px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.step.active {
  background: linear-gradient(180deg, var(--brand-soft), transparent);
  border-color: rgba(232, 168, 74, 0.45);
  color: var(--ink);
  z-index: 1;
  box-shadow: 0 0 0 1px rgba(232, 168, 74, 0.2);
}
.step.active .step__n { background: var(--brand); color: #1a1208; }
.step.done { color: var(--ink); }
.step.done .step__n { background: var(--ok-soft); color: var(--ok); }
.step.locked { opacity: .55; cursor: not-allowed; }
.step.locked:hover { background: var(--bg-2); color: var(--muted); }

/* ---- panels ---- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
  animation: fade-up .3s ease;
}
.panel h2 {
  margin: 0 0 6px; font-size: 18px;
  font-family: var(--font-display); font-weight: 700;
}
.panel .sub { color: var(--muted); margin: 0 0 18px; font-size: 13.5px; max-width: 720px; }
.step-guide {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 18px;
  border-radius: 12px; background: var(--brand-soft);
  border: 1px solid rgba(232, 168, 74, 0.22);
}
.step-guide__icon { color: var(--brand); flex-shrink: 0; margin-top: 2px; }
.step-guide__body strong { display: block; margin-bottom: 2px; color: var(--ink); }
.step-guide__body span { color: var(--muted); font-size: 13px; }

.step-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.step-footer__meta { font-size: 12.5px; color: var(--muted); }
.step-footer__actions { display: flex; gap: 10px; margin-left: auto; }

/* materials / segments / tasks — dark surfaces */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.mat-card {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--bg-2); transition: border-color .15s, transform .15s;
}
.mat-card:hover { border-color: rgba(232, 168, 74, 0.35); transform: translateY(-2px); }
.mat-card .thumb { width: 100%; aspect-ratio: 16/9; background: #08090c center/cover; position: relative; }
.mat-card .thumb video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.mat-card .body { padding: 12px 14px; }
.mat-card .name { font-weight: 600; font-size: 13px; word-break: break-all; }
.mat-card .meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.progress { height: 6px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-dim), var(--brand)); width: 0; transition: .3s; }

.seg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.seg { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.seg .t { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000; cursor: pointer; }
.seg .info { padding: 10px; }
.seg .time { font-size: 12px; color: var(--muted); }
.seg .desc { font-size: 13px; margin: 4px 0; }
.seg .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.desc-edit { width: 100%; font-size: 12px; min-height: 48px; margin-top: 4px; }

.task {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  margin-bottom: 12px; background: var(--bg-2);
}
.task .head { display: flex; align-items: center; gap: 10px; }
.task .head .name { font-weight: 600; }
.task .copy { color: var(--muted); font-size: 13px; margin: 8px 0; white-space: pre-wrap; }
.task .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.task .prog { font-size: 12px; color: var(--warn); margin-top: 6px; }
.task .log {
  font-size: 11px; color: var(--muted); margin-top: 6px; max-height: 120px; overflow: auto;
  background: var(--bg); padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
}

.player-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.video-box {
  position: relative; background: #000; border-radius: 14px; overflow: hidden;
  aspect-ratio: 9/16; max-height: 70vh;
}
.video-box video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.subtitle-overlay {
  position: absolute; left: 0; right: 0; bottom: 24px; text-align: center;
  padding: 0 16px; pointer-events: none;
}
.subtitle-overlay span {
  display: inline-block; background: rgba(0,0,0,.65); color: #fff;
  padding: 4px 12px; border-radius: 8px; font-size: 16px; line-height: 1.4;
}
.timeline { margin-top: 12px; }
.timeline .bar { height: 8px; background: rgba(255,255,255,.08); border-radius: 5px; position: relative; }
.timeline .bar > i { position: absolute; top: 0; bottom: 0; background: var(--brand); border-radius: 5px; }
.sub-markers { margin-top: 6px; font-size: 12px; color: var(--muted); }
.side-panel {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--bg-2);
}
.side-panel h3 { margin: 0 0 10px; font-size: 14px; }

.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: 14px; padding: 28px;
  text-align: center; color: var(--muted); cursor: pointer;
  background: rgba(232, 168, 74, 0.03);
  transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover, .dropzone.over {
  border-color: var(--brand); background: var(--brand-soft); color: var(--ink);
}
.search-box { margin: 12px 0; }
.search-box input { padding-left: 14px; }

.file-input { display: none; }
.clip-mini { font-size: 12px; color: var(--muted); margin: 2px 0; }
.manifest-link { margin-left: 8px; }
.task-cover { margin: -12px -12px 0; }
.task-video { margin: 8px 0; }
.task-video video { display: block; }
.rev { margin-top: 8px; font-size: 13px; }
.rev summary { cursor: pointer; color: var(--brand-2); }
.rev-text {
  width: 100%; min-height: 54px; margin: 6px 0;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit;
  resize: vertical; background: var(--bg); color: var(--ink);
}
.prog.err { color: var(--err); }

.modal-mask {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 8, 12, 0.72); backdrop-filter: blur(8px);
  padding: 20px;
}
.modal-mask.hidden { display: none; }
.modal-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.modal-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
}
.modal-hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.modal-hint a { color: var(--brand-2); }
.modal-field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px; font-size: 13px; color: var(--muted);
}
.modal-field input, .modal-field select {
  font: inherit; font-size: 14px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

@media (max-width: 960px) {
  .sidebar { width: 220px; }
  .step .step__sub { display: none; }
  .player-wrap { grid-template-columns: 1fr; }
  .brand__tag { display: none; }
}
@media (max-width: 720px) {
  .layout { flex-direction: column; height: auto; min-height: calc(100vh - var(--topbar-h)); }
  .sidebar { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--line); }
  .stepper { flex-wrap: wrap; gap: 6px; }
  .step, .step:first-child, .step:last-child {
    flex: 1 1 40%; border-radius: 10px !important; border: 1px solid var(--line) !important;
  }
  .topbar__nav .btn span.hide-sm { display: none; }
}
