:root {
  --red: #C62828;
  --red-dark: #A71E1E;
  --red-soft: #FFF5F5;
  --red-tint: #F2C4C4;
  --ink: #222;
  --ink2: #666;
  --ink3: #999;
  --line: #E6E6E6;
  --bg: #F6F6F6;
  --ok: #2E7D32;
}
* { 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", "Helvetica Neue", sans-serif;
  color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.6;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.bar {
  background: var(--red); color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-size: 18px; position: sticky; top: 0; z-index: 5; min-height: 54px;
}
.bar b { font-weight: 500; white-space: nowrap; }
.bar .back { font-size: 26px; line-height: 1; width: 32px; cursor: pointer; background: none; border: 0; color: #fff; padding: 0; text-align: left; }
.bar .spacer { width: 32px; }
.pill { font-size: 13px; border: 1px solid #fff; border-radius: 14px; padding: 3px 12px; color: #fff; white-space: nowrap; }

.btn {
  display: block; width: 100%; background: var(--red); color: #fff; border: 0; border-radius: 12px;
  padding: 14px; font-size: 17px; text-align: center; cursor: pointer;
}
.btn:active { background: var(--red-dark); }
.btn.white { background: #fff; color: var(--red); font-weight: 500; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #d5d5d5; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.sm { display: inline-block; width: auto; padding: 8px 16px; font-size: 14px; border-radius: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(34,34,34,.92); color: #fff;
  padding: 10px 18px; border-radius: 10px; font-size: 15px; z-index: 50; max-width: 86vw; text-align: center;
}

/* ===== 组长手机端 ===== */
.m-wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #fff; }
.m-body { padding: 18px 16px 40px; }
.hero { background: var(--red); color: #fff; border-radius: 16px; padding: 22px 18px; }
.hero.locked { background: #8A8A8A; }
.hero .wk { font-size: 14px; opacity: .92; }
.hero h1 { font-size: 26px; font-weight: 500; margin: 8px 0 14px; }
.hero .cd { background: rgba(255,255,255,.18); border-radius: 10px; padding: 9px 12px; font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.who { display: flex; justify-content: space-between; align-items: center; margin: 16px 2px 0; font-size: 15px; color: var(--ink2); }
.who a { color: var(--red); cursor: pointer; font-size: 14px; }
.sec-t { font-size: 15px; color: var(--ink2); margin: 24px 2px 4px; }
.hist { border-bottom: 1px solid #eee; }
.hist .hd { display: flex; justify-content: space-between; padding: 13px 2px; cursor: pointer; }
.hist .bd { padding: 0 2px 14px; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.hist .bd .t { font-size: 13px; color: var(--ink3); margin: 10px 0 2px; }
.hist .bd .t:first-child { margin-top: 0; }
.ok { color: var(--ok); }
.bad { color: var(--red); }
.lab { font-size: 14px; color: var(--ink2); margin: 18px 0 7px; display: block; }
.fld, select.fld, input.fld, textarea.fld {
  width: 100%; border: 1px solid #d9d9d9; border-radius: 12px; padding: 13px 14px; background: #fff; font-size: 17px; outline: none;
}
select.fld { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #999 50%), linear-gradient(135deg, #999 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
.fld:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(198,40,40,.12); }
textarea.fld { min-height: 130px; resize: vertical; line-height: 1.6; }
.hint { font-size: 13px; color: var(--ink3); margin-top: 8px; line-height: 1.6; }
.banner { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.banner.gray { background: #f1f1f1; color: #555; }
.err { color: var(--red); font-size: 14px; margin-top: 10px; min-height: 22px; }
.readonly-box { border: 1px solid #e8e8e8; border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; background: #fafafa; min-height: 48px; }

/* ===== 管理端 ===== */
.a-top { background: var(--red); color: #fff; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 20px; }
.a-top b { font-weight: 500; font-size: 17px; white-space: nowrap; }
.a-nav a, .a-nav button { margin-left: 18px; font-size: 15px; opacity: .85; white-space: nowrap; background: none; border: 0; color: #fff; cursor: pointer; padding: 0 0 3px; }
.a-nav a.on { opacity: 1; border-bottom: 2px solid #fff; }
.a-wrap { max-width: 1040px; margin: 0 auto; padding: 18px 16px 60px; }
.a-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.a-head h2 { margin: 0; font-size: 18px; font-weight: 500; }
.cdl { color: var(--red); font-size: 14px; margin-left: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 12px; }
.mt { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.mt .l { font-size: 13px; color: var(--ink2); }
.mt .v { font-size: 26px; font-weight: 500; }
.card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 500; }
.donut { position: relative; width: 200px; height: 200px; margin: 6px auto 0; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .c b { font-size: 32px; font-weight: 500; }
.donut .c span { font-size: 12px; color: var(--ink2); }
.legend { display: flex; gap: 18px; justify-content: center; margin-top: 12px; font-size: 13px; color: var(--ink2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.chip { display: inline-block; border: 1px solid var(--red); color: var(--red); border-radius: 16px; padding: 4px 13px; font-size: 14px; margin: 0 8px 8px 0; white-space: nowrap; }
.btn2 { display: inline-block; border: 1px solid #cfcfcf; background: #fff; border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn2.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn2.sm { padding: 5px 10px; font-size: 13px; }
.btn2[disabled] { opacity: .6; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.row:last-child { border-bottom: 0; }
.muted { color: var(--ink3); font-size: 12px; }
.sel { border: 1px solid #cfcfcf; border-radius: 8px; padding: 8px 12px; background: #fff; font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters .sp { flex: 1; }
.it { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.it .hd { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 13px 16px; cursor: pointer; font-size: 15px; }
.it .bd { border-top: 1px solid #eee; padding: 12px 16px; font-size: 15px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.it .bd .t { font-size: 12px; color: var(--ink2); margin: 10px 0 0; }
.it .bd .t:first-child { margin-top: 0; }
.st { font-size: 12px; border-radius: 10px; padding: 2px 10px; white-space: nowrap; }
.st.ok { background: #E8F5E9; color: var(--ok); }
.st.no { background: #FDECEC; color: var(--red); }
table.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tb th, table.tb td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eee; }
table.tb th { color: var(--ink2); font-weight: 500; font-size: 13px; }
table.tb td.act { text-align: right; white-space: nowrap; }
.login-box { max-width: 380px; margin: 12vh auto 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px 22px; }
.login-box h2 { margin: 0 0 6px; font-weight: 500; text-align: center; color: var(--red); }

/* ===== 响应式：手机用手机界面，电脑用电脑界面 ===== */
.form-t { display: none; margin: 0 0 6px; font-size: 18px; font-weight: 500; }
.home .col-r { min-width: 0; }

/* 电脑（宽屏）：组长页 */
@media (min-width: 900px) {
  body { font-size: 16px; }
  .m-wrap { max-width: none; background: transparent; }
  .bar { padding: 0 max(32px, calc((100vw - 1040px) / 2)); min-height: 64px; font-size: 20px; }
  .m-body { max-width: 1040px; margin: 0 auto; padding: 32px 32px 60px; }
  .m-body.home { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 32px; align-items: start; }
  .m-body.home .col-r { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px 24px 16px; min-height: 160px; }
  .m-body.home .col-r:empty { display: none; }
  .m-body.home .col-r .sec-t { margin-top: 14px; font-size: 16px; color: var(--ink); }
  .hero { padding: 28px 24px; }
  .hero h1 { font-size: 30px; }
  .btn { cursor: pointer; }
  .btn:hover { background: var(--red-dark); }
  .btn.white:hover { background: #fff5f5; }
  .who { font-size: 15px; }
  .hist .hd:hover { background: #fafafa; }
  /* 填报 / 选身份：居中的宽卡片 */
  .m-body.form { max-width: 760px; background: #fff; border: 1px solid var(--line); border-radius: 16px; margin-top: 32px; padding: 32px 40px 40px; }
  .m-body.form .btn { width: auto; min-width: 180px; padding: 12px 32px; }
  .form-t { display: block; margin-bottom: 14px; }
  textarea.fld { min-height: 150px; }
  .fld, select.fld, input.fld, textarea.fld { font-size: 16px; }
}

/* 管理后台：窄屏（手机） */
@media (max-width: 640px) {
  .a-top { padding: 10px 14px; }
  .a-top b { font-size: 16px; }
  .a-nav { width: 100%; display: flex; justify-content: space-between; }
  .a-nav a, .a-nav button { margin-left: 0; font-size: 15px; padding: 6px 0 5px; }
  .a-wrap { padding: 14px 12px 50px; }
  .a-head .sel { max-width: 100%; }
  .cdl { display: block; margin: 6px 0 0; }
  .mt .v { font-size: 22px; }
  .filters .sel { flex: 1 1 40%; min-width: 0; }
  .filters .sp { display: none; }
  .filters .btn2 { flex: 1 1 100%; padding: 11px; }
  .it .hd { padding: 14px 14px; }
  .login-box { margin: 6vh 14px 0; }
  /* 名单表格：手机上改成卡片式 */
  table.tb, table.tb tbody, table.tb tr, table.tb td { display: block; width: 100%; }
  table.tb thead { display: none; }
  table.tb tr { border-bottom: 1px solid #eee; padding: 10px 0; }
  table.tb td { border: 0; padding: 2px 0; }
  table.tb td:nth-child(1), table.tb td:nth-child(2) { display: inline-block; width: auto; font-size: 16px; margin-right: 8px; }
  table.tb td:nth-child(3)::before { content: '密码：'; color: var(--ink3); }
  table.tb td.act { text-align: left; padding-top: 8px; }
  .btn2.sm { padding: 8px 14px; font-size: 14px; }
}

.addrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.addrow label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink2); flex: 1 1 180px; min-width: 0; }
.addrow .fld { font-size: 15px; padding: 10px 12px; }
.addrow .btn2 { padding: 11px 24px; font-size: 15px; }
@media (max-width: 640px) { .addrow .btn2 { flex: 1 1 100%; } }
