/* ============================================================
   珠海市HSE科技协会 — 管理后台样式
   ============================================================ */
:root {
  --green: #0E7A63;
  --green-d: #0A5A4A;
  --green-l: #E9F5F1;
  --sb: #0C2B2A;
  --sb-2: #123B39;
  --ink: #1B333C;
  --muted: #62777F;
  --bg: #F3F6F5;
  --line: #E1EAE7;
  --r: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.65; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-d); }
img { max-width: 100%; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 226px; flex: 0 0 226px; background: var(--sb); color: #9DBCB6; position: fixed;
  top: 0; bottom: 0; left: 0; overflow-y: auto; z-index: 50; }
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: #234A45; border-radius: 3px; }
.sb-logo { padding: 14px 18px 11px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-logo b { color: #fff; font-size: 15px; display: block; line-height: 1.3; letter-spacing: .2px; }
.sb-logo span { font-size: 11px; color: #6E948C; letter-spacing: .5px; }
.sb-sec { padding: 9px 18px 2px; font-size: 10.5px; letter-spacing: 1.4px; color: #4E7A72; }
.sb-menu { padding: 1px 9px; }
.sb-menu a { display: flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 7px;
  color: #B7D2CC; font-size: 13.2px; margin-bottom: 0; line-height: 1.45; }
.sb-menu a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sb-menu a.on { background: var(--green); color: #fff; font-weight: 500; }
.sb-menu a .ic { width: 17px; text-align: center; font-size: 13px; opacity: .95; }
.sb-menu a .bdg { margin-left: auto; background: #E05252; color: #fff; font-size: 11px; border-radius: 10px;
  padding: 0 7px; line-height: 16px; min-width: 16px; text-align: center; }
.sb-foot { padding: 10px 18px 15px; font-size: 12px; color: #4E7A72; border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 8px; }
.sb-foot a { color: #6E948C; display: block; padding: 2px 0; }

.main { flex: 1; margin-left: 226px; min-width: 0; display: flex; flex-direction: column; }
.topbr { height: 58px; background: #fff; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 40; }
.topbr .tb-title { font-size: 16px; font-weight: 600; }
.topbr .tb-right { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: var(--muted); }
.topbr .tb-right a { color: var(--muted); } .topbr .tb-right a:hover { color: var(--green); }
.topbr .tb-user { color: var(--ink); font-weight: 500; }
.content { padding: 24px; max-width: 1280px; width: 100%; }

/* ---------------- 卡片/面板 ---------------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 1px 4px rgba(15,50,45,.04); margin-bottom: 20px; }
.panel-h { padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-h h3 { font-size: 15.5px; font-weight: 600; }
.panel-h .sub { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 8px; }
.panel-b { padding: 20px; }
.panel-b.p0 { padding: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 15px; }
.stat b { font-size: 27px; font-weight: 650; color: var(--ink); font-family: "DIN Alternate", "Bahnschrift", sans-serif; }
.stat b small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.stat span { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.stat.acc b { color: var(--green); }
.stat.warn b { color: #D97706; }
.stat.bad b { color: #DC5A50; }

/* ---------------- 表格 ---------------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.tbl th { text-align: left; padding: 11px 14px; background: #F7FAF9; color: #4E6A63; font-weight: 600;
  border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13px; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid #EDF3F1; vertical-align: middle; }
.tbl tr:hover td { background: #FAFDFC; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .acts { white-space: nowrap; }
.tbl .acts a, .tbl .acts button { margin-right: 8px; }
.t-cover { width: 46px; height: 34px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }

/* ---------------- 按钮 ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px;
  border-radius: 7px; border: 1px solid transparent; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: .16s; background: #fff; color: var(--ink); font-family: inherit; }
.btn-pri { background: var(--green); color: #fff !important; }
.btn-pri:hover { background: var(--green-d); }
.btn-line { border-color: #C9DBD6; color: var(--ink); }
.btn-line:hover { border-color: var(--green); color: var(--green); }
.btn-danger { border-color: #F1CBC8; color: #C0453C; }
.btn-danger:hover { background: #FDEDEC; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* ---------------- 表单 ---------------- */
.fgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px 18px; }
.fgrid .full { grid-column: 1 / -1; }
.fld label { display: block; font-size: 13px; color: #44606A; margin-bottom: 5px; font-weight: 500; }
.fld .req { color: #E05252; }
.fld input, .fld select, .fld textarea {
  width: 100%; border: 1px solid #C9DBD6; border-radius: 7px; padding: 8px 12px; font-size: 14px;
  font-family: inherit; color: var(--ink); background: #fff; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(14,122,99,.12); }
.fld textarea { resize: vertical; line-height: 1.6; }
.fld .hint { font-size: 12px; color: #8AA0A8; margin-top: 4px; }
.fld .chk { display: flex; align-items: center; gap: 8px; font-size: 14px; padding-top: 6px; }
.fld .chk input { width: auto; }
.fimg-prev { margin-top: 8px; max-height: 90px; border-radius: 6px; border: 1px solid var(--line); }
.ffile-cur { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------------- 徽章 ---------------- */
.pill { display: inline-block; padding: 2px 11px; border-radius: 20px; font-size: 12.5px; line-height: 1.8;
  white-space: nowrap; }
.pill.ok { background: #E3F5EC; color: #0B7355; }
.pill.info { background: #E8F2FB; color: #1668A5; }
.pill.warn { background: #FDF3E1; color: #B4770B; }
.pill.bad { background: #FDEDEC; color: #C0453C; }
.pill.gray { background: #EEF2F1; color: #62777F; }

/* ---------------- 工具栏/筛选 ---------------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .sp { flex: 1; }
.search-inp { border: 1px solid #C9DBD6; border-radius: 7px; padding: 8px 13px; font-size: 13.5px;
  width: 240px; font-family: inherit; }
.search-inp:focus { outline: none; border-color: var(--green); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters a { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted);
  font-size: 13px; background: #fff; }
.filters a.on { background: var(--green); border-color: var(--green); color: #fff; }
.filters a:hover { border-color: var(--green); color: var(--green); }
.filters a.on:hover { color: #fff; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; gap: 6px; justify-content: center; padding: 18px 0 6px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex;
  align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; background: #fff; color: var(--ink); }
.pager a:hover { border-color: var(--green); color: var(--green); }
.pager .cur { background: var(--green); border-color: var(--green); color: #fff; }
.pager .dis { color: #C3D0D6; pointer-events: none; }

/* ---------------- 提示 ---------------- */
.flash { border-radius: 9px; padding: 11px 16px; font-size: 13.8px; margin-bottom: 14px; }
.flash.ok { background: #E3F5EC; color: #0B7355; border: 1px solid #BCE3D2; }
.flash.error { background: #FDEDEC; color: #B23B34; border: 1px solid #F5CFCC; }
.empty { text-align: center; color: var(--muted); padding: 44px 16px; font-size: 13.5px; }

/* ---------------- 登录页 ---------------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #092E28 0%, #0E7A63 55%, #0E93A0 100%); padding: 20px; }
.login-card { width: 400px; max-width: 100%; background: #fff; border-radius: 16px; padding: 38px 34px;
  box-shadow: 0 24px 70px rgba(5,30,26,.4); }
.login-card .lc-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-card .lc-brand img { width: 46px; height: 46px; }
.login-card .lc-brand b { font-size: 17px; display: block; color: var(--ink); }
.login-card .lc-brand span { font-size: 12px; color: var(--muted); }
.login-card h2 { font-size: 19px; margin-bottom: 20px; font-weight: 600; }
.login-card .fld { margin-bottom: 15px; }
.login-card .fld input { padding: 11px 13px; }
.login-card .btn { margin-top: 8px; padding: 11px; font-size: 15px; }
.login-card .lc-foot { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--muted); }

/* ---------------- 下载/二维码区 ---------------- */
.qr-box { text-align: center; }
.qr-box img { width: 190px; height: 190px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.qr-url { font-size: 12px; color: var(--muted); word-break: break-all; margin-top: 8px; }

.dl-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.dl-row:last-child { border: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex !important; }
  .fgrid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
.menu-btn { display: none; border: 1px solid var(--line); background: #fff; border-radius: 7px;
  width: 38px; height: 38px; font-size: 17px; cursor: pointer; align-items: center; justify-content: center; }
.overlay { display: none; }
@media (max-width: 960px) { .overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 45; } }
html { -webkit-text-size-adjust: 100%; }

/* ---------------- 移动端优化（2026-09-12） ---------------- */
.dash-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
@media (max-width: 960px) {
  .panel-b.p0 { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel-b.p0 .tbl { min-width: 640px; white-space: nowrap; }
  .panel-b.p0 .tbl td, .panel-b.p0 .tbl th { white-space: nowrap; }
  .dash-2 { grid-template-columns: 1fr; gap: 16px; }
  .content { padding: 14px; }
  .topbr { padding: 0 14px; }
}


/* ================= 用户与权限 / 工作任务模块 ================= */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 8px; }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13.2px; cursor: pointer; background: #fff; transition: .18s; }
.perm-item:hover { border-color: var(--green); }
.perm-item input { width: auto; margin: 0; }
.perm-item input:checked + span { color: var(--green); font-weight: 500; }

.tprog-wrap { background: #EDF3F1; border-radius: 20px; height: 8px; overflow: hidden; min-width: 70px; }
.tprog { background: linear-gradient(90deg, #0f9d58, #37c07d); height: 8px; border-radius: 20px; transition: .3s; }

.tdetail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 20px; }
.tdetail-grid > div { display: flex; gap: 10px; font-size: 13.4px; }
.tdetail-grid .k { color: var(--muted); min-width: 64px; }
.tdetail-grid .v { color: var(--ink); font-weight: 500; }
.tdetail-body { padding: 14px 16px; background: #F7FAF9; border-radius: 8px; font-size: 13.6px;
  line-height: 1.9; white-space: pre-wrap; color: #33473F; }

.timeline { position: relative; padding-left: 22px; }
.timeline:before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: #E3EDE9; }
.tl-item { position: relative; padding: 2px 0 15px; }
.tl-dot { position: absolute; left: -22px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid #C9DBD6; box-sizing: border-box; }
.tl-dot.s-doing { border-color: #2A8BD6; }
.tl-dot.s-done { border-color: var(--green); }
.tl-dot.s-cancel { border-color: #B9C6C2; }
.tl-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13.4px; }
.tl-content { margin-top: 5px; font-size: 13.6px; color: #33473F; line-height: 1.8; white-space: pre-wrap; }

/* 任务附件 */
.att-chip { display: inline-block; padding: 5px 11px; margin: 0 8px 6px 0; border: 1px solid var(--line);
  border-radius: 6px; font-size: 12.8px; color: var(--ink); background: #fff; }
.att-chip:hover { border-color: var(--green); color: var(--green); }


/* ================= 培训名单 / 题库 / 证书预览 ================= */
.signup-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 11px 16px;
  border-bottom: 1px solid #EDF3F1; }
.signup-row:hover { background: #FAFDFC; }
.sr-main { flex: 1; min-width: 230px; font-size: 13.6px; color: var(--ink); }
.sr-main .muted { color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.sr-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sr-form input[type=number] { width: 74px; padding: 5px 8px; font-size: 13px; }
.sr-form input[type=text] { padding: 5px 9px; font-size: 13px; }
.sr-form select { padding: 5px 8px; font-size: 13px; }
.sr-form label { font-size: 12.5px; display: flex; align-items: center; gap: 4px; color: var(--muted); }
.sr-acts { display: flex; gap: 8px; }

.q-item { padding: 12px 16px; border-bottom: 1px solid #EDF3F1; }
.q-item:hover { background: #FAFDFC; }
.q-text { font-size: 13.6px; line-height: 1.7; color: var(--ink); }
.q-opts { color: #4E6A63; font-size: 13px; margin-top: 4px; line-height: 1.8; }
.q-meta { display: flex; gap: 10px; align-items: center; margin-top: 7px; font-size: 12.5px; color: var(--muted); }
details.q-edit { margin-top: 8px; }
details.q-edit summary { cursor: pointer; color: var(--green); font-size: 12.8px; }
details.q-edit > form { margin-top: 10px; padding: 12px 14px; background: #F7FAF9; border-radius: 8px; }

.cert-preview { position: relative; max-width: 720px; margin: 0 auto; background: #FFFDF7;
  border: 2px solid #D9C58A; border-radius: 14px; padding: 40px 44px; text-align: center; }
.cp-org { font-size: 15px; color: #8A6D1F; letter-spacing: 3px; }
.cp-title { font-size: 25px; font-weight: 700; color: #333; margin: 18px 0; letter-spacing: 4px; }
.cp-body { font-size: 15px; line-height: 2.4; color: #444; text-align: left; text-indent: 2em; }
.cp-meta { margin-top: 26px; font-size: 13.5px; color: #666; text-align: left; line-height: 2; }
.cp-seal { position: absolute; right: 46px; bottom: 34px; width: 118px; height: 118px;
  border: 2.5px solid #C0392B; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #C0392B; font-size: 12px; line-height: 1.6; text-align: center; opacity: .85; transform: rotate(-8deg); }
.cp-revoked { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-16deg);
  font-size: 42px; font-weight: 800; color: rgba(192, 57, 43, .32); letter-spacing: 10px;
  border: 5px solid rgba(192, 57, 43, .32); padding: 8px 28px; }

/* ===== 顶栏「协会管理」下拉（党建工作/财务管理/协会治理） ===== */
.tb-dd { position: relative; }
.tb-dd-btn { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.tb-dd-btn .ic { font-size: 14px; }
.tb-dd-btn .car { font-size: 10px; opacity: .75; }
.tb-dd-menu { display: none; position: absolute; right: 0; top: calc(100% + 12px); min-width: 200px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 32px rgba(12, 43, 56, .16); z-index: 999; }
.tb-dd-menu.open { display: block; }
.tb-dd-menu .dd-sec { font-size: 11.5px; color: #8A99A8; padding: 8px 10px 3px; letter-spacing: .5px; }
.tb-dd-menu a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px;
  color: #2B3A45; font-size: 13.5px; }
.tb-dd-menu a:hover { background: #F0F6F4; color: var(--green); }
