:root {
  --bg: #f7f3e8;
  --ink: #1e2a32;
  --card: #fffdfa;
  --accent: #0b7285;
  --border: #d9d2c3;
  --disabled-bg: #f0f0f0;
  --disabled-ink: #767676;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Serif SC", "Source Han Serif SC", "PingFang SC", serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, #fff7dd 0%, var(--bg) 45%, #efe7d6 100%);
}

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

.hero h1 {
  margin: 0 0 4px;
  font-size: 34px;
}

.hero p {
  margin: 0 0 16px;
  color: #4c5960;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.preview-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

#renderPreview {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8f3e7;
  width: 640px;
  max-width: 100%;
  height: auto;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 13px;
  color: #49545a;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: #fff;
}

.pill.ok {
  border-color: #8cc3ad;
  background: #eaf7ef;
}

.pill.bad {
  border-color: #d8b5b5;
  background: #fbefef;
}

.scene-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.scene-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.scene-card h3 {
  margin: 0;
  font-size: 18px;
}

.scene-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 8px;
}

.scene-meta {
  font-size: 12px;
  color: #5b666d;
  margin-bottom: 8px;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.ok {
  background: #eaf7ef;
  color: #1d5133;
}

.badge.bad {
  background: #f5eaea;
  color: #793333;
}

.missing-box {
  border: 1px dashed #c59a9a;
  background: #fff4f4;
  color: #7b4141;
  font-size: 12px;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.scene-card.is-disabled {
  background: var(--disabled-bg);
  color: var(--disabled-ink);
  filter: grayscale(1);
  opacity: 0.82;
}

.scene-card.is-disabled input,
.scene-card.is-disabled textarea,
.scene-card.is-disabled select {
  background: #f5f5f5;
  color: #707070;
}

.ppt-editor {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}

.ppt-preview-pane {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  overflow: auto;
}

.ppt-stage {
  position: relative;
  border: 1px dashed #d0c7b6;
  border-radius: 8px;
}

.ppt-node {
  position: absolute;
  border: 1px dashed rgba(36, 64, 76, 0.35);
  cursor: move;
  overflow: hidden;
  user-select: none;
  background: rgba(255, 255, 255, 0.55);
  padding: 2px 4px;
}

.ppt-node.active {
  border-color: #0b7285;
  box-shadow: 0 0 0 1px #0b7285 inset;
}

.ppt-stage img.ppt-node {
  object-fit: contain;
}

.ppt-inspector {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  min-width: 260px;
}

@media (max-width: 680px) {
  .scene-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .ppt-editor {
    grid-template-columns: 1fr;
  }

  #renderPreview {
    width: 100%;
  }
}
