:root {
  --bg: #f3f5f8;
  --card: #fff;
  --text: #1a1f2c;
  --muted: #6b7280;
  --primary: #1f6feb;
  --primary-dark: #1554b5;
  --line: #e5e7eb;
  --danger: #dc2626;
  --ok: #059669;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }
.view { min-height: 100vh; }
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  margin-bottom: 14px;
}
.login-card {
  max-width: 400px;
  margin: 12vh auto;
  padding: 24px;
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.muted { color: var(--muted); font-size: 13px; }
label {
  display: block;
  margin: 10px 0;
  font-size: 14px;
  font-weight: 600;
}
input, textarea, select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.check input { width: auto; margin: 0; }
.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  cursor: pointer;
}
.btn.primary { background: var(--primary); color: #fff; width: 100%; margin-top: 8px; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.small { width: auto; padding: 6px 10px; font-size: 13px; }
.error { color: var(--danger); min-height: 20px; }
.msg { min-height: 20px; font-size: 14px; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-actions { display: flex; gap: 4px; align-items: center; }
.tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  overflow-x: auto;
}
.tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
}
.tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.panel { padding: 0 12px 24px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; margin-top: 0; }
.row .btn { width: auto; margin-top: 0; }
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.yard-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  font-weight: 600;
}
.hint { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.auto-time {
  background: #eef6ff;
  border: 1px solid #cfe3ff;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}
.group {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}
.group-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.checks, .radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.checks .check, .radio-row .check { margin: 0; font-weight: 500; }
.upload-block {
  margin: 12px 0;
  padding: 12px;
  border: 1px dashed #c5d0e0;
  border-radius: 12px;
  background: #f8fbff;
}
.upload-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
}
.upload-count { color: var(--muted); font-size: 12px; }
.upload-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.upload-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}
.upload-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.upload-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  cursor: pointer;
  padding: 0;
}
.upload-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--primary);
  border-radius: 10px;
  color: var(--primary);
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-sizing: border-box;
}
.upload-add:active { background: #eef6ff; }
.upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}
.upload-tip {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  background: #fafafa;
}
.item h3 { margin: 0 0 6px; font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
}
.tag.warn { background: #fef3c7; color: #92400e; }
.tag.ok { background: #d1fae5; color: #065f46; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 12px;
}
.modal-card {
  background: #fff;
  width: min(640px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 16px 16px 12px 12px;
  padding: 16px;
  position: relative;
}
.modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 8px; font-size: 14px; }
.kv b { color: var(--muted); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 768px) {
  .modal { align-items: center; }
  .modal-card { border-radius: 16px; }
}
