:root {
  --bg: #07110f;
  --panel: rgba(12, 28, 24, 0.88);
  --line: rgba(255, 255, 255, 0.1);
  --teal: #1ec8a5;
  --amber: #f0b429;
  --fog: rgba(232, 244, 240, 0.9);
  --muted: rgba(180, 210, 200, 0.62);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color-scheme: dark;
  background:
    radial-gradient(ellipse 70% 40% at 20% -10%, rgba(30, 200, 165, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 35% at 90% 10%, rgba(240, 180, 41, 0.1), transparent 50%),
    linear-gradient(165deg, #061512, #0a1a16 45%, #07110f);
  color: var(--fog);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.top-nav {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(12px, var(--safe-top)) max(12px, env(safe-area-inset-right, 0px)) 12px max(12px, var(--safe-left));
  pointer-events: none;
}

.top-nav__back,
.top-nav__login {
  pointer-events: auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7, 20, 18, 0.75);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  backdrop-filter: blur(8px);
  cursor: pointer;
  white-space: nowrap;
}

.top-nav__login:hover {
  border-color: rgba(30, 200, 165, 0.45);
  color: var(--teal);
}

.hero {
  max-width: 920px;
  margin: 0 auto;
  padding: calc(72px + var(--safe-top)) 20px 12px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--teal);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 750;
  letter-spacing: 0.02em;
}

.hero-demo {
  margin: 14px 0 0;
  text-align: center;
}

.hero-demo__link {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.hero-demo__link:hover {
  color: #6ee7c8;
}

.lead {
  margin: 12px auto 0;
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.98rem;
}

.layout {
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 20px 64px;
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 16px;
  backdrop-filter: blur(10px);
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.panel-head h2 {
  margin: 0;
}

.panel-head__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.panel-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 80, 80, 0.22);
}

.badge {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(30, 200, 165, 0.35);
  color: var(--teal);
}

textarea,
input[type="text"],
input[type="number"],
select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--fog);
  font: inherit;
  resize: vertical;
  color-scheme: dark;
}

select option,
select optgroup {
  background-color: #0c1c18;
  color: #e8f4f0;
}

select option:checked,
select option:hover {
  background-color: #14352e;
  color: #fff;
}

textarea:focus,
input:focus,
select:focus {
  outline: 1px solid rgba(30, 200, 165, 0.45);
}

.grid-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.grid-opts .span-2 {
  grid-column: 1 / -1;
}

.voice-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.voice-row select {
  flex: 1;
  margin-top: 0;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 720px) {
  .grid-opts {
    grid-template-columns: 1fr;
  }

  .grid-opts .span-2 {
    grid-column: auto;
  }
}

label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--fog);
  font-size: 0.9rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #169e82, #1ec8a5);
  color: #04221c;
  font-weight: 650;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--fog);
}

.btn-sm {
  min-height: 34px;
  font-size: 0.82rem;
}

.hint,
.meta-row {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.meta-row.is-warn {
  color: #ffb08a;
}

.hint.is-error {
  color: #ff8f7a;
}

.hint.is-ok {
  color: var(--teal);
}

.shots {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.shot {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.shot__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.shot__top strong {
  color: var(--amber);
}

.shot textarea {
  min-height: 64px;
  font-size: 0.85rem;
}

.shot__narr-label,
.shot label {
  display: block;
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.shot__narr-input {
  min-height: 72px !important;
  margin-top: 4px;
  white-space: pre-wrap;
}

.shot__ops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.shot__ops .btn {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.shot__status {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.shot.is-done {
  border-color: rgba(30, 200, 165, 0.4);
}

.shot.is-fail {
  border-color: rgba(255, 107, 74, 0.45);
}

.shot.is-run {
  border-color: rgba(240, 180, 41, 0.5);
}

.progress {
  margin-top: 12px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transition: width 0.25s ease;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}

.card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0a1a16;
}

.card__body {
  padding: 10px 12px 12px;
}

.card__body h3 {
  margin: 0 0 6px;
  font-size: 0.88rem;
}

.card__body p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__body a {
  display: inline-block;
  margin-top: 8px;
  color: var(--teal);
  font-size: 0.8rem;
}

.btn-accent {
  background: linear-gradient(135deg, #c99212, #f0b429);
  color: #2a1a00;
  font-weight: 650;
}

#resultVideo {
  display: block;
  width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  background: #000;
  margin-top: 8px;
}

.shot__flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.72rem;
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.tag.is-on {
  border-color: rgba(30, 200, 165, 0.45);
  color: var(--teal);
}

.hint--tight {
  margin-top: 6px;
  font-size: 0.78rem;
}

.script-wrap {
  position: relative;
  height: 100%;
}

.script-wrap textarea {
  display: block;
  width: 100%;
  min-height: 320px;
  height: 100%;
  padding-bottom: 16px;
  resize: vertical;
}

.script-wrap textarea.has-polish-bar {
  padding-bottom: 72px;
}

.compose-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(200px, 0.7fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 4px;
}

.script-col {
  min-width: 0;
}

.media-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.media-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.media-col__head strong {
  font-size: 0.92rem;
}

.media-col__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-col__actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}

@media (max-width: 720px) {
  .compose-split {
    grid-template-columns: 1fr;
  }

  .script-wrap textarea {
    min-height: 240px;
  }
}

.polish-bar {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(7, 20, 18, 0.92);
  border: 1px solid rgba(30, 200, 165, 0.35);
  backdrop-filter: blur(8px);
}

.polish-bar[hidden] {
  display: none !important;
}

.polish-bar__hint {
  flex: 1;
  min-width: 140px;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.polish-bar__actions {
  display: flex;
  gap: 8px;
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal__card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 20px 18px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 28, 24, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.modal__card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--fog);
}

.modal__text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.advise {
  margin-top: 14px;
  margin-bottom: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(30, 200, 165, 0.28);
  background: linear-gradient(145deg, rgba(30, 200, 165, 0.1), rgba(0, 0, 0, 0.22));
}

.advise.is-loading {
  border-color: rgba(240, 180, 41, 0.4);
}

.advise.is-ready {
  border-color: rgba(30, 200, 165, 0.45);
}

.advise__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.advise__head strong {
  font-size: 0.88rem;
  color: var(--teal);
}

.advise__badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.advise.is-loading .advise__badge {
  border-color: rgba(240, 180, 41, 0.45);
  color: var(--amber);
}

.advise.is-ready .advise__badge {
  border-color: rgba(30, 200, 165, 0.45);
  color: var(--teal);
}

.advise__summary {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--fog);
}

.advise__tips {
  margin: 8px 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.advise__tips li + li {
  margin-top: 4px;
}

.stage {
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: var(--amber);
  font-weight: 600;
}

.notice {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(30, 200, 165, 0.35);
  background: rgba(30, 200, 165, 0.08);
  color: var(--fog);
  font-size: 0.82rem;
  line-height: 1.5;
}

.notice--warn {
  border-color: rgba(240, 180, 41, 0.45);
  background: rgba(240, 180, 41, 0.1);
  color: #ffe8a3;
}

.progress.is-busy .progress__bar {
  background-size: 200% 100%;
  animation: progress-shine 1.2s linear infinite;
}

@keyframes progress-shine {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.assets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding-right: 2px;
}

.assets:empty {
  display: none;
}

.asset {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  cursor: zoom-in;
}

.asset__media {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #0a1a16;
  pointer-events: none;
}

.asset__badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 1;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  line-height: 1.2;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.asset--video::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 0;
  height: 0;
  margin: -7px 0 0 -4px;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.asset__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.asset:hover .asset__remove,
.asset:focus-within .asset__remove {
  opacity: 1;
  pointer-events: auto;
}

.asset__remove:hover {
  background: rgba(180, 40, 30, 0.85);
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.lightbox__close {
  position: absolute;
  top: max(16px, var(--safe-top));
  right: max(16px, var(--safe-left));
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.lightbox__body {
  position: relative;
  z-index: 1;
  max-width: min(960px, 100%);
  max-height: min(88vh, 100%);
}

.lightbox__body img,
.lightbox__body video {
  display: block;
  max-width: 100%;
  max-height: min(88vh, 100%);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #000;
}

.lightbox__body video.demo-showcase-video {
  max-height: min(90vh, 100%);
  max-width: min(420px, 92vw);
  width: auto;
  height: auto;
}
