/*
 * Yanmai Digital Human Studio v6
 * Editorial dark production workspace selected in the July 2026 design review.
 */

:root {
  --v6-bg: #0b0d10;
  --v6-bg-deep: #07090c;
  --v6-surface: #12161b;
  --v6-surface-raised: #171c22;
  --v6-surface-soft: #0e1217;
  --v6-line: #2a3038;
  --v6-line-soft: #1d232b;
  --v6-text: #f2f5f7;
  --v6-text-soft: #bec6d0;
  --v6-muted: #7f8997;
  --v6-teal: #25cbb3;
  --v6-blue: #5b8cff;
  --v6-coral: #e07b67;
  --v6-amber: #d9b45b;
  --v6-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, serif;
}

html {
  background: var(--v6-bg);
}

body {
  background:
    linear-gradient(rgba(91, 140, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 140, 255, 0.032) 1px, transparent 1px),
    radial-gradient(circle at 86% 4%, rgba(37, 203, 179, 0.075), transparent 24%),
    var(--v6-bg);
  background-size: 40px 40px, 40px 40px, auto, auto;
}

body::after {
  position: fixed;
  z-index: 10000;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--v6-teal), var(--v6-blue) 56%, var(--v6-coral));
  content: "";
}

.shell {
  grid-template-columns: 220px minmax(0, 1fr);
  background: transparent;
}

.sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 24px 18px 22px;
  border-right-color: var(--v6-line-soft);
  background:
    linear-gradient(160deg, rgba(37, 203, 179, 0.07), transparent 40%),
    var(--v6-bg-deep);
}

.brand {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  padding: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  padding: 2px;
  border-color: #2a4248;
  background: #080d10;
}

.brand strong {
  font-family: var(--v6-display);
  font-size: 17px;
  font-weight: 800;
}

.brand small {
  margin-top: 3px;
  color: #687381;
  font-size: 9px;
}

.sidebar-product {
  display: grid;
  gap: 6px;
  margin: 42px 8px 23px;
}

.sidebar-product strong {
  color: #ffffff;
  font-family: var(--v6-display);
  font-size: 25px;
  line-height: 1;
}

.sidebar-product span {
  color: #6f7987;
  font-size: 10px;
}

.nav-list {
  gap: 5px;
  align-self: start;
}

.nav-item {
  min-height: 44px;
  gap: 11px;
  padding: 0 12px;
  color: #7f8997;
  font-size: 12px;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  padding: 2px;
  border: 1px solid currentColor;
  border-radius: 5px;
}

.nav-item.active {
  border-color: transparent;
  background: #171d24;
  box-shadow: inset 2px 0 0 var(--v6-teal);
}

.profile-center {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--v6-line-soft);
}

.profile-button {
  min-height: 50px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
}

.profile-button:hover,
.profile-button[aria-expanded="true"] {
  border-color: transparent;
  background: #121820;
}

.profile-avatar {
  color: #061714;
  background: var(--v6-teal);
}

.profile-menu {
  left: 232px;
  border-color: var(--v6-line);
  background: #151a20;
}

.main {
  padding: 0 clamp(22px, 2.5vw, 36px) 42px;
}

.page.page-active {
  width: min(1600px, 100%);
}

.eyebrow {
  color: var(--v6-teal);
  font-size: 10px;
}

.panel-head h2,
.preview-copy h2,
.result-panel h3,
.studio-plan-header h1,
.script-production-console h2,
.creation-brief h2,
.daily-opportunities h2 {
  font-family: var(--v6-display);
}

.primary-btn {
  border-color: var(--v6-teal);
  color: #061714;
  background: var(--v6-teal);
}

.primary-btn:hover {
  border-color: #4ddac5;
  background: #4ddac5;
}

.ghost-btn,
.panel .ghost-btn,
.creator-panel .ghost-btn,
.preview-panel .ghost-btn,
.result-panel .ghost-btn {
  border-color: var(--v6-line);
  background: #14191f;
}

input,
select,
textarea {
  border-color: #303741;
  color: var(--v6-text);
  background: #0d1116;
}

input::placeholder,
textarea::placeholder {
  color: #5f6874;
}

/* Home studio */

.home-page {
  gap: 0;
}

.studio-topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--v6-line);
}

.studio-workspace-name {
  display: flex;
  align-items: center;
  gap: 14px;
}

.studio-workspace-name span {
  color: #6f7987;
  font-size: 9px;
  font-weight: 800;
}

.studio-workspace-name strong {
  color: #edf1f5;
  font-size: 13px;
}

.studio-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio-top-actions time {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--v6-line);
  border-radius: 8px;
  color: #9aa5b3;
  background: rgba(19, 24, 30, 0.76);
  font-size: 10px;
}

.studio-top-actions .icon-btn {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.studio-plan-header {
  min-height: 138px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.58fr);
  gap: 32px;
  align-items: end;
  padding: 27px 0 24px;
}

.studio-plan-header h1 {
  margin: 5px 0 5px;
  color: #ffffff;
  font-size: clamp(34px, 3.2vw, 50px);
  line-height: 1;
  font-weight: 800;
}

.studio-plan-header > div > p:last-child {
  margin: 0;
  color: #8c96a4;
  font-size: 12px;
}

.production-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-self: end;
}

.production-stages button {
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 8px 10px;
  border: 0;
  border-top: 2px solid #2b3139;
  color: #687280;
  background: transparent;
  text-align: left;
}

.production-stages button:hover {
  color: #c8cfd7;
  background: rgba(255, 255, 255, 0.02);
}

.production-stages button.done {
  color: var(--v6-blue);
  border-top-color: var(--v6-blue);
}

.production-stages button.current {
  color: var(--v6-teal);
  border-top-color: var(--v6-teal);
}

.production-stages span {
  font-size: 9px;
}

.production-stages strong {
  font-size: 11px;
}

.studio-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.46fr);
  gap: 18px;
}

.production-canvas,
.creation-brief,
.daily-opportunities {
  border: 1px solid var(--v6-line);
  border-radius: 0;
  background: rgba(18, 22, 27, 0.95);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.production-canvas {
  min-width: 0;
  min-height: 566px;
  display: grid;
  grid-template-columns: minmax(290px, 0.9fr) minmax(360px, 1.1fr);
  overflow: hidden;
}

.portrait-production-preview {
  position: relative;
  min-width: 0;
  min-height: 566px;
  margin: 0;
  overflow: hidden;
  background: #0b0e12;
}

.portrait-production-preview::after {
  position: absolute;
  inset: 48% 0 0;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(5, 7, 9, 0.88));
  content: "";
}

.portrait-production-preview > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 56% center;
}

.preview-badge {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 16px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f6f8fa;
  background: rgba(7, 9, 12, 0.76);
  backdrop-filter: blur(10px);
  font-size: 10px;
  font-weight: 760;
}

.preview-badge svg {
  width: 14px;
  height: 14px;
  color: var(--v6-teal);
}

.portrait-production-preview figcaption {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 55px;
  left: 20px;
  color: #ffffff;
  font-size: clamp(17px, 1.55vw, 23px);
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.86);
}

.preview-controls {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 20px;
  left: 20px;
  display: grid;
  grid-template-columns: 14px auto minmax(70px, 1fr) auto;
  gap: 9px;
  align-items: center;
  color: #e9eef3;
  font-size: 9px;
  font-weight: 700;
}

.preview-controls > svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.preview-progress {
  height: 2px;
  display: block;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
}

.preview-progress i {
  width: 38%;
  height: 100%;
  display: block;
  background: var(--v6-teal);
}

.script-production-console {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 28px 26px 22px;
  background:
    linear-gradient(150deg, rgba(91, 140, 255, 0.05), transparent 48%),
    #12161b;
}

.script-production-console > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--v6-line);
}

.script-production-console h2 {
  margin: 4px 0 4px;
  color: #ffffff;
  font-size: 26px;
  line-height: 1.2;
}

.script-production-console header p:last-child {
  margin: 0;
  color: #7f8997;
  font-size: 10px;
}

.script-score {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  color: #65ddc9;
  background: rgba(37, 203, 179, 0.11);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.script-timeline {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 24px 0;
}

.script-timeline > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
}

.script-timeline span {
  padding-top: 2px;
  color: #687382;
  font-size: 9px;
}

.script-timeline p {
  margin: 0;
  color: #bec6d0;
  font-size: 12px;
  line-height: 1.75;
}

.script-timeline .active p {
  color: #75a0ff;
  font-weight: 720;
}

.script-wave {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.script-wave i {
  width: 3px;
  height: 9px;
  display: block;
  border-radius: 2px;
  background: var(--v6-teal);
  animation: v6-wave 1.8s ease-in-out infinite;
  transform-origin: center;
}

.script-wave i:nth-child(3n) { height: 21px; animation-delay: -0.4s; }
.script-wave i:nth-child(4n) { height: 28px; animation-delay: -0.8s; }
.script-wave i:nth-child(5n) { height: 15px; animation-delay: -1.1s; }

.creation-brief {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 27px 22px 20px;
  background:
    linear-gradient(155deg, rgba(37, 203, 179, 0.07), transparent 44%),
    rgba(18, 22, 27, 0.97);
}

.creation-brief h2 {
  margin: 5px 0 7px;
  color: #ffffff;
  font-size: 27px;
  line-height: 1.2;
}

.creation-brief > div:first-child > p:last-child {
  margin: 0;
  color: #87919f;
  font-size: 11px;
  line-height: 1.65;
}

.brief-command {
  display: grid;
  gap: 8px;
}

.brief-command > span {
  color: #909aa7;
  font-size: 10px;
}

.brief-command > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  border: 1px solid #303741;
  background: #0d1116;
}

.brief-command input {
  min-width: 0;
  min-height: 50px;
  padding: 0 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}

.brief-command button {
  width: 42px;
  min-height: 42px;
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid #303741;
  color: var(--v6-teal);
  background: transparent;
}

.brief-command button:hover {
  color: #ffffff;
  background: rgba(37, 203, 179, 0.1);
}

.brief-command svg {
  width: 18px;
  height: 18px;
}

.brief-fields {
  display: grid;
  gap: 0;
  margin: 0;
}

.brief-fields > div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--v6-line-soft);
}

.brief-fields dt {
  color: #7f8997;
  font-size: 10px;
}

.brief-fields dd {
  margin: 0;
  color: #d7dde5;
  font-size: 11px;
  line-height: 1.5;
}

.brief-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.brief-specs span {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #303741;
  border-radius: 999px;
  color: #b9c2cd;
  background: #0d1116;
  font-size: 9px;
}

.brief-specs span:first-child {
  color: #6ae1cb;
  border-color: rgba(37, 203, 179, 0.55);
  background: rgba(37, 203, 179, 0.09);
}

.brief-primary {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  margin-top: 2px;
  border-radius: 6px;
}

.brief-usage {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #707b89;
  font-size: 9px;
}

.brief-usage b {
  color: #aab3be;
  font-weight: 700;
}

.daily-opportunities {
  margin-top: 18px;
  padding: 0 20px;
}

.daily-opportunities header {
  min-height: 51px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.daily-opportunities h2 {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
}

.daily-opportunities > button {
  width: 100%;
  min-height: 47px;
  display: grid;
  grid-template-columns: 50px minmax(240px, 1.4fr) minmax(170px, 0.85fr) auto;
  gap: 14px;
  align-items: center;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--v6-line);
  color: #dce2e9;
  background: transparent;
  text-align: left;
}

.daily-opportunities > button:hover {
  background: rgba(255, 255, 255, 0.018);
}

.daily-opportunities > button > span {
  color: #75a0ff;
  font-size: 10px;
}

.daily-opportunities > button strong {
  font-size: 11px;
}

.daily-opportunities > button small {
  color: #7f8997;
  font-size: 10px;
}

.daily-opportunities > button em {
  color: var(--v6-teal);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.studio-telemetry {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  padding: 11px 2px 0;
  color: #697480;
  font-size: 9px;
}

.studio-telemetry strong {
  margin-left: 5px;
  color: #9ca6b2;
}

/* Functional workspaces keep their existing DOM and API bindings. */

.workspace,
.split {
  padding-top: 28px;
}

.workspace,
.split,
#trends {
  grid-template-columns: minmax(430px, 0.82fr) minmax(520px, 1.18fr);
  gap: 18px;
}

.panel,
.creator-panel,
.preview-panel,
.result-panel {
  border-color: var(--v6-line);
  border-radius: 0;
  background:
    linear-gradient(145deg, rgba(91, 140, 255, 0.026), transparent 35%),
    rgba(18, 22, 27, 0.97);
}

.panel-head {
  padding-bottom: 17px;
  border-bottom: 1px solid var(--v6-line-soft);
}

.panel-head h2,
.preview-copy h2,
.result-panel h3 {
  font-size: 27px;
}

.process-line {
  border-bottom-color: var(--v6-line);
}

.process-line span.active {
  color: var(--v6-teal);
  border-bottom-color: var(--v6-teal);
}

.segmented,
.source-tabs {
  border-color: var(--v6-line);
  background: #0d1116;
}

.segment.active,
.source-tab.active,
.chip-btn.active {
  border-color: var(--v6-teal);
  color: #061714;
  background: var(--v6-teal);
}

.preview-panel,
.result-panel {
  top: 18px;
  max-height: calc(100vh - 36px);
}

#trends > .panel,
#trendResult {
  top: 18px;
  max-height: calc(100vh - 36px);
}

.trend-idle-state,
.trend-signal-board,
.trend-next-panel,
.inline-result,
.manual-trend-details,
.upload-zone,
.mini-upload,
.selected-source,
.audio-source-card {
  border-radius: 0;
}

.phone-frame,
.demo-gallery button,
.visual-preset-showcase figure,
#imageResult img,
.visual-result img {
  border-radius: 0;
}

.job-card,
.account-card {
  border-radius: 0;
}

@keyframes v6-wave {
  0%,
  100% { transform: scaleY(0.72); opacity: 0.62; }
  50% { transform: scaleY(1.12); opacity: 1; }
}

@media (max-width: 1240px) {
  .shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 10px;
  }

  .sidebar-product {
    margin: 28px 0 20px;
    text-align: center;
  }

  .sidebar-product strong {
    font-size: 15px;
  }

  .sidebar-product span {
    display: none;
  }

  .nav-item span {
    display: block;
  }

  .profile-menu {
    left: 94px;
  }

  .studio-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.45fr);
  }

  .production-canvas {
    grid-template-columns: minmax(250px, 0.82fr) minmax(330px, 1.18fr);
  }
}

@media (max-width: 1040px) {
  .studio-plan-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .studio-workbench {
    grid-template-columns: 1fr;
  }

  .creation-brief {
    grid-template-columns: minmax(220px, 0.75fr) minmax(320px, 1.25fr);
    align-items: start;
  }

  .creation-brief > div:first-child,
  .creation-brief .brief-command {
    grid-column: 1 / -1;
  }

  .brief-primary,
  .brief-usage {
    align-self: end;
  }

  .workspace,
  .split,
  #trends {
    grid-template-columns: 1fr;
  }

  .preview-panel,
  .result-panel,
  #trends > .panel,
  #trendResult {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(rgba(91, 140, 255, 0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(91, 140, 255, 0.025) 1px, transparent 1px),
      var(--v6-bg);
    background-size: 32px 32px;
  }

  .sidebar {
    display: block;
    grid-template-rows: none;
  }

  .sidebar-product {
    display: none;
  }

  .nav-list {
    width: 100%;
    height: 70px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
  }

  .nav-item {
    min-width: 0;
    min-height: 70px;
    display: grid;
    place-items: center;
    gap: 3px;
    padding: 8px 2px 6px;
    border: 0;
    border-radius: 0;
    font-size: 9px;
    text-align: center;
    grid-template-rows: 22px 13px;
    align-content: center;
  }

  .nav-item svg {
    width: 20px;
    height: 20px;
    padding: 2px;
  }

  .nav-item.active {
    border: 0;
    background: #171d24;
    box-shadow: inset 0 3px 0 var(--v6-teal);
  }

  .profile-center {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .main {
    padding: 68px 14px 28px;
  }

  .studio-topbar {
    min-height: 58px;
  }

  .studio-workspace-name {
    display: grid;
    gap: 3px;
  }

  .studio-top-actions time {
    display: none;
  }

  .studio-plan-header {
    min-height: 0;
    gap: 20px;
    padding: 24px 0 18px;
  }

  .studio-plan-header h1 {
    font-size: 34px;
  }

  .production-stages {
    overflow-x: auto;
  }

  .production-stages button {
    min-width: 88px;
  }

  .production-canvas {
    grid-template-columns: 1fr;
  }

  .portrait-production-preview {
    min-height: 0;
    height: 420px;
    aspect-ratio: auto;
  }

  .portrait-production-preview > img {
    object-position: 58% 37%;
  }

  .script-production-console {
    min-height: 420px;
  }

  .creation-brief {
    grid-template-columns: 1fr;
  }

  .creation-brief > div:first-child,
  .creation-brief .brief-command {
    grid-column: auto;
  }

  .daily-opportunities {
    padding-inline: 14px;
  }

  .daily-opportunities > button {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 11px 0;
  }

  .daily-opportunities > button small {
    grid-column: 2 / -1;
  }

  .studio-telemetry {
    justify-content: flex-start;
  }

  .workspace,
  .split {
    padding-top: 16px;
  }

  .panel,
  .creator-panel,
  .preview-panel,
  .result-panel {
    padding: 18px;
  }
}

@media (max-width: 430px) {
  .studio-workspace-name strong {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .production-stages button {
    min-width: 78px;
  }

  .portrait-production-preview {
    height: 390px;
  }

  .script-production-console {
    padding: 22px 18px;
  }

  .script-production-console > header {
    display: grid;
  }

  .brief-usage,
  .studio-telemetry {
    display: grid;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .script-wave i {
    animation: none;
  }
}
