:root {
  --bg: #f5f1e8;
  --surface: #fffaf0;
  --surface-strong: #ffffff;
  --ink: #20231f;
  --muted: #6a645a;
  --line: #ded4c2;
  --red: #b32923;
  --green: #1f6b45;
  --gold: #d8a43c;
  --blue: #2d5d76;
  --shadow: 0 20px 60px rgba(49, 38, 24, 0.12);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(179, 41, 35, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(31, 107, 69, 0.04) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
}

button,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #1f2923;
  color: #fffaf0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  border: 2px solid rgba(255, 250, 240, 0.35);
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255, 250, 240, 0.68);
}

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

.nav-item {
  border: 0;
  width: 100%;
  color: rgba(255, 250, 240, 0.72);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  color: #fff;
  background: rgba(255, 250, 240, 0.1);
}

.nav-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 250, 240, 0.18);
  font-size: 12px;
  color: #f3c765;
}

.pilot-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 250, 240, 0.16);
  background: rgba(255, 250, 240, 0.08);
}

.pilot-note span {
  display: block;
  color: #f3c765;
  font-size: 12px;
  margin-bottom: 8px;
}

.pilot-note strong {
  line-height: 1.55;
  font-size: 14px;
}

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

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15;
}

h2 {
  font-size: 22px;
}

.top-actions,
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 24px rgba(179, 41, 35, 0.22);
}

.secondary-button {
  background: #21352b;
  color: #fff;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  border-color: var(--line);
}

.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.wide {
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.panel,
.metric-card {
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid rgba(222, 212, 194, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

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

.status-pill,
.tag {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  background: #f0e3ca;
  color: #5b4b2d;
  white-space: nowrap;
}

.status-pill.success {
  color: #fff;
  background: var(--green);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
}

select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.65;
}

.upload-zone {
  margin: 16px 0;
  min-height: 112px;
  border: 1.5px dashed #c4b392;
  border-radius: 8px;
  background: #fff7e8;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  position: relative;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone strong,
.upload-zone span {
  display: block;
}

.upload-zone span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.upload-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  border-radius: 6px;
  font-size: 28px;
}

.clip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.clip-card {
  min-height: 104px;
  border-radius: 8px;
  padding: 10px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  background: var(--clip-bg);
}

.clip-card::after {
  content: "";
  position: absolute;
  width: 82px;
  height: 82px;
  right: -22px;
  bottom: -22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.clip-card strong,
.clip-card span {
  position: relative;
  z-index: 1;
}

.clip-card span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.template-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.template-button {
  min-height: 74px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  text-align: left;
}

.template-button.active {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}

.template-button strong,
.template-button span {
  display: block;
}

.template-button span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.phone-and-progress {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  align-items: center;
}

.phone-frame {
  width: min(100%, 292px);
  margin: auto;
  padding: 12px;
  border-radius: 28px;
  background: #1d1d1d;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.video-stage {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.08), rgba(0, 0, 0, 0.22)),
    radial-gradient(circle at 50% 28%, #fff2bd 0 16%, transparent 17%),
    linear-gradient(140deg, #9b241f, #d88b40 52%, #22392e);
}

.brand-bug {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  padding: 6px 8px;
  border-radius: 4px;
  color: #fff;
  background: rgba(31, 41, 35, 0.82);
  font-weight: 900;
  font-size: 13px;
}

.steam-layer span {
  position: absolute;
  bottom: 44%;
  width: 18px;
  height: 86px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  filter: blur(8px);
  animation: steam 2.8s infinite ease-in-out;
}

.steam-layer span:nth-child(1) {
  left: 34%;
}

.steam-layer span:nth-child(2) {
  left: 48%;
  animation-delay: 0.45s;
}

.steam-layer span:nth-child(3) {
  left: 62%;
  animation-delay: 0.9s;
}

.product-scene {
  position: absolute;
  inset: auto 0 18% 0;
  display: grid;
  place-items: center;
}

.basket {
  width: 72%;
  aspect-ratio: 1.9;
  border-radius: 50% / 36%;
  background: #c97838;
  border: 10px solid #7d3f20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: rotate(-2deg);
}

.basket span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff4df;
  border: 2px solid #ebd0a7;
  box-shadow: inset -8px -8px 0 rgba(219, 177, 112, 0.28);
}

.counter-line {
  width: 100%;
  height: 18px;
  background: rgba(31, 41, 35, 0.76);
}

.subtitle-card {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 58px;
  z-index: 4;
  color: #fff;
  text-align: center;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.35;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.52);
}

.phone-meta {
  height: 38px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  padding: 0 8px 3px;
}

.progress-box {
  display: grid;
  gap: 12px;
}

.progress-step {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  opacity: 0.58;
}

.progress-step.done,
.progress-step.active {
  opacity: 1;
}

.progress-step > span {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 4px solid #d8c6a5;
  margin-top: 2px;
}

.progress-step.active > span {
  border-color: var(--red);
}

.progress-step.done > span {
  border-color: var(--green);
  background: var(--green);
}

.progress-step strong,
.progress-step small {
  display: block;
}

.progress-step small {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 4px;
}

.copy-box {
  margin-top: 18px;
}

.copy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  padding: 18px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  font-size: 34px;
  margin: 10px 0;
}

.hq-layout,
.playbook-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
}

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

.table-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1fr 0.8fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.table-row.header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: transparent;
  border: 0;
}

.tag {
  display: inline-flex;
  justify-content: center;
}

.tag.green {
  background: #dceee3;
  color: #1f6b45;
}

.tag.amber {
  background: #f7e7c2;
  color: #7f5d1b;
}

.tag.red {
  background: #f4d9d5;
  color: #9a211c;
}

.config-list,
.requirement-list,
.shot-list {
  display: grid;
  gap: 10px;
}

.toggle-row {
  display: flex;
  grid-template-columns: auto 1fr;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  color: var(--ink);
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
}

.brand-swatches {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.brand-swatches span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--swatch);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.shot-item,
.requirement-list div {
  display: grid;
  grid-template-columns: 42px 0.7fr 1.6fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shot-item span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  font-weight: 900;
}

.shot-item small,
.requirement-list span {
  color: var(--muted);
  line-height: 1.45;
}

.requirement-list div {
  grid-template-columns: 0.8fr 1.7fr;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  background: #1f2923;
  color: #fff;
  border-radius: 6px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  transition: 0.2s ease;
}

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

@keyframes steam {
  0% {
    transform: translateY(24px) scale(0.8);
    opacity: 0;
  }
  35% {
    opacity: 0.75;
  }
  100% {
    transform: translateY(-74px) scale(1.2);
    opacity: 0;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-list {
    grid-template-columns: repeat(3, auto);
  }

  .pilot-note {
    margin-top: 0;
    flex: 1 1 260px;
  }

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

@media (max-width: 760px) {
  .main {
    padding: 18px;
  }

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

  .top-actions,
  .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-grid,
  .phone-and-progress,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .clip-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .table-row span:nth-child(3),
  .table-row span:nth-child(4) {
    grid-column: span 1;
  }

  .shot-item,
  .requirement-list div {
    grid-template-columns: 36px 1fr;
  }

  .shot-item small,
  .requirement-list span {
    grid-column: 2;
  }
}
