:root {
  --ink: #20242b;
  --muted: #667085;
  --line: #d9e2ee;
  --panel: #ffffff;
  --wash: #f4f8fb;
  --blue: #4a91d9;
  --pink: #ed7faa;
  --gold: #d5a43b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #fff;
  border-right: 1px solid var(--line);
  overflow: auto;
}

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

.brand-logo {
  display: block;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  object-fit: cover;
  object-position: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

h1 {
  font-size: 18px;
}

.brand p,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented button,
.icon-button,
.detail-actions button,
.primary {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
}

.segmented button.active,
.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.workspace {
  padding: 24px;
}

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

.toolbar h2 {
  font-size: 28px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-button {
  width: 42px;
  font-size: 18px;
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat strong {
  display: block;
  font-size: 22px;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.load-more {
  display: block;
  width: min(280px, 100%);
  min-height: 44px;
  margin: 22px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.load-more[hidden] {
  display: none;
}

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

.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #eef4f8;
}

.card-body {
  padding: 12px;
}

.card h3 {
  font-size: 15px;
  line-height: 1.35;
  margin-bottom: 8px;
}

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

.tag {
  padding: 4px 7px;
  border-radius: 8px;
  color: var(--muted);
  background: #eef4f8;
  font-size: 12px;
}

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

.metrics {
  color: var(--muted);
  font-size: 12px;
}

dialog {
  width: min(1060px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
}

dialog::backdrop {
  background: rgb(19 28 38 / 0.55);
}

.dialog-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 620px) 1fr;
  gap: 0;
  margin: 0;
  background: #fff;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

#detailImage {
  width: 100%;
  max-height: 88vh;
  object-fit: contain;
  background: #eef4f8;
}

.detail-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 28px;
}

.detail-panel h3 {
  font-size: 24px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.metric-row strong {
  color: var(--ink);
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.detail-actions a,
.detail-actions button {
  display: grid;
  place-items: center;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .stat {
    padding: 10px 8px;
  }

  .stat strong {
    font-size: 18px;
  }

  .stat span {
    font-size: 11px;
  }

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

  .dialog-shell {
    grid-template-columns: 1fr;
  }
}
