:root {
  --brand: #2a5ea8;
  --brand-dark: #1e4680;
  --bg: #f2f5f9;
  --card: #fff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --line: #e3e8ef;
  --danger: #c0392b;
  --ok: #2e7d32;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

header {
  height: 56px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 9px; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.18); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.header-actions { display: flex; gap: 12px; align-items: center; }
.who { font-size: 13px; opacity: .9; }

main { max-width: 980px; margin: 0 auto; padding: 18px 14px 60px; display: flex; flex-direction: column; gap: 16px; }

.card { background: var(--card); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.card.narrow { max-width: 460px; margin: 8vh auto 0; }

h2 { font-size: 16px; margin: 0 0 8px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin: 4px 0 12px; }
code { background: #f1f4f9; padding: 1px 6px; border-radius: 4px; }

.form { display: flex; flex-direction: column; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.form-row input, .form label input { min-width: 150px; }

input, select {
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus, select:focus { border-color: var(--brand); }

button {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}
button:hover { background: var(--brand-dark); }
button.ghost { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; }
button.mini { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
button.mini.ghost { background: #fff; border: 1px solid var(--line); color: var(--muted); }
button.mini.ghost:hover { border-color: var(--danger); color: var(--danger); }

.error { color: var(--danger); font-size: 12.5px; min-height: 18px; }
.hidden { display: none !important; }

.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: #f4f7fc; border: 1px solid #e2eaf5; border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--muted); }
.stat b { color: var(--brand); font-size: 16px; margin-left: 5px; }

.table { display: flex; flex-direction: column; margin-top: 10px; }
.tr { display: grid; grid-template-columns: 1.2fr 1fr .8fr .8fr 1.2fr; gap: 8px; padding: 9px 6px; border-bottom: 1px solid var(--line); align-items: center; }
.tr.th { font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.td { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.ops { display: flex; gap: 6px; flex-wrap: wrap; }

.projects { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.project { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.project-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.project-title { font-weight: 700; font-size: 14.5px; }
.project-meta { color: var(--muted); font-size: 12px; }
.members { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.member { background: #eef4fc; border-radius: 8px; padding: 5px 8px; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.member button { padding: 0 5px; line-height: 16px; }
.empty { color: var(--muted); text-align: center; padding: 18px; }

/* 资料查看 / 导出 */
.records { display: flex; flex-direction: column; margin-top: 10px; max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.rec-row { display: grid; grid-template-columns: 34px 90px 130px 1fr 90px 50px; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); align-items: center; cursor: pointer; font-size: 13px; }
.rec-row:hover { background: #f7faff; }
.rec-row.rec-head { font-size: 12px; color: var(--muted); cursor: default; background: #fafbfd; position: sticky; top: 0; }
.rec-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-headline { font-weight: 600; }
.rec-check { width: 16px; height: 16px; margin: 0; }
.detail { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fbfcfe; }
.detail.hidden { display: none; }
.detail h3 { margin: 0 0 10px; font-size: 14.5px; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table th, .detail-table td { border: 1px solid var(--line); padding: 6px 9px; vertical-align: top; text-align: left; }
.detail-table th { width: 24%; background: #f1f5fb; font-weight: normal; color: var(--muted); }
.detail-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.detail-photos img { width: 150px; height: 112px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.download-link { color: var(--brand); font-weight: 600; text-decoration: underline; }

@media (max-width: 700px) {
  .tr { grid-template-columns: 1fr 1fr; }
  .tr.th { display: none; }
}
