/* ================= 全局变量与基础 ================= */
:root {
  --primary: #4f6ef7;
  --primary-dark: #3a54d6;
  --primary-light: #eef1fe;
  --success: #2eb872;
  --warning: #f5a623;
  --danger: #f05656;
  --info: #4aa8e8;
  --text: #2b3044;
  --text-light: #7b8199;
  --border: #e8eaf2;
  --bg: #f4f6fb;
  --sidebar-bg: #1f2544;
  --sidebar-active: #4f6ef7;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(40, 60, 120, .08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
html { overflow-y: scroll; scrollbar-gutter: stable; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { text-decoration: none; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c7cde0; border-radius: 4px; }

/* ================= 登录页 ================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #5b7bf7 0%, #7a5cf0 50%, #9a5cf0 100%);
  padding: 20px;
}
.login-wrap {
  width: 940px;
  max-width: 100%;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  box-shadow: 0 24px 70px rgba(30, 40, 100, .35);
  min-height: 560px;
}
.login-banner {
  flex: 1.05;
  background: linear-gradient(160deg, #4f6ef7, #6d4ee8);
  color: #fff;
  padding: 54px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-banner .brand h1 { font-size: 27px; line-height: 1.4; }
.login-banner .brand p { margin-top: 16px; opacity: .85; line-height: 1.9; font-size: 13px; }
.login-banner .stats { display: flex; gap: 26px; }
.login-banner .stats .num { font-size: 26px; font-weight: 700; }
.login-banner .stats .lab { font-size: 12px; opacity: .8; margin-top: 2px; }
.login-banner .deco { font-size: 60px; opacity: .25; align-self: flex-end; }
.login-panel {
  flex: 1;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-panel h2 { font-size: 22px; margin-bottom: 6px; }
.login-panel .sub { color: var(--text-light); font-size: 13px; margin-bottom: 26px; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tabs .tab {
  padding: 10px 4px; margin-right: 28px; cursor: pointer;
  color: var(--text-light); font-size: 15px; position: relative;
}
.tabs .tab.active { color: var(--primary); font-weight: 600; }
.tabs .tab.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--primary); border-radius: 2px;
}

/* ================= 表单 ================= */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-item { display: flex; flex-direction: column; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 13px; color: var(--text); margin-bottom: 6px; }
.form-item label .req { color: var(--danger); margin-right: 2px; }
.form-item input, .form-item select, .form-item textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
  transition: border .2s, box-shadow .2s;
  width: 100%;
}
.form-item textarea { resize: vertical; min-height: 76px; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, .12);
}
.form-item input:disabled { background: #f5f6fa; color: var(--text-light); }
/* 浏览器自动填充时保持与普通输入框一致的外观 */
.form-item input:-webkit-autofill,
.form-item input:-webkit-autofill:hover,
.form-item input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: normal;
}
.form-item input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset, 0 0 0 3px rgba(79, 110, 247, .12);
  border-color: var(--primary);
}
/* 密码框与普通输入框使用完全相同的字体和字距 */
.form-item input[type="password"] {
  font-family: inherit;
  font-size: 14px;
  letter-spacing: normal;
}
.form-tip { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* 密码显示/隐藏 */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 42px; }
/* 隐藏浏览器自带的密码显示按钮，只保留自定义小眼睛 */
.form-item input::-ms-reveal,
.form-item input::-ms-clear { display: none; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: none; background: none; border-radius: 6px;
  color: var(--text-light); cursor: pointer;
}
.pwd-eye:hover { color: var(--primary); background: rgba(79, 110, 247, .08); }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all .18s;
  background: #fff;
  color: var(--text);
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.94); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-default { border-color: var(--border); color: var(--text); background: #fff; }
.btn-default:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-link {
  background: none; border: none; color: var(--primary);
  padding: 2px 5px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }

/* ================= 后台整体布局 ================= */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px;
  background: var(--sidebar-bg);
  color: #b7bdd8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
}
.sidebar .logo {
  padding: 22px 22px 18px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar .logo .icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #5b7bf7, #8a5cf0);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.sidebar .menu { flex: 1; padding: 14px 12px; overflow-y: auto; }
.menu-group-title { font-size: 11px; color: #6b7296; padding: 12px 12px 6px; letter-spacing: 1px; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 3px;
  font-size: 14px;
  transition: all .15s;
}
.menu-item .m-icon { width: 18px; text-align: center; font-size: 15px; }
.menu-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(79,110,247,.4); }
.sidebar .side-foot { padding: 14px 20px; font-size: 11px; color: #6b7296; border-top: 1px solid rgba(255,255,255,.07); }

.main { flex: 1; margin-left: 224px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px;
  background: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  box-shadow: 0 1px 0 var(--border);
  position: sticky; top: 0; z-index: 40;
}
.topbar .page-title { font-size: 17px; font-weight: 600; }
.topbar .user-area { display: flex; align-items: center; gap: 14px; }
.topbar .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #5b7bf7, #8a5cf0);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.topbar .uname { font-size: 14px; }
.topbar .urole { font-size: 12px; color: var(--text-light); }
.content { padding: 22px 26px 40px; flex: 1; }

/* ================= 卡片/统计块 ================= */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.card + .card { margin-top: 18px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-head h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-head h3::before {
  content: ''; width: 4px; height: 16px; background: var(--primary); border-radius: 2px;
}
.card-head .tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; display: flex; align-items: center; gap: 16px;
}
.stat-card .s-icon {
  width: 52px; height: 52px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.s-icon.blue { background: #e8edff; color: #4f6ef7; }
.s-icon.green { background: #e3f7ee; color: #2eb872; }
.s-icon.orange { background: #fff2dd; color: #f5a623; }
.s-icon.red { background: #fdeaea; color: #f05656; }
.s-icon.purple { background: #f0e8ff; color: #8a5cf0; }
.s-icon.cyan { background: #e0f4fc; color: #4aa8e8; }
.stat-card .s-val { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-card .s-lab { color: var(--text-light); font-size: 13px; margin-top: 3px; }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 340px; }

/* ================= 表格 ================= */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th {
  background: #f8f9fd;
  color: var(--text-light);
  font-weight: 600;
  white-space: nowrap;
}
.data-table tbody tr:hover { background: #fafbff; }
.data-table td.ops { white-space: nowrap; vertical-align: middle; }
.data-table td.ops > * + * { margin-left: 6px; }
.data-table td.nowrap { white-space: nowrap; }
.data-table .col-main { color: var(--text); font-weight: 600; }
.data-table .sub-text { color: var(--text-light); font-size: 12px; margin-top:2px; }

/* ================= 徽章标签 ================= */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap;
}
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: #e3f7ee; color: #1e9d5e; }
.badge-warning { background: #fff2dd; color: #d18a10; }
.badge-danger { background: #fdeaea; color: #e03e3e; }
.badge-info { background: #e4f3fc; color: #2f88c4; }
.badge-gray { background: #eef0f6; color: #7b8199; }

/* ================= 筛选栏 ================= */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px;
}
.filter-bar input, .filter-bar select {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; outline: none; font-family: inherit; background: #fff;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }
.filter-bar .spacer { flex: 1; }

/* ================= 弹窗 ================= */
.modal-mask {
  position: fixed; inset: 0; background: rgba(30,36,68,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px;
  width: 620px; max-width: 100%; max-height: 90vh;
  display: flex; flex-direction: column;
  animation: pop .18s ease;
}
.modal.lg { width: 820px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 16px; }
.modal-head .close { cursor: pointer; font-size: 20px; color: var(--text-light); border: none; background: none; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ================= 社团卡片/公告/留言 ================= */
.club-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.club-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; cursor: pointer; transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 10px;
}
.club-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(40,60,120,.14); }
.club-card .cc-top { display: flex; align-items: center; gap: 12px; }
.club-card .cc-logo {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, #5b7bf7, #8a5cf0);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 21px;
  flex-shrink: 0;
}
.club-card .cc-name { font-size: 16px; font-weight: 600; }
.club-card .cc-intro {
  color: var(--text-light); font-size: 13px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.club-card .cc-meta { display: flex; gap: 14px; color: var(--text-light); font-size: 12px; margin-top: auto; }

.ann-list { display: flex; flex-direction: column; gap: 12px; }
.ann-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px;
  cursor: pointer; transition: border .15s, background .15s;
}
.ann-item:hover { border-color: var(--primary); background: #fafbff; }
.ann-item .ai-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ann-item .ai-meta { color: var(--text-light); font-size: 12px; margin-top 6px; margin-top: 7px; }
.ann-item .ai-content { color: var(--text-light); font-size: 13px; margin-top: 8px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.msg-item { border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.msg-item .mi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.msg-item .mi-user { font-weight: 600; }
.msg-item .mi-time { color: var(--text-light); font-size: 12px; }
.msg-item .mi-content { line-height: 1.7; }
.msg-item .mi-reply {
  margin-top: 12px; padding: 12px 14px; background: #f6f8ff; border-radius: 8px;
  border-left: 3px solid var(--primary); line-height: 1.7;
}
.msg-item .mi-reply .r-lab { color: var(--primary-dark); font-weight: 600; font-size: 12px; margin-bottom: 4px; }

.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 30px; }
.detail-grid .di-item { display: flex; gap: 10px; font-size: 13.5px; }
.detail-grid .di-item .lab { color: var(--text-light); width: 76px; flex-shrink: 0; }
.detail-block { margin-top: 18px; }
.detail-block h4 { font-size: 14px; margin-bottom: 10px; color: var(--text); }
.detail-block p { line-height: 1.9; color: #4a4f68; white-space: pre-wrap; }

.empty {
  text-align: center; padding: 50px 20px; color: var(--text-light);
}
.empty .e-icon { font-size: 42px; opacity: .4; margin-bottom: 10px; }

/* 进度条 */
.progress { height: 7px; background: #eef0f6; border-radius: 4px; overflow: hidden; min-width: 90px; }
.progress .bar { height: 100%; background: linear-gradient(90deg, #5b7bf7, #8a5cf0); border-radius: 4px; }

/* ================= Toast ================= */
#toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 11px 22px; border-radius: 8px; color: #fff; font-size: 14px;
  background: #4a4f68; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: 0; transform: translateY(-12px); transition: all .28s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: #5a617e; }

/* ================= 通用小元素 ================= */
.sub-text { color: var(--text-light); font-size: 12px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pending-hint {
  margin-top: 14px; padding: 10px 14px; border-radius: 8px;
  background: #fff8e6; border: 1px solid #ffe1a8; color: #a9761a; font-size: 13px;
}

@media (max-width: 1100px) {
  .stat-grid, .club-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
}

/* 提示条 */
.tip-bar { padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.tip-bar.warn { background: #fff7e6; color: #b26a00; border: 1px solid #ffe1a8; }
.tip-bar.ok { background: #edf9f1; color: #1f7a45; border: 1px solid #bfe8cd; }

/* 活动管理：有待审核报名 / 待签到的行高亮 */
.data-table tr.row-attention { background: #fffaf0; }
.data-table tr.row-attention td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.data-table tr.row-attention:hover { background: #fff4e0; }
.need-dot {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px;
  background: #fff1e0; color: #b26a00; border: 1px solid #ffd9a8;
  font-size: 12px; font-weight: 400; vertical-align: middle;
}
