:root {
  --brand: #1f6feb;
  --brand-dark: #1859c4;
  --brand-soft: #eaf2ff;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --ok: #16a34a;
  --warn: #d97706;
  --shadow: 0 4px 16px rgba(23, 32, 51, 0.06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
}
#app { max-width: 600px; margin: 0 auto; min-height: 100vh; padding-bottom: 120px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg, #1f6feb, #2f86f6);
  color: #fff; padding: 14px 16px calc(14px + env(safe-area-inset-top));
  box-shadow: 0 2px 10px rgba(31,111,235,.25);
}
.topbar-row { display: flex; align-items: center; gap: 10px; }
.title-wrap { flex: 1; min-width: 0; }
.title-wrap .title { font-size: 18px; font-weight: 700; }
.title-wrap .subtitle { font-size: 12px; opacity: .85; margin-top: 2px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; background: rgba(255,255,255,.15); cursor: pointer;
}
.icon-btn.link { font-size: 13px; width: auto; padding: 0 12px; border-radius: 20px; }
main { padding: 14px 12px; }

.card, .form-card {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px;
}
.field-label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; color: #374151; }
.select-wrap { position: relative; }
.select-wrap select {
  width: 100%; height: 52px; padding: 0 40px 0 14px; font-size: 16px;
  color: var(--text); border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; appearance: none; -webkit-appearance: none; outline: none;
}
.select-wrap select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
.select-arrow {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--muted); font-size: 16px;
}
.text-input {
  width: 100%; height: 50px; padding: 0 14px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 12px; outline: none; margin-bottom: 14px;
}
.text-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }

.primary-btn {
  width: 100%; height: 52px; border: none; border-radius: 14px;
  background: var(--brand); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer;
}
.primary-btn:active { background: var(--brand-dark); }
.primary-btn:disabled { background: #c9d3e0; cursor: not-allowed; }
.small-btn {
  border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 700;
  cursor: pointer; background: var(--brand); color: #fff; text-decoration: none; display: inline-block;
}
.small-btn.secondary { background: #eef2f7; color: var(--text); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.section-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 4px 10px; font-weight: 700; font-size: 16px;
}
.section-head .hint { font-weight: 400; font-size: 13px; color: var(--muted); }

.community-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  padding: 14px 14px; margin-bottom: 10px; cursor: pointer; border-left: 4px solid transparent;
}
.community-item:active { background: #f8fafc; }
.community-item.done { border-left-color: var(--ok); }
.ci-main { min-width: 0; flex: 1; }
.ci-name { font-weight: 700; font-size: 15px; }
.ci-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.badge { font-size: 12px; color: var(--ok); background: #dcfce7; padding: 3px 10px; border-radius: 20px; flex-shrink: 0; }
.badge.gray { color: var(--muted); background: #eef2f7; }

.form-section-title { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.form-field { margin-bottom: 16px; }
.form-field .field-label { font-size: 14px; margin-bottom: 6px; }
.form-field .select-wrap select { height: 48px; font-size: 15px; }
.req { color: #dc2626; margin-left: 3px; }
.info-strip { background: #eff6ff; color: #1e40af; border-radius: 10px; padding: 10px 12px; font-size: 12px; margin-bottom: 14px; line-height: 1.6; }
.success-strip { background: #f0fdf4; color: #166534; border-radius: 10px; padding: 10px 12px; font-size: 12px; margin-bottom: 14px; }

.login-box { background: #fff; border-radius: 16px; box-shadow: var(--shadow); max-width: 400px; margin: 40px auto; padding: 28px 22px; }
.login-box h2 { margin: 0 0 6px; font-size: 20px; text-align: center; }
.login-box p { color: var(--muted); font-size: 13px; margin: 0 0 22px; text-align: center; }
.login-box .field-label { margin-top: 14px; }
.notice { background: #fff7ed; color: #9a3412; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 18px 14px; text-align: center; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--brand); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.admin-section { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.admin-section h2 { font-size: 16px; margin: 0 0 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f8fafc; font-weight: 700; color: #374151; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; line-height: 1.8; }

.submit-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 600px; margin: 0 auto;
  background: #fff; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(0,0,0,.06); border-top: 1px solid var(--line);
}
.toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%) translateY(10px);
  background: rgba(17,24,39,.92); color: #fff; padding: 12px 20px; border-radius: 24px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; padding: 24px; }
.modal.show { display: flex; }
.modal-box { background: #fff; border-radius: 18px; padding: 24px 20px; width: 100%; max-width: 360px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal-box h3 { margin: 0 0 10px; font-size: 18px; }
.modal-box p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .small-btn { flex: 1; }
/* v3 新增：双按钮导出栏 / 系统维护入口 / 维护表单 */
.btn-duo { display: flex; gap: 10px; }
/* V2.2 修复：两个保存按钮左右等宽（原 2:1 视觉失衡），窄屏改为上下放置 */
.btn-duo .primary-btn, .btn-duo .small-btn {
  flex: 1 1 0; min-width: 0; width: 100%; height: 52px;
  border-radius: 14px; font-size: 15px; padding: 0 8px;
}
.bar-hint { text-align: center; font-size: 11px; color: var(--muted); margin-top: 6px; }
.login-sub { margin-top: 12px; }
.login-sub .small-btn { width: 100%; height: 44px; }
.admin-entry {
  background: linear-gradient(135deg, #0f172a, #1e3a5f); color: #fff; border-radius: 14px;
  padding: 15px 16px; margin-bottom: 14px; cursor: pointer; box-shadow: var(--shadow);
}
.admin-entry:active { opacity: .9; }
.admin-entry .ae-title { font-size: 15px; font-weight: 700; }
.admin-entry .ae-sub { font-size: 12px; opacity: .75; margin-top: 4px; }
.mini-btn { border: none; border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; background: #eef2f7; color: var(--text); }
.mini-btn.danger { background: #fee2e2; color: #b91c1c; }
.roster-area {
  width: 100%; min-height: 130px; padding: 10px 12px; font-size: 12px; line-height: 1.55;
  border: 1.5px solid var(--line); border-radius: 12px; outline: none;
  font-family: ui-monospace, Menlo, Consolas, monospace; resize: vertical; white-space: pre; overflow: auto;
}
.roster-area:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
.mini-form { margin-top: 12px; }
.mini-form .select-wrap { margin-bottom: 10px; }
.sub-hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
@media (min-width: 601px) { #app { box-shadow: 0 0 40px rgba(23,32,51,.08); } }

/* ===== V2 新增样式 ===== */
.ver-tag { display:inline-block; background:var(--brand); color:#fff; font-size:12px; border-radius:6px; padding:2px 7px; vertical-align:middle; margin-left:4px; }
/* 登录页版本号：置于标题正下方，弱化显示 */
.ver-sub { text-align:center; color:#9ca3af; font-size:11px; margin:-2px 0 20px; }
.opt-tag { color:#9ca3af; font-weight:400; font-size:12px; margin-left:6px; }
.remark-area { width:100%; padding:10px 12px; font-size:15px; line-height:1.5; border:1.5px solid var(--line); border-radius:12px; outline:none; resize:vertical; font-family:inherit; background:#fff; color:var(--text); }
.remark-area:focus { border-color:var(--brand); box-shadow:0 0 0 3px rgba(31,111,235,.12); }
/* V2.1.2：多选勾选框（宣传覆盖场景） */
.check-group { display:flex; flex-direction:column; gap:9px; }
.check-item { display:flex; align-items:flex-start; gap:10px; padding:11px 12px; border:1.5px solid var(--line); border-radius:12px; background:#fff; cursor:pointer; line-height:1.45; }
.check-item:active { background:var(--brand-soft); }
.check-item input[type=checkbox] { position:absolute; opacity:0; width:0; height:0; }
.check-box { flex:none; width:19px; height:19px; margin-top:1px; border:1.5px solid #c7ced9; border-radius:5px; background:#fff; position:relative; }
.check-item input:checked + .check-box { background:var(--brand); border-color:var(--brand); }
.check-item input:checked + .check-box::after { content:''; position:absolute; left:6px; top:2px; width:5px; height:10px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }
.check-item input:checked ~ .check-text { color:var(--brand-dark); font-weight:600; }
.check-text { font-size:14px; color:var(--text); }
.quick-row { display:flex; gap:10px; margin:10px 0; }
.quick-row .small-btn { flex:1; }
.add-box { background:#fff; border:1.5px solid var(--line); border-radius:14px; padding:14px; margin-bottom:12px; }
.add-box .text-input { margin-bottom:8px; }
.record-item { display:flex; align-items:center; gap:10px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-bottom:8px; }
.record-item .ci-main { flex:1; min-width:0; }
.rec-actions { display:flex; flex-direction:column; gap:6px; flex-shrink:0; }
.delete-row { display:flex; justify-content:center; margin:14px 0 24px; }

/* ===== V2.1 新增样式 ===== */
.filter-row { display:flex; gap:8px; flex-wrap:wrap; }
.filter-chip { border:1.5px solid var(--line); background:#fff; color:var(--muted); border-radius:20px; padding:6px 14px; font-size:13px; cursor:pointer; }
.filter-chip.active { background:var(--brand); border-color:var(--brand); color:#fff; font-weight:700; }
.record-item .ci-meta small { color:var(--brand); }
.warn-strip { background:#fff7ed; color:#9a3412; border:1.5px solid #fed7aa; border-radius:10px; padding:10px 12px; font-size:12px; line-height:1.6; margin-bottom:12px; }
.warn-strip b { color:#c2410c; }
@media (max-width: 380px) {
  .btn-duo { flex-direction: column; }
  .btn-duo .primary-btn, .btn-duo .small-btn { width:100%; height:50px; font-size:14px; }
}

/* ===== 进度盯控（管理员 / 流程管理） ===== */
.admin-entry { background:#fff; border-radius:14px; box-shadow:var(--shadow); padding:14px 16px; margin-bottom:14px; cursor:pointer; border-left:4px solid var(--brand); }
.admin-entry:active { background:#f8fafc; }
.ae-title { font-size:15px; font-weight:800; color:var(--text); }
.ae-sub { font-size:12px; color:var(--muted); margin-top:4px; }
.pg-card { background:#fff; border-radius:14px; box-shadow:var(--shadow); padding:12px; margin-bottom:10px; }
.pg-head { display:flex; align-items:center; justify-content:space-between; gap:8px; cursor:pointer; }
.pg-title { display:flex; align-items:center; gap:6px; font-weight:800; font-size:15px; min-width:0; }
.pg-arrow { display:inline-block; font-style:normal; color:var(--muted); font-size:11px; transition:transform .15s; }
.pg-arrow.closed { transform:rotate(-90deg); }
.pg-count { font-size:12px; font-weight:500; color:var(--muted); white-space:nowrap; margin-left:6px; }
.pg-pct { font-size:13px; font-weight:800; color:var(--brand); white-space:nowrap; }
.pg-bar { height:6px; background:#eef2f7; border-radius:6px; overflow:hidden; margin-top:8px; }
.pg-bar i { display:block; height:100%; background:var(--ok); border-radius:6px; }
.pg-grid { margin-top:10px; padding-left:10px; border-left:2px solid var(--brand-soft); }
.pg-grid-head { display:flex; align-items:center; justify-content:space-between; gap:8px; cursor:pointer; padding:6px 2px; }
.pg-grid-name { font-weight:700; font-size:13px; color:#374151; }
.pg-row { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:9px 10px; border-radius:10px; background:#f0fdf4; margin:6px 0; cursor:pointer; }
.pg-row.pending { cursor:default; background:#fff; border:1px dashed var(--line); }
.pg-nm { font-size:14px; font-weight:600; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pg-code { font-size:11px; color:var(--muted); font-weight:400; margin-left:6px; }
.pg-empty { color:var(--muted); font-size:12px; padding:6px 4px; }
.pd-meta { font-size:12px; color:var(--muted); line-height:1.8; margin-bottom:10px; word-break:break-all; }
.pd-row { display:flex; justify-content:space-between; gap:10px; border-bottom:1px solid var(--line); padding:9px 0; font-size:13px; }
.pd-label { color:var(--muted); flex-shrink:0; }
.pd-val { font-weight:600; text-align:right; word-break:break-all; }

/* ===== 统计卡紧凑布局（进度盯控页 + 管理员汇总页共用） ===== */
.pg-stats { grid-template-columns:repeat(4,1fr); gap:8px; }
.pg-stats .stat-card { padding:12px 4px; border-radius:12px; }
.pg-stats .stat-num { font-size:23px; line-height:1.2; }
.pg-stats .stat-num.danger { color:#dc2626; }
.pg-stats .stat-label { font-size:11px; margin-top:3px; }
.pg-actions { flex-wrap:wrap; gap:8px; }
.pg-actions .small-btn { flex:1 1 auto; padding:10px 12px; font-size:13px; border-radius:9px; text-align:center; white-space:nowrap; }
.pg-select { margin-bottom:12px; }
.pg-select select { height:46px; }
/* 进度页网格筛选：自定义下拉，菜单固定锚定在触发框正下方（原生 select 桌面端会向上乱弹） */
.custom-select { position:relative; }
.cs-trigger {
  width:100%; height:46px; padding:0 40px 0 14px; font-size:15px; text-align:left;
  color:var(--text); border:1.5px solid var(--line); border-radius:12px; background:#fff;
  cursor:pointer; outline:none; display:flex; align-items:center; justify-content:space-between;
}
.cs-trigger:focus, .cs-trigger[aria-expanded="true"] { border-color:var(--brand); box-shadow:0 0 0 3px rgba(31,111,235,.12); }
.cs-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cs-trigger .select-arrow { transition:transform .15s; }
.cs-trigger[aria-expanded="true"] .select-arrow { transform:translateY(-50%) rotate(180deg); }
.cs-menu {
  display:none; position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:1000;
  max-height:320px; overflow-y:auto; background:#fff; border:1.5px solid var(--line);
  border-radius:12px; box-shadow:0 8px 24px rgba(23,32,51,.14); padding:4px;
}
.cs-menu.open { display:block; }
.cs-opt { padding:10px 12px; border-radius:8px; font-size:15px; color:var(--text); cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cs-opt:hover { background:#f3f6fb; }
.cs-opt.active { background:var(--brand); color:#fff; }
/* V2.2 填报表单字段下拉：与原生 select 同高（48px），原生元素仅在手机端显示 */
.field-select .cs-trigger { height:48px; font-size:15px; border-radius:12px; }
.field-select .cs-native { display:none; }
@media (max-width:600px) {
  .cs-menu { max-height:50vh; }
  .cs-opt { font-size:16px; padding:12px; }
}
.pg-tools { gap:10px; }
.pg-tools .small-btn { flex:1; padding:11px 10px; font-size:14px; border-radius:10px; }

/* ===== 清单删除 / 清单回收站（管理员系统维护） ===== */
.small-btn.danger { background:#fee2e2; color:#b91c1c; }
.trash-row { display:flex; align-items:center; gap:10px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:11px 14px; margin-bottom:8px; font-size:13px; }
.trash-row > span { flex:1; min-width:0; line-height:1.6; word-break:break-all; }
.trash-row small { color:var(--muted); font-size:11px; }
.trash-row .mini-btn { flex-shrink:0; }
