:root {
  --paper: #f7f5ee;
  --surface: #ffffff;
  --surface-2: #f0eee6;
  --ink: #222a2e;
  --muted: #667075;
  --line: #d8d3c6;
  --blue: #2e6f9e;
  --teal: #2f6f73;
  --gold: #c8902f;
  --red: #b25a43;
  --green: #2f7d55;
  --shadow: 0 18px 40px rgba(39, 44, 48, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family:
    "Noto Sans SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  background: #ede9de;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #253137;
  background: #253137;
  color: #f8f4eb;
  font-family:
    "Space Mono",
    Consolas,
    monospace;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-lockup strong {
  display: block;
  font-size: 17px;
}

.brand-lockup span,
.eyebrow {
  color: var(--muted);
  font-family:
    "Space Mono",
    "Noto Sans SC",
    monospace;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.flow-nav {
  display: grid;
  gap: 8px;
}

.nav-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  min-height: 52px;
  padding: 8px;
  border: 1px solid transparent;
  color: var(--ink);
  text-decoration: none;
}

.nav-step span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: #ded8ca;
  color: var(--muted);
  font-family:
    "Space Mono",
    Consolas,
    monospace;
  font-size: 12px;
}

.nav-step strong {
  font-size: 15px;
  font-weight: 700;
}

.nav-step:hover,
.nav-step.active {
  border-color: #c4bca9;
  background: #f8f5ec;
}

.nav-step.active span {
  background: var(--teal);
  color: #ffffff;
}

.side-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  background: #f7f4eb;
}

.side-card h2,
.panel h2,
.topbar h1 {
  margin: 0;
  letter-spacing: 0;
}

.side-card h2 {
  font-size: 20px;
}

.side-card dl {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.side-card div {
  display: grid;
  gap: 2px;
}

.side-card dt {
  color: var(--muted);
  font-size: 12px;
}

.side-card dd {
  margin: 0;
  font-weight: 700;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.topbar h1 {
  font-size: 32px;
}

.topbar-actions,
.approval-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-btn,
.ghost-btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.primary-btn {
  background: var(--ink);
  color: #ffffff;
}

.primary-btn:hover {
  background: #11191d;
}

.ghost-btn {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.ghost-btn:hover {
  border-color: var(--ink);
}

.process-strip {
  display: grid;
  grid-template-columns: repeat(10, minmax(92px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.process-item {
  display: grid;
  align-items: center;
  grid-template-columns: 12px 1fr;
  gap: 6px;
  min-height: 44px;
  padding: 9px 8px;
  border: 1px solid var(--line);
  background: #efebe1;
  color: var(--muted);
}

.process-item span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b6afa1;
}

.process-item strong {
  font-size: 12px;
}

.process-item.done {
  background: #e7efe9;
  color: var(--green);
}

.process-item.done span {
  background: var(--green);
}

.process-item.active {
  border-color: var(--gold);
  background: #fff5df;
  color: #7a5317;
}

.process-item.active span {
  background: var(--gold);
}

.grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.main-column,
.right-column {
  display: grid;
  gap: 18px;
}

.right-column {
  position: sticky;
  top: 20px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-top: 2px;
  font-size: 22px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.radar-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.radar-meta span,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f3eb;
  color: var(--muted);
  font-size: 12px;
}

.status-pill.ready {
  border-color: #b7d2bd;
  background: #edf6ef;
  color: var(--green);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.metric-row article {
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #faf8f2;
}

.metric-row span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-row strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  line-height: 1;
}

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

.brief-card {
  display: grid;
  gap: 14px;
  min-height: 280px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.brief-card.selected {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 2px rgba(47, 111, 115, 0.14);
}

.brief-card h3 {
  margin: 0;
  font-size: 19px;
}

.brief-card p {
  margin: 0;
  color: #4e5b60;
}

.score-grid {
  display: grid;
  gap: 8px;
}

.score-item {
  display: grid;
  gap: 4px;
}

.score-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.score-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ded1;
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.brief-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e9edf0;
  color: #445057;
  font-size: 12px;
}

.selected-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.selected-summary div {
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8f5ee;
}

.selected-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.selected-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.script-table {
  display: grid;
  gap: 8px;
}

.script-row {
  display: grid;
  grid-template-columns: 84px 1fr 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fdfbf6;
}

.script-row strong {
  display: block;
  margin-bottom: 3px;
}

.script-row span {
  color: var(--muted);
  font-family:
    "Space Mono",
    Consolas,
    monospace;
  font-size: 12px;
}

.storyboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.storyboard-panel .story-media {
  aspect-ratio: 941 / 1672;
}

.storyboard-panel .story-real-image {
  object-fit: contain;
}

.story-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf9f4;
}

.story-media,
.asset-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ebe6db;
}

.story-real-image,
.asset-real-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-fallback,
.asset-fallback {
  display: none;
}

.story-media.missing-image .story-real-image,
.asset-media.missing-image .asset-real-image {
  display: none;
}

.story-media.missing-image .story-fallback,
.asset-media.missing-image .asset-fallback {
  display: block;
}

.story-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #ebe6db;
}

.story-content {
  padding: 12px;
}

.story-content h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.story-content p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.asset-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf9f4;
}

.asset-card > div:last-child {
  padding: 12px;
}

.asset-card strong {
  display: block;
  font-size: 14px;
}

.asset-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.render-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.material-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f5f1e8;
}

.material-video {
  display: block;
  width: 100%;
  max-height: 560px;
  background: #11191d;
}

.material-video-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fbfaf6;
}

.material-video-meta span {
  color: var(--muted);
  text-align: right;
}

.phone-preview {
  display: grid;
  place-items: center;
  min-height: 520px;
  border: 1px solid var(--line);
  background: #f5f1e8;
}

.phone-screen {
  position: relative;
  width: 220px;
  height: 392px;
  overflow: hidden;
  border: 10px solid #172024;
  border-radius: 26px;
  background: #101820;
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.25);
}

.video-scene {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 36%),
    linear-gradient(160deg, #39434a 0%, #1d2529 48%, #101820 100%);
}

.locker {
  position: absolute;
  bottom: 76px;
  width: 70px;
  height: 160px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  background: #5c6469;
}

.locker.left {
  left: 28px;
}

.locker.right {
  right: 26px;
  background: #66776e;
}

.locker::before {
  content: "";
  position: absolute;
  top: 54px;
  right: 9px;
  width: 8px;
  height: 30px;
  background: #d5c08d;
}

.locker.right::after {
  content: "";
  position: absolute;
  top: 6px;
  right: -34px;
  width: 32px;
  height: 148px;
  background: rgba(102, 119, 110, 0.78);
  transform: skewY(-12deg);
  transform-origin: left center;
}

.damper {
  position: absolute;
  left: 80px;
  bottom: 54px;
  width: 70px;
  height: 18px;
  border-radius: 999px;
  background: var(--gold);
}

.caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 22px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(8, 14, 18, 0.76);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
}

.render-queue {
  display: grid;
  gap: 12px;
}

.queue-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fbfaf6;
}

.queue-item > span {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
  background: #b9b0a1;
}

.queue-item.complete > span {
  background: var(--green);
}

.queue-item.active {
  border-color: var(--gold);
  background: #fff7e8;
}

.queue-item.active > span {
  background: var(--gold);
}

.queue-item p,
.credit-box p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.credit-box {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid #d5bc88;
  background: #fff4da;
}

.credit-box span {
  color: #7a5317;
  font-size: 13px;
}

.credit-box strong {
  font-size: 28px;
}

.product-panel h2,
.deliverable-panel h2 {
  font-size: 20px;
}

.product-visual {
  margin: 14px 0;
  border: 1px solid var(--line);
  background: #f7f3ea;
}

.product-visual svg,
.product-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.product-visual-photo {
  overflow: hidden;
  background: #0ca7dc;
}

.product-visual-photo img {
  aspect-ratio: 420 / 220;
  object-fit: cover;
}

.product-visual-photo strong {
  display: block;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  background: #fbfaf6;
  color: var(--ink);
  font-size: 16px;
}

.fact-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.fact-list li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #faf8f2;
  font-size: 13px;
}

.platform-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.tab {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f4ed;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tab.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.publish-card {
  display: grid;
  gap: 12px;
}

.copy-block {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fbfaf6;
}

.copy-block span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.copy-block strong,
.copy-block p {
  display: block;
  margin: 4px 0 0;
}

.copy-block p {
  color: #3d484d;
  font-size: 14px;
}

.download-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.download-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: #fbfaf6;
}

.download-list span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.final-output-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}

.final-output-grid h3 {
  margin: 4px 0 14px;
  font-size: 18px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid #b9d5bd;
  border-radius: 6px;
  background: #edf7ef;
  color: #245b3d;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    height: auto;
  }

  .flow-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .side-card {
    margin-top: 0;
  }

  .grid-layout {
    grid-template-columns: 1fr;
  }

  .right-column {
    position: static;
  }
}

@media (max-width: 860px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 26px;
  }

  .process-strip,
  .brief-list,
  .metric-row,
  .selected-summary,
  .storyboard-grid,
  .asset-gallery,
  .final-output-grid,
  .render-layout,
  .flow-nav {
    grid-template-columns: 1fr;
  }

  .script-row {
    grid-template-columns: 1fr;
  }

  .phone-preview {
    min-height: 430px;
  }
}

@media (max-width: 560px) {
  .side-nav {
    padding: 16px;
  }

  .workspace {
    padding: 14px;
  }

  .panel {
    padding: 16px;
  }

  .topbar-actions,
  .approval-actions,
  .platform-tabs {
    grid-template-columns: 1fr 1fr;
    display: grid;
  }

  .primary-btn,
  .ghost-btn {
    width: 100%;
  }
}
