:root {
  --ink: #142128;
  --muted: #61717b;
  --line: #dbe4e8;
  --paper: #f4f7f8;
  --brand: #145a72;
  --brand-soft: #eaf3f6;
  --warn: #fff5e7;
  --risk: #fff0ed;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
.intake-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px;
}
.topbar, .workspace, .card, .review-rows, .row-grid, .record-actions, .image-intake {
  display: grid;
  gap: 12px;
}
.topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 16px;
}
.eyebrow { margin: 0; color: var(--brand); font-weight: 700; font-size: 12px; }
h1 { margin: 5px 0; font-size: 32px; }
h2, h3 { margin: 0; }
p { margin: 0; color: var(--muted); line-height: 1.45; }
.top-actions, .action-row, .record-head, .card-head, .pill-row {
  display: flex;
  gap: 8px;
}
.top-actions, .action-row { flex-wrap: wrap; }
.workspace { grid-template-columns: minmax(330px, 0.82fr) minmax(520px, 1.18fr); align-items: start; }
.input-panel { grid-row: span 2; }
.card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.card-head, .record-head { justify-content: space-between; align-items: start; }
.primary-btn, .ghost-btn, .mini-btn {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.primary-btn { border-color: var(--brand); background: var(--brand); color: #fff; }
.ghost-btn:hover, .mini-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.danger-btn { color: #a14534; border-color: #efc4bb; }
.input-meta, .row-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
input, select { min-height: 40px; padding: 0 10px; }
textarea {
  min-height: 260px;
  padding: 12px;
  resize: vertical;
  line-height: 1.55;
}
.image-intake {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}
.image-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}
.image-head h3 { font-size: 15px; }
.image-head span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}
.image-drop {
  min-height: 104px;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px dashed #98b6c1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}
.image-drop span { color: var(--muted); }
.image-drop input { display: none; }
.image-drop.is-dragging { border-color: var(--brand); background: var(--brand-soft); }
.image-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.image-tile {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.image-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.image-tile button {
  position: absolute;
  top: 5px;
  right: 5px;
  min-height: 28px;
  border: 1px solid #efc4bb;
  border-radius: 6px;
  background: rgba(255,255,255,.94);
  color: #a14534;
}
.image-tile span {
  display: block;
  overflow: hidden;
  padding: 6px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hint {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--muted);
  line-height: 1.45;
}
.record-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.record-card.is-risk { background: var(--risk); }
.record-card.is-watch { background: var(--warn); }
.row-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wide { grid-column: span 2; }
.record-actions { grid-template-columns: auto auto 1fr; align-items: center; }
.pill-row { flex-wrap: wrap; }
.pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}
.pill.sale { color: #155d74; background: #eaf3f6; }
.pill.purchase { color: #246746; background: #eef6f1; }
.pill.warn { color: #8c5a17; background: #fff5e7; }
.empty { color: var(--muted); }
.shared-panel {
  position: sticky;
  top: 12px;
  z-index: 2;
}
.shared-drafts {
  max-height: 300px;
  overflow: auto;
}
.compact-actions {
  align-items: center;
  justify-content: flex-end;
}
@media (max-width: 920px) {
  .workspace, .topbar { grid-template-columns: 1fr; }
  .input-panel { grid-row: auto; }
  .shared-panel { position: static; }
}
@media (max-width: 700px) {
  .intake-shell { padding: 14px; }
  h1 { font-size: 27px; }
  .row-grid, .input-meta { grid-template-columns: 1fr 1fr; }
  .image-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wide { grid-column: span 2; }
  .record-actions { grid-template-columns: 1fr; }
}
