:root {
  --red: #c0192e;
  --red-dark: #941124;
  --red-soft: #fdecef;
  --ink: #161b26;
  --ink-2: #252c3b;
  --text: #2a3040;
  --muted: #717a8d;
  --line: #e6e9f0;
  --bg: #f3f4f7;
  --card: #ffffff;
  --green: #12855b;
  --green-soft: #e6f5ef;
  --blue: #2664d8;
  --blue-soft: #e9f0fd;
  --amber: #b87408;
  --amber-soft: #fdf3e2;
  --slate: #5c6577;
  --slate-soft: #eff1f5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 27, 38, 0.04), 0 10px 30px rgba(22, 27, 38, 0.06);
  --font: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 46%) 1fr;
  background: #f7f6f5;
}
.login-brand {
  position: relative;
  overflow: hidden;
  padding: 56px 6vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  background:
    radial-gradient(900px 500px at 85% 8%, rgba(255, 255, 255, 0.16), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(0, 0, 0, 0.28), transparent 62%),
    linear-gradient(150deg, #a8142b 0%, #c0192e 48%, #8c1023 100%);
}
.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 64px);
  pointer-events: none;
}
.brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 34px;
}
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  background: #fff;
  color: var(--red);
  border: 3px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}
.brand-mark.small { width: 38px; height: 38px; font-size: 17px; border-width: 2px; }
.login-brand h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.22;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}
.brand-desc {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.16em;
  font-size: 14px;
}
.brand-points {
  position: relative;
  z-index: 1;
  list-style: none;
  padding: 0;
  margin: 44px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13.5px;
}
.brand-points li { display: flex; align-items: center; gap: 10px; }
.brand-points i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
  flex: none;
}
.brand-foot {
  position: absolute;
  left: 6vw;
  bottom: 34px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.48);
}
.login-panel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background:
    radial-gradient(700px 300px at 100% 0%, #fbeff1, transparent 62%),
    #f7f6f5;
}
.login-panel {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 38px 36px 30px;
  box-shadow: 0 2px 4px rgba(22, 27, 38, 0.04), 0 24px 60px rgba(22, 27, 38, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.login-panel h2 { font-size: 24px; color: var(--ink); letter-spacing: 0.04em; }
.login-sub { color: var(--muted); font-size: 13px; margin: 8px 0 26px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.field input, .field select, .field textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid #dde1e9;
  background: #fbfbfc;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(192, 25, 46, 0.1);
}
.field input:disabled, .field select:disabled {
  background: #f0f1f4;
  color: #6d7585;
  cursor: not-allowed;
}
.login-panel .field + .field { margin-top: 16px; }
.form-error {
  margin: 14px 0 0;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12.5px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid #dde1e9;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: #c8ccd6; background: #fafbfc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 6px 16px rgba(192, 25, 46, 0.22);
}
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ghost { background: #fff; }
.btn.danger { color: var(--red); border-color: #f2c6ce; background: #fff; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn.block, .btn-block { width: 100%; height: 44px; margin-top: 22px; font-size: 15px; letter-spacing: 0.12em; }
.demo-block { margin-top: 28px; border-top: 1px dashed #e5e8ef; padding-top: 18px; }
.demo-title { font-size: 12px; color: #98a0b0; letter-spacing: 0.08em; margin-bottom: 10px; }
.demo-chips { display: flex; flex-direction: column; gap: 7px; }
.demo-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid #eceef4;
  background: #fafbfc;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text);
  text-align: left;
  transition: all 0.15s ease;
}
.demo-chip:hover { border-color: #e3c4ca; background: #fff8f9; }
.demo-chip b { font-weight: 600; color: var(--red); font-size: 12px; }
.demo-chip code { font-family: Consolas, monospace; color: #5c6577; font-size: 11.5px; }

/* ---------- 应用框架 ---------- */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 232px;
  flex: none;
  background: #171c28;
  color: #e8ebf2;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 120px;
  background: radial-gradient(400px 120px at 30% 0%, rgba(192, 25, 46, 0.3), transparent 70%);
  pointer-events: none;
}
.sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 24px 22px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.sidebar-brand .brand-mark.small {
  background: var(--red);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.sidebar-brand-text strong { font-size: 14.5px; letter-spacing: 0.06em; }
.sidebar-brand-text small { color: #8d97ac; font-size: 11.5px; letter-spacing: 0.22em; }
.nav-toggle {
  display: none;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  margin-right: 10px;
  flex: none;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e8ebf2;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.nav-toggle svg { width: 16px; height: 16px; }
.nav-toggle:hover { background: rgba(255, 255, 255, 0.12); }
.nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #b8c0d2;
  font-size: 13.5px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: left;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-item.active { background: rgba(192, 25, 46, 0.14); color: #fff; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: #e23b4e;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }
.sidebar-foot {
  padding: 16px 22px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11.5px;
  color: #6d7689;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#sidebarScope { color: #9aa4b8; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.page-title { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: 0.02em; }
.page-subtitle { font-size: 12px; color: var(--muted); margin-top: 3px; min-height: 17px; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.role-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.role-badge.super_admin { background: var(--red-soft); color: var(--red); }
.role-badge.sub_admin { background: var(--blue-soft); color: var(--blue); }
.role-badge.secretary { background: var(--green-soft); color: var(--green); }
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-chip .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e7ebf3, #d5dae5);
  color: #4a5365;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}
.user-chip div { display: flex; flex-direction: column; line-height: 1.3; }
.user-chip strong { font-size: 13px; color: var(--ink); font-weight: 600; }
.user-chip small { font-size: 11px; color: var(--muted); }
.content { padding: 26px 28px 48px; flex: 1; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 90px 0; color: var(--muted); font-size: 13px; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #d9dde5;
  border-top-color: var(--red);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 通用卡片 ---------- */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head h3 { font-size: 15px; color: var(--ink); letter-spacing: 0.02em; }
.panel-head .hint { font-size: 11.5px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; margin-top: 18px; }
.grid-2.equal { grid-template-columns: 1fr 1fr; }

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 24px 26px;
  background:
    radial-gradient(500px 200px at 95% 0%, rgba(255, 255, 255, 0.9), transparent 60%),
    linear-gradient(120deg, #fff 0%, #fff 55%, #fdf3f4 100%);
  border: 1px solid #f0e2e5;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #c0192e, #8c1023);
}
.hero-card h2 { font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.hero-card p { color: var(--muted); font-size: 13px; max-width: 640px; }
.hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scope-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f4f6fa;
  color: #4d5668;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #e6e9f0;
}
.scope-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(22, 27, 38, 0.08); }
.stat-icon {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #f5f6fa;
  color: var(--slate);
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.red { background: var(--red-soft); color: var(--red); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-card .stat-body { min-width: 0; }
.stat-card span { display: block; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.stat-card strong { display: block; font-size: 27px; line-height: 1.25; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card small { display: block; font-size: 11px; color: #9aa1b0; margin-top: 2px; }

.bar-list { display: flex; flex-direction: column; gap: 13px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.15fr) 2.4fr 44px;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  padding: 3px 4px;
  border-radius: 7px;
  transition: background 0.15s ease;
}
.bar-row.clickable { cursor: pointer; }
.bar-row.clickable:hover { background: #fafbfd; }
.bar-label { color: #3c4454; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; background: #f0f2f6; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #d4253b, #a8142b); transition: width 0.4s ease; }
.bar-fill.green { background: linear-gradient(90deg, #1aa474, #0f7d55); }
.bar-fill.blue { background: linear-gradient(90deg, #4b83ec, #2664d8); }
.bar-fill.slate { background: linear-gradient(90deg, #8a93a6, #5c6577); }
.bar-fill.amber { background: linear-gradient(90deg, #e0a84a, #b87408); }
.bar-value { text-align: right; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  position: relative;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}
.donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(22, 27, 38, 0.06);
}
.donut-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
.donut-center strong { font-size: 22px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.donut-center small { font-size: 11px; color: var(--muted); margin-top: 2px; }
.legend { display: flex; flex-direction: column; gap: 9px; min-width: 150px; flex: 1; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #4d5668; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-item b { margin-left: auto; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th {
  text-align: left;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.03em;
}
.mini-table td {
  padding: 10px;
  border-bottom: 1px solid #f1f3f7;
  font-size: 12.5px;
  color: var(--text);
}
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table .strong { font-weight: 600; color: var(--ink); }

/* ---------- 工具栏 / 表格 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.input, .select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #dde1e9;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(192, 25, 46, 0.08); }
.input.search { width: 220px; }
.select { padding-right: 28px; cursor: pointer; }
.table-panel { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th {
  text-align: left;
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f3f7;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:hover { background: #fcfcfd; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-name { display: flex; align-items: center; gap: 9px; }
.table .cell-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  background: #f0f2f7; color: #5a6376; flex: none;
}
.table .cell-name strong { font-weight: 600; color: var(--ink); }
.table .col-name { min-width: 78px; }
.table .col-name strong { white-space: nowrap; }
.table .mono { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12.5px; color: #4e5668; }
.table .right { text-align: right; }
.table .actions { display: flex; justify-content: flex-end; gap: 4px; }
.link-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  white-space: nowrap;
}
.link-btn:hover { background: var(--blue-soft); }
.link-btn.danger { color: var(--red); }
.link-btn.danger:hover { background: var(--red-soft); }
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.table-foot .total { font-size: 12.5px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 8px; }
.pager .btn { height: 32px; padding: 0 12px; font-size: 12.5px; }
.pager .page-info { font-size: 12.5px; color: #4d5668; font-variant-numeric: tabular-nums; padding: 0 4px; }
.empty-state {
  padding: 64px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.empty-state p { font-size: 12.5px; }

.pill {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--slate-soft);
  color: var(--slate);
  white-space: nowrap;
}
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.slate { background: var(--slate-soft); color: var(--slate); }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.perm-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  background: #f3f5f9;
  color: #5a6376;
  font-size: 11px;
  white-space: nowrap;
}

/* ---------- 弹窗 / 表单 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(16, 20, 30, 0.46);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px 40px;
  overflow-y: auto;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(16, 20, 30, 0.24);
  overflow: hidden;
  animation: modalUp 0.2s ease;
}
.modal.wide { width: min(760px, 100%); }
@keyframes modalUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16px; color: var(--ink); }
.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { background: #f3f4f7; color: var(--ink); }
.modal-body { padding: 22px 24px; max-height: 66vh; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 24px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 18px;
}
.form-grid .span-2 { grid-column: span 2; }
.form-section {
  grid-column: span 2;
  font-size: 12px;
  font-weight: 600;
  color: #8a93a5;
  letter-spacing: 0.08em;
  padding-top: 4px;
  border-top: 1px dashed #eef0f4;
  margin-top: 2px;
}
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid #e7eaf0;
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
  font-size: 12.5px;
  transition: all 0.13s ease;
}
.checkbox-item:hover { border-color: #d4d9e2; background: #fff; }
.checkbox-item input { margin: 2px 0 0; accent-color: var(--red); }
.checkbox-item span { display: flex; flex-direction: column; }
.checkbox-item b { font-weight: 600; color: var(--ink); font-size: 12.5px; }
.checkbox-item small { color: #98a0b0; font-size: 10.5px; }
.modal-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f6f8fc;
  color: #667085;
  font-size: 12px;
  line-height: 1.6;
}

/* 详情 */
.detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.detail-head .avatar-lg {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #d0344a, #941124);
  flex: none;
}
.detail-head h4 { font-size: 18px; color: var(--ink); margin-bottom: 4px; }
.detail-head .detail-sub { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid #f0f2f6;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 10px;
  border-bottom: 1px solid #f0f2f6;
}
.detail-item:nth-child(odd) { border-right: 1px solid #f0f2f6; }
.detail-item span { font-size: 11.5px; color: var(--muted); }
.detail-item b { font-size: 13px; color: var(--ink); font-weight: 600; word-break: break-all; }

/* ---------- 提示 ---------- */
.toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}
.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 11px 15px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(22, 27, 38, 0.14);
  font-size: 12.5px;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  animation: toastIn 0.22s ease;
  border-left: 3px solid var(--green);
}
.toast.error { border-left-color: var(--red); }
.toast .toast-icon { font-weight: 700; color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- 响应式 ---------- */
@media (max-width: 1150px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2.equal { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { padding: 40px 28px; min-height: 300px; }
  .login-brand h1 { font-size: 34px; }
  .brand-points, .brand-foot { display: none; }
  .login-panel-wrap { padding: 30px 18px 50px; }
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding-right: 10px;
  }
  .sidebar-brand { border-bottom: 0; padding: 14px 18px; flex: 1; min-width: 0; }
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    flex: 0 0 100%;
    width: 100%;
    flex-direction: column;
    padding: 6px 12px 12px;
    gap: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  .sidebar.nav-open .nav { display: flex; }
  .nav-item { width: 100%; padding: 10px 12px; white-space: normal; border-radius: 8px; }
  .nav-item.active::before { top: 8px; bottom: 8px; left: 0; right: auto; width: 3px; height: auto; }
  .sidebar-foot { display: none; }
  .topbar { padding: 14px 18px; }
  .content { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2, .form-section { grid-column: span 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item:nth-child(odd) { border-right: 0; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .input.search { width: 100%; }
  .toolbar-left { width: 100%; }
  .toolbar-left .input, .toolbar-left .select { flex: 1; min-width: 100px; }
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .topbar-right { width: 100%; justify-content: space-between; gap: 8px; }
  .role-badge { display: none; }
  .user-chip div { display: none; }
}

/* ================= v2 新增样式 ================= */
.cell-sub { display: block; font-size: 11px; color: #9aa1b0; line-height: 1.5; margin-top: 2px; font-weight: 400; }
.cell-sub.mono { font-family: Consolas, "SFMono-Regular", monospace; }
.cell-sub-inline { font-size: 10.5px; color: #98a0b0; margin-left: 6px; font-family: Consolas, monospace; }
.warn-text { color: var(--amber); font-size: 12px; }

/* 智慧团建 · 组织信息 */
.org-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.org-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fbfcfd; }
.org-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.org-card-head strong { font-size: 13.5px; color: var(--ink); line-height: 1.4; }
.org-card-meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.org-card-foot { font-size: 12px; color: #4d5668; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #eef0f4; }

/* 团费批次 */
.dues-periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dues-period {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  text-align: left; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: #fbfcfd; cursor: pointer; transition: all 0.15s ease;
}
.dues-period:hover { border-color: #e3c4ca; background: #fffafb; }
.dues-period.active { border-color: var(--red); background: var(--red-soft); box-shadow: 0 0 0 3px rgba(192, 25, 46, 0.07); }
.dues-period-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dues-period-main strong { font-size: 13.5px; color: var(--ink); }
.dues-period-main small { font-size: 11.5px; color: var(--muted); }
.dues-rate { text-align: right; flex: none; }
.dues-rate b { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.dues-rate small { display: block; font-size: 11px; color: var(--muted); }
.mini-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  background: #fbfcfd; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.mini-stats div { display: flex; flex-direction: column; gap: 4px; }
.mini-stats span { font-size: 11.5px; color: var(--muted); }
.mini-stats b { font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mini-stats b.green { color: var(--green); }
.mini-stats b.red { color: var(--red); }

/* 首页待办 */
.todo-list { display: flex; flex-direction: column; gap: 9px; }
.todo-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 10px; border: 1px solid #eef0f4; background: #fbfcfd;
  cursor: pointer; transition: all 0.15s ease;
}
.todo-item:hover { border-color: #e3c4ca; background: #fffafb; transform: translateY(-1px); }
.todo-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--slate); }
.todo-dot.amber { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.todo-dot.blue { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.todo-dot.green { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.todo-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.todo-main b { font-size: 13px; color: var(--ink); }
.todo-main small { font-size: 11.5px; color: var(--muted); }
.todo-value { font-size: 20px; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }

/* 团员档案 */
.archive-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.archive-picker { position: sticky; top: 90px; }
.archive-member-list { display: flex; flex-direction: column; gap: 4px; max-height: 64vh; overflow-y: auto; }
.archive-member {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 9px; border: 1px solid transparent; background: transparent; cursor: pointer;
  transition: all 0.13s ease;
}
.archive-member:hover { background: #f7f8fb; }
.archive-member.active { background: var(--red-soft); border-color: #f2d3d9; }
.archive-member-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.archive-member-main strong { font-size: 13px; color: var(--ink); }
.archive-member-main small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-photo-row { display: flex; align-items: center; gap: 18px; margin-top: 4px; }
.archive-photo {
  width: 96px; height: 120px; border-radius: 10px; overflow: hidden; flex: none;
  background: linear-gradient(145deg, #f0f2f7, #e2e6ee); display: grid; place-items: center;
  color: #8a93a5; font-size: 26px; font-weight: 700; border: 1px solid var(--line);
}
.archive-photo img { width: 100%; height: 100%; object-fit: cover; }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid #eef0f4; border-radius: 10px; background: #fbfcfd;
}
.file-icon {
  width: 40px; height: 40px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: #eef1f7; color: #5a6376; font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
}
.file-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.file-main strong { font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-main small { font-size: 11px; color: var(--muted); }

/* 标签页 */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 10px 16px; border: 0; background: transparent; color: var(--muted);
  font-size: 13.5px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--red); border-bottom-color: var(--red); }

/* 批量操作与结果 */
.batch-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px;
  border-radius: 10px; background: #f6f8fc; border: 1px solid #e8edf5; font-size: 12.5px; color: #4d5668;
}
.batch-bar .hint { font-size: 11.5px; color: #98a0b0; }
.batch-bar #userSelInfo { font-weight: 600; color: var(--ink); }
.batch-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.batch-summary div {
  padding: 12px 14px; border-radius: 10px; background: #fbfcfd; border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.batch-summary span { font-size: 11.5px; color: var(--muted); }
.batch-summary b { font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
.batch-summary b.green { color: var(--green); }
.batch-summary b.red { color: var(--red); }
.batch-result-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.batch-result {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-radius: 8px; font-size: 12px; border: 1px solid #eef0f4; background: #fbfcfd;
}
.batch-result b { font-weight: 600; font-size: 11.5px; text-align: right; }
.batch-result.ok { border-color: #d5ece2; background: #f4fbf8; }
.batch-result.ok b { color: var(--green); }
.batch-result.fail { border-color: #f4d7dc; background: #fff6f7; }
.batch-result.fail b { color: var(--red); }

.check-col { width: 44px; text-align: center !important; }
.check-col input { accent-color: var(--red); width: 15px; height: 15px; cursor: pointer; }
.selection-note { font-size: 12.5px; color: var(--muted); }
.log-detail { max-width: 340px; white-space: normal; word-break: break-word; font-size: 12px; color: #5a6376; }

@media (max-width: 1150px) {
  .org-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .archive-layout { grid-template-columns: 1fr; }
  .archive-picker { position: static; }
  .archive-member-list { max-height: 260px; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .org-grid, .dues-periods { grid-template-columns: 1fr; }
  .toolbar-right { width: 100%; justify-content: flex-start; }
  .batch-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
}
