:root {
  color-scheme: dark;
  --bg: #0b0f16;
  --panel: #131a25;
  --line: #263142;
  --text: #e8edf4;
  --muted: #9fb0c7;
  --primary: #3fb1ff;
  --primary-hover: #63c0ff;
  --danger: #ff6f6f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    "PingFang SC", "Noto Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.page {
  width: min(1200px, 94vw);
  margin: 32px auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}

h1,
h2 {
  margin: 0 0 10px;
  line-height: 1.2;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.subtitle {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.form {
  display: grid;
  gap: 14px;
}

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

.field {
  display: grid;
  gap: 8px;
}

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

textarea,
select,
input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #0f1520;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

textarea {
  resize: vertical;
  min-height: 110px;
}

button {
  border: none;
  border-radius: 8px;
  height: 42px;
  padding: 0 16px;
  background: var(--primary);
  color: #051523;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--primary-hover);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.status {
  min-height: 20px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.preview-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.preview-wrap {
  border: 1px dashed var(--line);
  border-radius: 8px;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0d131c;
}

#preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 106px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  background: #192434;
}

.download:hover {
  border-color: var(--primary);
}

.download.disabled {
  pointer-events: none;
  opacity: 0.55;
}

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

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

  .preview-wrap {
    min-height: 280px;
  }
}
