/* 移动优先全站样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font: 16px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8; color: #222; padding-bottom: 40px;
}
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  background: #34495e; color: #fff; padding: 12px 16px;
}
.topbar .site-name { font-weight: 700; }
.topbar nav a { color: #cfd9e4; text-decoration: none; margin-left: 14px; }
.user-bar { padding: 8px 16px; font-size: 14px; color: #555; background: #eef1f4; }
main { padding: 12px; max-width: 640px; margin: 0 auto; }

.btn {
  display: inline-block; min-height: 44px; padding: 8px 14px;
  border: 1px solid #ccc; border-radius: 8px; background: #fff;
  font-size: 16px; cursor: pointer;
}
.btn.sm { min-height: 32px; padding: 2px 8px; font-size: 14px; }
.btn.danger { color: #c62828; border-color: #e0b4b4; }
.btn-primary { background: #34495e; color: #fff; border-color: #34495e; }
.btn-lg { width: 100%; padding: 14px; font-size: 18px; }
.btn-ok { min-width: 52px; }
.btn-ok.on { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.btn-bad { min-width: 52px; }
.btn-bad.on { background: #c62828; color: #fff; border-color: #c62828; }
.btn-resolve { margin: 6px 0 0; border-color: #ef6c00; color: #ef6c00; }
.link { background: none; border: none; color: #2b6cb0; cursor: pointer; font-size: inherit; padding: 4px; }
.input { min-height: 44px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 16px; flex: 1; }

.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 20px;
}
.overlay.hidden { display: none; }
.modal { background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 420px; }
.modal h3 { margin-bottom: 12px; }
.modal textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }

.progress {
  position: sticky; top: 48px; z-index: 9;
  background: #fff3cd; border: 1px solid #ffe08a; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 12px; font-weight: 600;
}
.progress.done { background: #e6f4ea; border-color: #b7dfc0; color: #2e7d32; }

.category { background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.category h2 { font-size: 17px; border-bottom: 1px solid #eee; padding-bottom: 8px; margin-bottom: 4px; }
.item { padding: 10px 0; border-bottom: 1px solid #f2f2f2; }
.item:last-child { border-bottom: none; }
.item-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.item-row .title { flex: 1; }
.item-row .actions { display: flex; gap: 8px; }
.meta { font-size: 14px; margin-top: 6px; padding: 4px 8px; border-radius: 4px; background: rgba(0,0,0,0.04); }
.ok-meta { color: #2e7d32; background: rgba(46, 125, 50, 0.1); }
.problem-meta { color: #c62828; background: rgba(198, 40, 40, 0.1); }
.resolved-meta { color: #ef6c00; background: rgba(239, 108, 0, 0.1); }
.meta .who { font-weight: 600; margin-right: 4px; }
.meta .when { color: #666; font-size: 12px; margin-left: 4px; }
.badge { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: #eee; white-space: nowrap; }
.badge.ok { background: #e6f4ea; color: #2e7d32; }
.badge.problem { background: #fdecea; color: #c62828; }
.badge.resolved { background: #fff3e0; color: #ef6c00; }

.empty-state { text-align: center; color: #666; padding: 40px 16px; }
.empty-state .btn { margin-top: 16px; }

.session-card {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; background: #fff; border: 1px solid #e3e3e3; border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px; font-size: 16px; cursor: pointer;
}
.session-card .date { font-weight: 700; }
.session-card .state { font-size: 14px; color: #666; }
.session-card.good .state { color: #2e7d32; }
.detail-date { margin: 10px 0; }

.admin section { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.admin h2 { font-size: 17px; margin-bottom: 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f2f2f2; }
.row:last-child { border-bottom: none; }
.row .actions { display: flex; gap: 6px; flex-shrink: 0; }
.row.inactive span { color: #999; }
.add-row { border-bottom: none; padding-top: 10px; }
.cat-card { border: 1px solid #eee; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.cat-head { border-bottom: 1px solid #eee; }
.hint { font-size: 13px; color: #888; margin-bottom: 8px; }
.sync-warning { background: #fff3cd; color: #7a5b00; padding: 8px 16px; font-size: 14px; }
.sync-warning.hidden { display: none; }
.qr { width: 220px; max-width: 100%; display: block; margin: 8px auto; }

/* 参考图 */
.btn-camera { background: #f0f4f8; padding: 4px 10px; }
.btn-camera:hover { background: #dde7f0; }
.image-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px 0; }
.thumb { width: 88px; height: 88px; object-fit: cover; border-radius: 6px; border: 1px solid #eee; cursor: zoom-in; background: #fafafa; }
.admin-img-cell { position: relative; display: inline-block; }
.admin-img-cell .img-del { position: absolute; top: 2px; right: 2px; font-size: 11px; padding: 1px 6px; }
#lightbox { background: rgba(0,0,0,0.85); z-index: 100; }
.lightbox-content { max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; padding: 16px; }
.lightbox-content img { max-width: 100%; max-height: 75vh; object-fit: contain; border-radius: 6px; background: #fff; }
.lightbox-meta { color: #fff; padding: 10px 0; font-size: 14px; text-align: center; }
.lightbox-meta .who { font-weight: 600; margin: 0 6px; }
.lightbox-meta .when { color: #ccc; font-size: 12px; }
.lightbox-nav { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.lb-count { color: #fff; font-size: 14px; min-width: 50px; text-align: center; }
#lightbox.hidden { display: none; }
