:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17212f;
  --muted: #697586;
  --line: #dde3ec;
  --blue: #1f6feb;
  --green: #168a4a;
  --amber: #a86100;
  --red: #c73333;
  --soft-blue: #edf5ff;
  --soft-amber: #fff6e4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  width: min(1320px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

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

.header p,
.header h1,
.panel-head p,
.panel-head h2 {
  margin: 0;
}

.header p {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.header h1 {
  margin-top: 4px;
  font-size: 28px;
  letter-spacing: 0;
}

.panel {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.panel-head h2 {
  font-size: 18px;
}

.panel-head p,
label,
#status,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.fields {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(120px, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

input {
  height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 112px;
  resize: vertical;
  padding: 10px 11px;
}

.upload-grid,
.text-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.upload-card {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.upload-card input {
  height: auto;
  padding: 8px 0 0;
  border: 0;
}

.preview {
  display: grid;
  min-height: 120px;
  margin-top: 10px;
  place-items: center;
  border-radius: 8px;
  background: #eef1f6;
  color: var(--muted);
  overflow: hidden;
}

.preview img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.primary,
.secondary {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
}

.primary {
  border: 0;
  background: var(--blue);
  color: #fff;
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.result {
  display: grid;
  gap: 12px;
}

.empty {
  min-height: 90px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

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

.output-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 190px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.45;
}

.output-card.seedance {
  border-color: #edc878;
  background: var(--soft-amber);
}

.output-card h3,
.output-card p,
.output-card ul {
  margin: 0;
}

.output-card ul {
  padding-left: 18px;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef1f6;
  color: #405064;
  font-size: 12px;
  font-weight: 700;
}

.tag.good {
  background: #e7f6ee;
  color: var(--green);
}

.tag.warn {
  background: #fff3dc;
  color: var(--amber);
}

.candidate-list {
  display: grid;
  gap: 10px;
}

.candidate-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.7fr) minmax(180px, 0.7fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.candidate-card h3,
.candidate-card p {
  margin: 0;
}

.candidate-card h3 {
  font-size: 15px;
}

@media (max-width: 1100px) {
  .fields,
  .output-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .candidate-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100vw - 20px, 1320px);
    padding-top: 14px;
  }

  .header,
  .panel-head,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .fields,
  .upload-grid,
  .text-grid,
  .output-grid {
    grid-template-columns: 1fr;
  }
}
