:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #eef5f3;
  --ink: #18211f;
  --muted: #66736f;
  --line: #dce3e0;
  --accent: #117865;
  --accent-dark: #0b594c;
  --warn: #a33b31;
  --shadow: 0 14px 42px rgba(24, 33, 31, 0.09);
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 22px;
}

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

.topbar-actions {
  display: flex;
  gap: 10px;
}

.brand-home {
  display: inline-flex;
  align-items: center;
}

.brand-block {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  width: 128px;
  height: 72px;
  max-width: 128px;
  max-height: 72px;
  display: block;
  object-fit: contain;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.05;
}

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

.panel {
  display: grid;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.section-block {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-block:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

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

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

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

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 120, 101, 0.14);
}

.plate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 142px;
  gap: 10px;
  align-items: end;
}

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

.wide {
  grid-column: 1 / -1;
}

.dropzone {
  min-height: 162px;
  place-items: center;
  border: 2px dashed #aab9b5;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.dropzone input {
  display: none;
}

.dropzone strong {
  display: block;
  color: var(--ink);
  font-size: 19px;
}

.dropzone small {
  max-width: 320px;
  line-height: 1.45;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: #e4f1ee;
}

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

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

.photo-item img {
  width: 100%;
  height: 122px;
  display: block;
  object-fit: cover;
}

.photo-item span {
  display: block;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.submit-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
}

.submit-status {
  min-height: 22px;
  margin: 0;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
}

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

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 10px 13px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

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

.primary-button.success,
.primary-button.success:hover {
  background: #12805f;
}

.secondary-button {
  background: #e9f4f1;
  border-color: #cce0db;
  color: var(--accent-dark);
}

.ghost-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.danger {
  color: var(--warn);
}

@media (max-width: 620px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    flex-direction: column;
  }

  .brand-block {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
  }

  .brand-logo {
    width: 96px;
    height: 54px;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .topbar button,
  .topbar a {
    width: 100%;
  }

  .plate-row,
  .field-grid,
  .submit-bar {
    grid-template-columns: 1fr;
  }
}
