/* 学院党务管理系统 —— 党建红 + 中性纸色，单文件样式 */
:root {
  --red: #a51c16;
  --red-d: #7e1310;
  --red-l: #f6e7e5;
  --bg: #f4f1ec;
  --card: #ffffff;
  --line: #e3ddd4;
  --ink: #23211e;
  --muted: #7b7369;
  --amber: #a96a12;
  --amber-l: #fdf3e2;
  --green: #2c6e49;
  --green-l: #e6f2ea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(35, 30, 25, .05), 0 4px 14px rgba(35, 30, 25, .04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  background: #f1ece5;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  font-size: .88em;
  color: #4a4238;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: .2px; }
h1 { font-size: 22px; }
h2 { font-size: 15.5px; }
p { margin: 4px 0; }
ul, ol { margin: 6px 0; padding-left: 20px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.red { color: var(--red); }
.amber { color: var(--amber); }
.pad { padding: 10px 16px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 62px;
  padding: 0 22px;
  background: linear-gradient(102deg, #7e1310 0%, #a51c16 62%, #b52c22 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(90, 15, 12, .22);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.emblem {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #f7d774;
  color: #8f1712;
  font-size: 17px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.emblem-svg { color: #f5d586; display: block; flex: 0 0 auto; }
.emblem-svg.emblem-red { color: var(--red); }
.emblem-glyph {
  color: #f5d586;
  font-family: "Segoe UI Symbol", "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1;
  display: inline-block;
}
.emblem-glyph.emblem-red { color: var(--red); }
.emblem-big { display: flex; justify-content: center; margin-bottom: 10px; }
.brand-logo { height: 30px; width: auto; display: block; flex: 0 0 auto; }
.login-logo {
  display: inline-block;
  background: var(--red);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 12px;
}
.login-logo img { height: 40px; width: auto; display: block; }
.emblem.big { width: 46px; height: 46px; font-size: 26px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b { font-size: 15.5px; letter-spacing: .5px; }
.brand-txt small { font-size: 11px; opacity: .78; }

.mainnav { display: flex; gap: 2px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  position: relative;
  padding: 7px 12px;
  border-radius: 7px;
  color: rgba(255, 255, 255, .82);
  font-size: 14px;
  white-space: nowrap;
}
.mainnav a:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.mainnav a.on { background: rgba(255, 255, 255, .17); color: #fff; font-weight: 600; }
.dot {
  display: inline-block;
  min-width: 18px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 9px;
  background: #f7d774;
  color: #7e1310;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-align: center;
  line-height: 18px;
  vertical-align: 1px;
}
.userbox { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.who { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: #fff; }
.who:hover { text-decoration: none; opacity: .92; }
.who em { font-style: normal; }
.who small { color: rgba(255, 255, 255, .68); font-size: 11.5px; }
.id-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff;
  background: #4a5a68;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .12);
}
.id-badge.role-admin { background: #f2d27a; color: #6d100c; }
.id-badge.role-branch { background: #f6b45c; color: #5a3604; }
.id-badge.role-member { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------------------------------------------------------------- 布局 */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head .muted { font-size: 13px; margin-top: 4px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }

.cols { display: grid; gap: 16px; }
.main-cols { grid-template-columns: minmax(0, 1.7fr) minmax(360px, 1fr); align-items: start; }
.main-cols.single { grid-template-columns: minmax(0, 1fr); }
.side[hidden] { display: none; }
.detail-cols { grid-template-columns: minmax(300px, .85fr) minmax(0, 1.5fr); align-items: start; }
.side, .main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.side .card:last-child, .main .card:last-child { margin-bottom: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head h2::before {
  content: "";
  width: 3px; height: 15px;
  border-radius: 2px;
  background: var(--red);
}
.more { font-size: 12.5px; }
.card.tip { background: #fbf8f3; border-color: #e8ddcd; font-size: 13px; }
.card.tip b { color: var(--red-d); }
.card.tip ul { margin: 6px 0 0; padding-left: 18px; }
.card.tip li { margin: 2px 0; }

details.fold > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  color: var(--red-d);
  padding: 2px 0;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; color: var(--red); }
details.fold[open] > summary::before { content: "▾"; }
details.fold[open] > summary { margin-bottom: 12px; }
details.fold.danger-zone { border-color: #e8c9c5; }

/* ---------------------------------------------------------------- 统计 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat > span { font-size: 12.5px; color: var(--muted); }
.stat > b { font-size: 27px; line-height: 1.25; font-weight: 700; letter-spacing: -.5px; }
.stat > small { font-size: 11.5px; color: var(--muted); }
.stat.danger { border-color: #ecc9c4; background: linear-gradient(180deg, #fff 55%, #fdf1ef); }
.stat.danger > b { color: var(--red); }
.pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12.5px;
  color: var(--muted);
}
.pill b { font-size: 15px; color: var(--ink); }
.pill.danger { border-color: #ecc9c4; background: var(--red-l); }
.pill.danger b { color: var(--red); }

/* ---------------------------------------------------------------- 表格 */
.table-wrap { width: 100%; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--muted);
  background: #faf8f4;
  border-bottom: 1px solid var(--line);
  padding: 9px 12px;
  white-space: nowrap;
}
.tbl td { padding: 8px 10px; border-bottom: 1px solid #f0ece6; vertical-align: middle; white-space: nowrap; }
.tbl td.branch { white-space: normal; min-width: 100px; max-width: 190px; line-height: 1.4; }
.tbl td.material { white-space: normal; min-width: 120px; line-height: 1.4; }
.tbl tbody tr:hover { background: #fdfbf7; }
.tbl td.wrap-cell { white-space: normal; min-width: 240px; }
.tbl td.wrap-cell small { line-height: 1.45; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fcfaf7; }
.tbl tr.row-danger { background: #fdf6f5; }
.tbl tr.row-danger:hover { background: #fceeec; }
.tbl tr.off { opacity: .58; }
.tbl td b { font-weight: 600; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.tbl .actions form { display: inline; }

/* ---------------------------------------------------------------- 标签 */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f6f3ee;
  color: #5d554b;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}
.tag.ok { background: var(--green-l); border-color: #c5dfd0; color: var(--green); }
.tag.warn { background: var(--amber-l); border-color: #efd9b6; color: var(--amber); }
.tag.info { background: #eef1f4; border-color: #d9e0e6; color: #4a5a68; }
.tag.danger { background: var(--red-l); border-color: #ecc9c4; color: var(--red); }
.tag.role-admin { background: #fbeae8; border-color: #ecc9c4; color: var(--red-d); }
.tag.role-branch { background: #fdf1e2; border-color: #efd6b4; color: #94570c; }
.tag.role-member { background: #eef1f4; border-color: #d9e0e6; color: #4a5a68; }
.topbar .tag { border: 0; }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #f7f3ed; text-decoration: none; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--red-d); border-color: var(--red-d); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: #f1ece5; }
.btn.danger { background: #fff; border-color: #e0b8b3; color: var(--red); }
.btn.sm { height: 27px; padding: 0 9px; font-size: 12.5px; border-radius: 6px; }
.btn.block { width: 100%; height: 40px; font-size: 15px; letter-spacing: 4px; }
.link { background: none; border: 0; padding: 0; color: var(--red); font-size: 13px; font-family: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }
.link.danger { color: #b3261e; }

/* ---------------------------------------------------------------- 筛选 */
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filters input, .filters select { height: 34px; }
.filters input[name="kw"] { width: 190px; }
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.seg a {
  padding: 6px 13px;
  font-size: 13px;
  color: var(--muted);
  border-right: 1px solid var(--line);
}
.seg a:last-child { border-right: 0; }
.seg a:hover { background: #f7f3ed; text-decoration: none; }
.seg a.on { background: var(--red); color: #fff; font-weight: 600; }

/* ---------------------------------------------------------------- 表单 */
input, select, textarea {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d9d2c8;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 8px 10px; }
input:focus, select:focus, textarea:focus {
  border-color: #c07a73;
  box-shadow: 0 0 0 3px rgba(165, 28, 22, .09);
}
input[disabled] { background: #f4f0ea; color: var(--muted); }
.readonly {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f4ef;
  color: #5d554b;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: end;
}
.form-grid.one { grid-template-columns: 1fr; }
.form-grid.one .span2, .form-grid.one > p { grid-column: auto; }
.form-grid .span2 { grid-column: span 2; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.form-grid label > span { font-weight: 600; color: #5d554b; }
.form-grid label.chk { flex-direction: row; align-items: center; gap: 7px; color: var(--ink); font-size: 13px; }
.form-grid label.chk input { height: auto; }
.form-grid > button { justify-self: start; }
.form-grid > p { grid-column: span 2; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 4px 0; }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink); }
.chk input { height: auto; }
.pop { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbf9f5; }
.inline-edit summary { list-style: none; }
.inline-edit summary::-webkit-details-marker { display: none; }
.inline-edit { display: inline-block; }

/* ---------------------------------------------------------------- 各种块 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 4px 4px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
}
.pager-info { color: var(--muted); font-size: 13px; }
.btn.disabled { opacity: .4; pointer-events: none; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}
.empty b { color: var(--ink); font-size: 14px; }
.empty.small { padding: 18px 12px; }
.empty span { font-size: 12.5px; }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed #eee8e0;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list li b { display: block; font-size: 13.5px; }
.mini-list li .muted { display: block; }

.kv { display: grid; grid-template-columns: 88px 1fr; gap: 6px 10px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; word-break: break-all; }

.stage-flow { list-style: none; margin: 4px 0 0; padding: 0; }
.stage-flow li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0 5px 2px;
  font-size: 13px;
  color: var(--muted);
}
.stage-flow li i {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid #d5cec4;
  background: #fff;
  flex: 0 0 auto;
}
.stage-flow li::before {
  content: "";
  position: absolute;
  left: 5.5px; top: 0; bottom: 0;
  width: 1px;
  background: #e6e0d7;
}
.stage-flow li:first-child::before { top: 50%; }
.stage-flow li:last-child::before { bottom: 50%; }
.stage-flow li.done { color: #8a8177; }
.stage-flow li.done i { background: #cfc7bc; border-color: #cfc7bc; }
.stage-flow li.cur { color: var(--red-d); font-weight: 700; }
.stage-flow li.cur i { border-color: var(--red); background: var(--red); box-shadow: 0 0 0 3px rgba(165, 28, 22, .14); }

.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.flash {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13.5px;
}
.flash.ok { border-color: #c5dfd0; background: var(--green-l); color: #245a3b; }
.flash.err { border-color: #ecc9c4; background: var(--red-l); color: #8f231d; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px 26px;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- 身份条 */
.identity-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  color: #fff;
  background: linear-gradient(102deg, #39434f 0%, #55636f 100%);
  box-shadow: 0 3px 12px rgba(35, 30, 25, .16);
}
.identity-bar.branch { background: linear-gradient(102deg, #7c4f0e 0%, #b3761c 100%); }
.identity-bar.admin { background: linear-gradient(102deg, #7e1310 0%, #a51c16 70%, #b52c22 100%); }

/* 身份栏按发展阶段着色：入党申请人（黄）→ 正式党员（红） */
.identity-bar.apply    { background: linear-gradient(104deg, #bf8a1c 0%, #dfb54a 100%); }
.identity-bar.activist { background: linear-gradient(104deg, #bd7a15 0%, #dd9f30 100%); }
.identity-bar.dev      { background: linear-gradient(104deg, #b96213 0%, #db8a28 100%); }
.identity-bar.prob     { background: linear-gradient(104deg, #b04218 0%, #d36926 100%); }
.identity-bar.full     { background: linear-gradient(104deg, #a21b15 0%, #c43a2b 100%); }
/* 支书 / 副支书 / 组织委员：红渐黄 */
.identity-bar.lead     { background: linear-gradient(104deg, #a51c16 0%, #c9571f 45%, #d9a441 100%); }
/* 老师 / 党素工作人员：深红 */
.identity-bar.faculty  { background: linear-gradient(104deg, #660d0a 0%, #8c1512 100%); }
.identity-bar.apply, .identity-bar.activist, .identity-bar.dev { text-shadow: 0 1px 3px rgba(90, 50, 0, .28); }

/* 工作台发展进度条 */
.card.progress-strip { overflow: hidden; }
.card.progress-strip .timeline { padding: 34px 32px 8px; }
.card.progress-strip .timeline::before { left: 5%; right: 5%; }
.card.progress-strip .tl-title { font-size: 13.5px; }
.card.progress-strip .tl-date { font-size: 12.5px; }
.identity-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.identity-role {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 2px;
  padding-right: 16px;
  border-right: 1px solid rgba(255, 255, 255, .28);
  white-space: nowrap;
}
.identity-main {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.3;
}
.identity-main .sep { opacity: .5; margin: 0 8px; font-weight: 400; }
.identity-main b { font-weight: 800; }
.identity-sub { font-size: 12px; opacity: .78; margin-top: 2px; }
.identity-meta { display: flex; gap: 22px; font-size: 12px; opacity: .92; }
.identity-meta span { display: block; opacity: .8; }
.identity-meta b { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }

.branch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.branch-grid > div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f4;
}
.branch-grid span { display: block; font-size: 11.5px; color: var(--muted); }
.branch-grid b { font-size: 20px; font-weight: 700; }

/* ---------------------------------------------------------------- 发展时间轴 */
.timeline {
  list-style: none;
  margin: 6px 0 0;
  padding: 30px 6px 4px;
  display: flex;
  align-items: flex-start;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8%; right: 8%;
  top: 12px;
  height: 2px;
  background: linear-gradient(90deg, #e8e2d8, #e8e2d8);
}
.timeline li {
  flex: 1 1 0;
  position: relative;
  text-align: center;
  min-width: 0;
}
.timeline li > i {
  position: absolute;
  left: 50%; top: -24px;
  transform: translateX(-50%);
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2px solid #d5cec4;
  background: #fff;
  z-index: 1;
}
.timeline li.done > i { background: #b9b0a4; border-color: #b9b0a4; }
.timeline li.cur > i {
  background: var(--red); border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(165, 28, 22, .13);
}
.timeline li.cur .tl-title { color: var(--red-d); font-weight: 700; }
.tl-title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-date { color: var(--muted); font-size: 11.5px; font-weight: 400; margin-top: 2px; }
.tl-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.side .timeline { padding: 26px 0 2px; }
.side .timeline .tl-title { font-size: 11.5px; }
.side .timeline .tl-date { font-size: 10.5px; }
.side .timeline li > i { width: 11px; height: 11px; top: -21px; }
.ok-text { color: var(--green); }

/* ---------------------------------------------------------------- 交互与动效 */
@keyframes hermesIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}
.wrap > .identity-bar,
.wrap > .page-head,
.wrap > .stats,
.wrap > .card,
.wrap > .cols,
.wrap > .flashes { animation: hermesIn .3s cubic-bezier(.22, .61, .36, 1) both; }
.wrap > *:nth-child(2) { animation-delay: .035s; }
.wrap > *:nth-child(3) { animation-delay: .07s; }
.wrap > *:nth-child(4) { animation-delay: .1s; }

.card { transition: box-shadow .22s ease, border-color .22s ease; }
.card:hover { box-shadow: 0 10px 26px rgba(80, 35, 30, .09); border-color: #e2d6c8; }

.btn { transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(80, 35, 30, .12); }
.btn:active { transform: translateY(0); box-shadow: none; }

.mainnav a { transition: background .18s ease, color .18s ease; }
.tbl tbody tr { transition: background .14s ease; }
.tag { transition: background .16s ease, color .16s ease; }
input, select, textarea { transition: border-color .16s ease, box-shadow .16s ease; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(179, 38, 30, .1); }

/* 顶部录入材料：整块加宽、左侧强调 */
.card.quick-record { border-left: 3px solid var(--red); }
.card.quick-record .form-grid { grid-template-columns: 2.2fr 1.5fr 1.1fr 1.6fr 2fr auto; }
.card.quick-record .form-grid .span2 { grid-column: auto; }
@media (max-width: 1180px) {
  .card.quick-record .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card.quick-record .form-grid .span2 { grid-column: span 2; }
}

/* 表单顶部操作条：滚动时保持可见 */
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 62px;
  z-index: 3;
  padding: 8px 0 7px;
  background: linear-gradient(#fff 78%, rgba(255, 255, 255, .86));
  border-bottom: 1px dashed #efe7db;
  margin-bottom: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.form-section {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 9px;
  border-top: 1px dashed #e6dfd5;
  font-size: 12px;
  font-weight: 700;
  color: var(--red-d);
  letter-spacing: .5px;
}
.row-warn { background: #fffaf0; }
.row-warn:hover { background: #fdf6e8; }
.pill.warn { border-color: #efd9b6; background: var(--amber-l); }
.pill.warn b { color: var(--amber); }

/* ---------------------------------------------------------------- 资格校验 */
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li {
  display: flex;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px dashed #eee8e0;
}
.check-list li:last-child { border-bottom: 0; }
.check-icon {
  flex: 0 0 auto;
  width: 21px; height: 21px;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: #b9b0a4;
}
.check-list li.ok .check-icon { background: var(--green); }
.check-list li.bad .check-icon { background: var(--red); }
.check-name { font-size: 13.5px; font-weight: 600; }
.check-list li.bad .check-name { color: var(--red-d); }
.check-detail { font-size: 12px; color: #5d554b; margin-top: 1px; }

/* ---------------------------------------------------------------- 导入页 */
.dropzone {
  border: 1.5px dashed #d8cfc2;
  border-radius: 10px;
  padding: 22px;
  background: #fbf9f5;
  text-align: center;
}
.dropzone input[type=file] { height: auto; border: 0; background: none; }

.grad-alert { border-color: #ecc9c4; background: #fffaf8; }
.grad-alert .card-head h2::before { background: var(--amber); }

.error-box { max-width: 520px; margin: 60px auto; text-align: center; }
.error-box .code { font-size: 64px; font-weight: 800; color: #e6ddd2; line-height: 1; }
.error-box h1 { font-size: 19px; margin: 8px 0 6px; }
.error-box .btn { margin-top: 16px; }

/* ---------------------------------------------------------------- 登录 */
.login-shell {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 940px;
  margin: 46px auto;
  padding: 0 4px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(80, 35, 30, .1);
  padding: 30px 30px 24px;
}
.login-head { text-align: center; margin-bottom: 22px; }
.login-head .emblem { margin-bottom: 10px; }
.login-head h1 { font-size: 20px; letter-spacing: 1px; }
.login-head p { color: var(--muted); font-size: 12.5px; letter-spacing: 1.5px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #5d554b; font-weight: 600; }
.login-form input { height: 40px; }
.login-form .btn { margin-top: 6px; }
.login-foot { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; font-size: 11.5px; color: var(--muted); line-height: 1.55; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1000px) {
  .main-cols, .detail-cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-shell { gap: 24px; margin: 24px auto; }
}
@media (max-width: 720px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .mainnav { order: 3; width: 100%; }
  .brand-txt small { display: none; }
  .wrap { padding: 16px 12px 30px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat > b { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  .form-grid > p { grid-column: auto; }
  .page-head { align-items: flex-start; }
  .foot { flex-direction: column; gap: 4px; }
}

/* 档案清单：后续阶段的材料淡化显示 */
.muted-row td { opacity: .6; }
.tiny { font-size: 11px; opacity: .75; }

/* 重要通知 */
.notice-body { white-space: pre-wrap; line-height: 1.85; padding: 4px 18px 14px; font-size: 15px; }
.notice-imgs { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 18px 16px; }
.notice-imgs img { max-width: 260px; max-height: 200px; border-radius: 8px; border: 1px solid var(--line, #e5e7eb); object-fit: cover; }
.notice-stats { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 18px 14px; }
.notice-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px 6px; }
.chips-box { display: block; }
.chips-box .lbl { display: block; font-size: 13px; opacity: .75; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border: 1px solid var(--line, #e5e7eb);
        border-radius: 999px; font-size: 13px; cursor: pointer; user-select: none; }
.chip:hover { border-color: var(--accent, #b91c1c); }
label.check span { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.actions-row { display: flex; gap: 10px; align-items: center; padding: 12px 18px 16px; }
.full { grid-column: 1 / -1; }

/* 发布通知：分区块表单 */
.notice-form { display: flex; flex-direction: column; gap: 14px; }
.nf-body { padding: 4px 18px 16px; display: flex; flex-direction: column; gap: 16px; }
.nf-row { flex-direction: row; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.nf-field { display: flex; flex-direction: column; gap: 7px; }
.nf-field > span { font-size: 13px; font-weight: 600; color: #5d554b; display: flex; align-items: center; gap: 10px; }
.nf-half { max-width: 240px; }
.nf-hint { font-style: normal; font-weight: 400; font-size: 12px; color: #9a9084; }
.nf-input { border: 1px solid #ddd4c7; border-radius: 8px; padding: 10px 12px; font-size: 14px;
            background: #fff; color: #2c2823; outline: none; transition: border-color .15s, box-shadow .15s; }
.nf-input:focus { border-color: var(--red, #b91c1c); box-shadow: 0 0 0 3px rgba(185, 28, 28, .08); }
.nf-title { font-size: 16px; font-weight: 600; }
.nf-text { resize: vertical; min-height: 150px; line-height: 1.7; font-family: inherit; }
.nf-file { font-size: 13px; color: #5d554b; padding: 8px 0; }
.nf-file::file-selector-button { border: 1px solid #ddd4c7; background: #faf7f2; color: #5d554b;
    padding: 7px 14px; border-radius: 7px; margin-right: 12px; cursor: pointer; font-size: 13px; }
.nf-file::file-selector-button:hover { background: #f1ece5; }
.nf-mini { border: 1px solid #e2d9cc; background: #fff; color: #7a6f62; font-size: 12px;
           padding: 2px 9px; border-radius: 6px; cursor: pointer; font-weight: 400; }
.nf-mini:hover { background: #f7f3ed; color: var(--red, #b91c1c); border-color: #e0c9c6; }
.chips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.chip { background: #fff; transition: .15s; }
.chip input { display: none; }
.chip i { width: 15px; height: 15px; border: 1.5px solid #ccc2b4; border-radius: 4px; flex: 0 0 auto;
          display: inline-block; position: relative; background: #fff; }
.chip input:checked + i { background: var(--red, #b91c1c); border-color: var(--red, #b91c1c); }
.chip input:checked + i::after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
          border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(42deg); }
.chip:has(input:checked) { border-color: #e6c4c0; background: #fdf6f5; color: #8f1d18; font-weight: 600; }
.chip-line { align-self: center; border: none; padding: 0; font-size: 13.5px; color: #2c2823; }
.chip-line:hover { border: none; }
.nf-actions { display: flex; align-items: center; gap: 12px; padding: 4px 18px 18px; }
.nf-actions .btn.primary { height: 40px; padding: 0 26px; font-size: 14.5px; }

/* 表单宽度防御：避免 input 把卡片撑出横向滚动条 */
.nf-field, .nf-half { min-width: 0; }
.nf-input, .nf-file { width: 100%; max-width: 100%; box-sizing: border-box; }
.nf-body { overflow-x: hidden; }

/* 「需要完成」这类独立开关不显示选中底色 */
.chip-line:has(input:checked) { background: transparent; border: none; color: #2c2823; font-weight: 400; }

/* 通知送达进度 */
.prog { height: 6px; background: #f0eae2; border-radius: 4px; overflow: hidden; min-width: 90px; margin-bottom: 5px; }
.prog i { display: block; height: 100%; background: #c0392b; border-radius: 4px; transition: width .3s; }
.prog.ok i { background: #3f9a5e; }
