:root {
  color-scheme: light;
  --ink: #1b1d1f;
  --muted: #646b73;
  --paper: #f6f1e8;
  --surface: #fffaf1;
  --line: #d8d0c3;
  --charcoal: #101316;
  --cobalt: #1f57c8;
  --coral: #d95536;
  --leaf: #627a41;
  --gold: #b8892d;
  --shadow: 0 18px 50px rgba(16, 19, 22, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(16, 19, 22, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(16, 19, 22, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
  color: var(--ink);
  font-family:
    "Aptos",
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.site-shell {
  width: min(1680px, 100%);
  margin: 0 auto;
}

.hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(420px, 1.12fr);
  gap: 34px;
  align-items: center;
  padding: 34px clamp(18px, 4vw, 64px) 28px;
  border-bottom: 1px solid var(--line);
}

.hero__copy {
  max-width: 760px;
}

.brand {
  display: inline-flex;
  width: min(320px, 72vw);
  height: 86px;
  align-items: center;
  overflow: hidden;
}

.brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--leaf);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(42px, 7vw, 96px);
  line-height: 0.98;
  font-weight: 700;
  max-width: 820px;
}

.hero__intro {
  max-width: 620px;
  color: #3c4248;
  font-size: 18px;
  line-height: 1.7;
}

.hero__actions,
.drawer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: 1px solid var(--charcoal);
  border-radius: 6px;
  background: transparent;
  color: var(--charcoal);
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: var(--charcoal);
  color: #fffaf1;
}

.hero__media {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  grid-template-rows: 220px 170px 220px;
  gap: 14px;
  min-height: 640px;
}

.media-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--charcoal);
  border-radius: 8px;
  background: #dcd3c5;
  box-shadow: var(--shadow);
}

.media-tile::after {
  content: attr(data-label);
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 6px 8px;
  background: rgba(255, 250, 241, 0.9);
  color: var(--charcoal);
  font-size: 12px;
  font-weight: 800;
}

.media-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-tile--large {
  grid-row: span 2;
}

.media-tile--wide {
  grid-column: span 2;
}

.workspace {
  display: grid;
  grid-template-columns: 308px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding: 28px clamp(18px, 3vw, 40px) 54px;
}

.control-rail {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.88);
  padding: 16px;
}

.panel--tight {
  padding: 14px;
}

.panel--quiet {
  background: rgba(246, 241, 232, 0.72);
}

.panel__title {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 900;
}

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

.stat {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.stat strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
}

.field span,
.toggle-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(31, 87, 200, 0.12);
}

.toggle-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-row input {
  width: 16px;
  min-height: 16px;
}

.gallery-area {
  min-width: 0;
}

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

.toolbar h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 34px;
}

.result-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.case-grid {
  column-count: 4;
  column-gap: 14px;
}

.case-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  break-inside: avoid;
  box-shadow: 0 10px 24px rgba(16, 19, 22, 0.08);
}

.case-card__image {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #dfd7cb;
  overflow: hidden;
}

.case-card:nth-child(5n + 2) .case-card__image {
  aspect-ratio: 1 / 1;
}

.case-card:nth-child(7n + 3) .case-card__image {
  aspect-ratio: 5 / 6;
}

.case-card__image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 240ms ease;
}

.case-card:hover .case-card__image img {
  transform: scale(1.025);
}

.case-card__body {
  padding: 13px;
}

.case-card h3 {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.28;
}

.case-card__prompt {
  margin-bottom: 12px;
  color: #464b50;
  font-size: 13px;
  line-height: 1.5;
}

.case-card__meta,
.drawer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meta-pill {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
}

.case-card__actions {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--charcoal);
  border-radius: 6px;
  background: transparent;
  color: var(--charcoal);
  cursor: pointer;
}

.icon-button.is-active {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(31, 87, 200, 0.1);
  color: #16438f;
  font-size: 12px;
  font-weight: 800;
}

.chip:nth-child(3n + 2) {
  background: rgba(217, 85, 54, 0.12);
  color: #93361f;
}

.chip:nth-child(3n + 3) {
  background: rgba(98, 122, 65, 0.14);
  color: #45562d;
}

.load-more {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 1px solid var(--charcoal);
  border-radius: 8px;
  background: var(--surface);
  color: var(--charcoal);
  cursor: pointer;
  font-weight: 900;
}

.drawer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 20;
}

.drawer.is-open {
  display: block;
}

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 19, 22, 0.42);
}

.drawer__panel {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(820px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--charcoal);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.drawer__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(255, 250, 241, 0.92);
  font-size: 24px;
  line-height: 1;
}

.drawer__media {
  min-height: 100%;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #211f1c;
}

.drawer__media img {
  width: 100%;
  display: block;
  border-bottom: 1px solid rgba(255, 250, 241, 0.18);
}

.drawer__body {
  min-width: 0;
  overflow-y: auto;
  padding: 28px;
}

.drawer__body h2 {
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 30px;
  line-height: 1.08;
}

.prompt-box {
  max-height: 46vh;
  margin: 18px 0;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151719;
  color: #f7f1e6;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 12px);
  min-width: 180px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--charcoal);
  color: #fffaf1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  text-align: center;
  z-index: 30;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

  .hero__media {
    min-height: 520px;
  }

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

  .control-rail {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .case-grid {
    column-count: 3;
  }
}

@media (max-width: 820px) {
  h1 {
    font-size: 42px;
  }

  .hero {
    min-height: auto;
    padding-top: 22px;
  }

  .hero__media {
    grid-template-rows: 170px 140px 170px;
    min-height: 500px;
  }

  .control-rail {
    grid-template-columns: 1fr;
  }

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

  .case-grid {
    column-count: 2;
  }

  .drawer__panel {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .drawer__media {
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .hero__media {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-height: 420px;
  }

  .media-tile--large,
  .media-tile--wide {
    grid-column: span 2;
    grid-row: auto;
  }

  .case-grid {
    column-count: 1;
  }

  .drawer__panel {
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .drawer__body {
    padding: 20px;
  }
}
