:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --primary: #2f7cf6;
  --primary-d: #1f63d0;
  --text: #1a1a1a;
  --sub: #8a9099;
  --line: #e9ecf1;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
}
.topbar {
  position: sticky; top: 0; z-index: 10; height: 50px;
  background: var(--primary); color: #fff; display: flex;
  align-items: center; justify-content: space-between; padding: 0 14px;
}
.logo { font-weight: 600; font-size: 17px; }
.user { font-size: 13px; background: rgba(255,255,255,.2); padding: 3px 10px; border-radius: 12px; }
.devbar { background: #fff7e6; border-bottom: 1px solid #ffe4b5; padding: 8px 14px; font-size: 13px; color: #92500d; }
.devbar select { margin-left: 8px; }
.tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--line); }
.tab { flex: 1; border: none; background: none; padding: 13px 0; font-size: 14px; color: var(--sub); border-bottom: 2px solid transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
main { padding: 14px; max-width: 720px; margin: 0 auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.muted { color: var(--sub); font-size: 12px; }
.row-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.row-line:first-child { border-top: none; }

.btn { border: none; padding: 9px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.ghost { background: #eef1f6; color: var(--text); }
.btn.block { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .5; }

label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; font-size: 12px; color: var(--sub); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; background: #fff; color: var(--text);
}
textarea { min-height: 70px; resize: vertical; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--sub); font-weight: 500; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.tag.pending { background: #eef1f6; color: var(--sub); }
.tag.completed { background: #dcfce7; color: var(--green); }
.tag.exception { background: #fee2e2; color: var(--red); }

.photo { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.upload-box { border: 1.5px dashed var(--line); border-radius: 10px; padding: 16px; text-align: center; color: var(--sub); }
#photoPreview { max-width: 100%; max-height: 200px; margin-top: 8px; border-radius: 8px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal-card { background: #fff; width: 100%; max-width: 520px; border-radius: 14px 14px 0 0; max-height: 88vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.modal-foot { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.modal-foot .btn { flex: 1; }
.x { border: none; background: none; font-size: 22px; color: var(--sub); }
.empty { text-align: center; color: var(--sub); padding: 40px 0; }
.fthumbs img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; margin-right: 6px; border: 1px solid var(--line); }
.add-row-btn { color: var(--primary); border: 1px dashed var(--primary); background: #f0f6ff; margin-top: 8px; }
