:root {
  color-scheme: dark;
  --bg: #101116;
  --panel: #191c22;
  --panel-2: #222730;
  --text: #f2f4f1;
  --muted: #aeb7b0;
  --line: #343b44;
  --accent: #e5b95c;
  --ok: #2fc789;
  --bad: #f0a44b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1520px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 22px;
  background: rgba(16, 17, 22, .94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

p {
  margin: 8px 0 0;
  color: var(--muted);
}

.controls {
  display: flex;
  align-items: end;
  gap: 12px;
}

.controls label {
  display: grid;
  gap: 7px;
}

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

.controls input,
.controls select {
  height: 42px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.controls button,
.card-actions a {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #17120b;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.summary:empty {
  display: none;
}

.summary-item {
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.summary-item strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

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

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

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.preview-head h2 {
  margin: 0;
  font-size: 18px;
}

.preview-head p {
  margin-top: 4px;
  font-size: 13px;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.card-actions a {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.image-frame {
  position: relative;
  min-height: 380px;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    linear-gradient(45deg, rgba(255,255,255,.04) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.04) 75%),
    linear-gradient(45deg, rgba(255,255,255,.04) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.04) 75%);
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
}

.image-frame img {
  width: min(100%, 520px);
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(0,0,0,.34);
}

.image-frame .loading {
  color: var(--muted);
}

.warning {
  border-color: rgba(240,164,75,.5);
  color: #ffe0ae;
}

@media (max-width: 980px) {
  .toolbar,
  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  .summary,
  .gallery {
    grid-template-columns: 1fr;
  }

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