:root {
  color-scheme: light;
  --ink: #172120;
  --muted: #687572;
  --line: #d7dfda;
  --paper: #f5f7f4;
  --surface: #ffffff;
  --surface-alt: #edf2ee;
  --green: #1d3b39;
  --coral: #d9755d;
  --gold: #d5a449;
  --focus: #376e67;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

button,
.file-control {
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(55, 110, 103, 0.28);
  outline-offset: 2px;
}

.app-shell {
  max-width: 1180px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 24px 56px;
}

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

.brand {
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.brand-kicker,
.eyebrow,
.detail-label {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.topnav,
.work-actions,
.branch-actions,
.render-actions,
.media-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-button,
.secondary-button,
.branch-button,
.mood-button,
.file-control {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
}

.nav-button.is-active,
.mood-button.is-selected,
.branch-button:hover,
.secondary-button:hover,
.file-control:hover {
  border-color: var(--green);
  background: var(--surface-alt);
}

.view {
  display: none;
  padding-top: 36px;
}

.view.is-active {
  display: block;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.75fr);
  gap: 24px;
  align-items: start;
}

.composer-panel,
.intent-panel,
.work-panel,
.processing-panel,
.share-actions,
.space-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.composer-panel,
.intent-panel,
.work-panel,
.processing-panel,
.share-actions {
  padding: 24px;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 8px 0 28px;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin: 5px 0 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.field-label {
  display: block;
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 13px;
  line-height: 1.55;
}

textarea::placeholder {
  color: #8a9691;
}

.field-block {
  margin-top: 22px;
}

.mood-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-row {
  min-height: 58px;
  margin: 22px 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.image-preview {
  display: block;
  width: 100%;
  max-height: 180px;
  margin-top: -10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.image-preview[hidden] {
  display: none;
}

.file-control {
  display: inline-flex;
  align-items: center;
}

.file-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-name {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-status.is-error,
.inline-error {
  color: #a52d25;
}

.primary-button {
  min-height: 46px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: #ffffff;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
}

.primary-button:hover {
  background: #28514e;
}

.composer-panel > .primary-button {
  width: 100%;
  margin-top: 12px;
}

.intent-panel {
  position: sticky;
  top: 20px;
  min-height: 255px;
}

.intent-summary {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  line-height: 1.55;
}

.intent-summary strong {
  font-size: 18px;
}

.intent-summary span {
  color: var(--muted);
  font-size: 14px;
}

.intent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.intent-tag {
  border: 1px solid #b9cbc5;
  border-radius: 6px;
  background: #eff5f1;
  color: var(--green);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
}

.processing-view {
  display: none;
  min-height: 56vh;
  place-items: center;
}

.processing-view.is-active {
  display: grid;
}

.processing-panel {
  width: min(100%, 460px);
}

.processing-panel p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.space-header,
.share-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.space-header h1,
.share-header h1 {
  margin: 6px 0 0;
}

.work-detail {
  min-width: 0;
}

.work-panel {
  display: grid;
  gap: 18px;
}

.work-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.work-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.artwork-canvas {
  position: relative;
  display: flex;
  align-items: end;
  min-height: 250px;
  border-radius: 6px;
  background: linear-gradient(122deg, var(--palette-one), var(--palette-two) 52%, var(--palette-three));
  overflow: hidden;
  padding: 18px;
  color: #ffffff;
}

.artwork-canvas.is-poster {
  min-height: 340px;
  max-width: 420px;
}

.artwork-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artwork-canvas span {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 5px;
  background: rgba(23, 33, 32, 0.2);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
}

.detail-block {
  display: grid;
  gap: 7px;
}

.detail-text {
  margin: 0;
  color: #394643;
  line-height: 1.65;
}

.branch-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.render-section,
.rendered-poster {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.render-actions {
  flex-wrap: wrap;
}

.render-actions .secondary-button {
  flex: 1 1 180px;
}

.branch-actions {
  flex-wrap: wrap;
}

.branch-button {
  flex: 1 1 150px;
}

.work-actions {
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

.space-item {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 16px;
  color: inherit;
  text-align: left;
}

.space-item:hover {
  border-color: var(--green);
}

.space-item span {
  color: var(--muted);
  font-size: 12px;
}

.share-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.35fr);
  gap: 24px;
  align-items: start;
}

.share-actions {
  display: grid;
  gap: 12px;
}

.share-link {
  color: var(--green);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0 16px 36px;
  }

  .topbar,
  .space-header,
  .share-header {
    align-items: start;
    flex-direction: column;
    justify-content: center;
    padding: 16px 0;
  }

  .topbar {
    min-height: 0;
  }

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

  .intent-panel {
    position: static;
  }

  .view {
    padding-top: 24px;
  }

  h1 {
    font-size: 27px;
  }

  .composer-panel,
  .intent-panel,
  .work-panel,
  .processing-panel,
  .share-actions {
    padding: 18px;
  }

  .space-list {
    grid-template-columns: 1fr;
  }

  .work-heading {
    align-items: start;
    flex-direction: column;
  }

  .work-time {
    flex: none;
  }

  .media-row {
    align-items: start;
    flex-direction: column;
  }
}
