/* ===== 校园帮后台公共样式 ===== */
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background:#f4f6f9; color:#333; font-size:14px; }
a { color:#4a7cf7; text-decoration:none; }
a:hover { opacity:.85; }
ul,li { list-style:none; }

/* ===== 布局 ===== */
.layout { display:flex; min-height:100vh; }
.sidebar { width:210px; background:#1f2937; color:#cbd5e1; flex-shrink:0; display:flex; flex-direction:column; }
.sidebar .logo { padding:20px; font-size:18px; color:#fff; font-weight:600; border-bottom:1px solid #374151; }
.sidebar .menu { flex:1; padding:10px 0; }
.sidebar .menu a { display:block; padding:12px 22px; color:#cbd5e1; }
.sidebar .menu a:hover { background:#374151; color:#fff; }
.sidebar .menu a.active { background:#4a7cf7; color:#fff; }
.sidebar .menu .group-title { padding:14px 22px 6px; font-size:12px; color:#6b7280; }
.main { flex:1; display:flex; flex-direction:column; min-width:0; }
.topbar { height:56px; background:#fff; display:flex; align-items:center; justify-content:space-between; padding:0 24px; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.topbar .crumb { color:#6b7280; }
.topbar .user a { margin-left:14px; }
.content { padding:24px; flex:1; }

/* ===== 卡片 ===== */
.card { background:#fff; border-radius:8px; padding:20px; box-shadow:0 1px 3px rgba(0,0,0,.05); margin-bottom:20px; }
.card-title { font-size:16px; font-weight:600; margin-bottom:16px; }

/* ===== 统计 ===== */
.stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:20px; }
.stat-box { background:#fff; border-radius:8px; padding:24px; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.stat-box .num { font-size:30px; font-weight:700; color:#4a7cf7; }
.stat-box .label { color:#6b7280; margin-top:6px; }

/* ===== 表格 ===== */
table.data { width:100%; border-collapse:collapse; background:#fff; }
table.data th, table.data td { padding:12px; text-align:left; border-bottom:1px solid #eef0f4; }
table.data th { background:#f9fafb; color:#6b7280; font-weight:600; }
table.data tr:hover { background:#f9fafb; }
.thumb { width:60px; height:40px; object-fit:cover; border-radius:4px; }

/* ===== 按钮 ===== */
.btn { display:inline-block; padding:7px 16px; border:none; border-radius:4px; cursor:pointer; font-size:14px; background:#e5e7eb; color:#333; }
.btn:hover { opacity:.85; }
.btn-primary { background:#4a7cf7; color:#fff; }
.btn-danger { background:#ef4444; color:#fff; }
.btn-sm { padding:4px 10px; font-size:12px; }
.btn-success { background:#10b981; color:#fff; }
.btn-warning { background:#f59e0b; color:#fff; }

/* ===== 表单 ===== */
.form-row { margin-bottom:16px; }
.form-row label { display:block; margin-bottom:6px; font-weight:600; color:#374151; }
.form-row label .req { color:#ef4444; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=number], .form-row textarea, .form-row select {
  width:100%; padding:9px 12px; border:1px solid #d1d5db; border-radius:4px; font-size:14px; font-family:inherit;
}
.form-row textarea { min-height:120px; resize:vertical; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline:none; border-color:#4a7cf7; }
.form-actions { margin-top:24px; display:flex; gap:10px; }
.help { color:#9ca3af; font-size:12px; margin-top:4px; }

/* 开关 */
.switch { position:relative; display:inline-block; width:46px; height:24px; }
.switch input { display:none; }
.switch span { position:absolute; inset:0; background:#cbd5e1; border-radius:24px; transition:.3s; cursor:pointer; }
.switch span:before { content:''; position:absolute; width:18px; height:18px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.3s; }
.switch input:checked + span { background:#10b981; }
.switch input:checked + span:before { transform:translateX(22px); }

/* ===== 状态标签 ===== */
.tag { display:inline-block; padding:2px 8px; border-radius:10px; font-size:12px; }
.tag-on { background:#dcfce7; color:#16a34a; }
.tag-off { background:#fee2e2; color:#dc2626; }

/* ===== 页面标题 ===== */
.page-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.page-head h2 { font-size:20px; }

/* ===== 筛选栏 ===== */
.filter-bar { display:flex; gap:12px; align-items:center; margin-bottom:16px; flex-wrap:wrap; }
.filter-bar select, .filter-bar input { padding:8px 12px; border:1px solid #d1d5db; border-radius:4px; }

/* ===== 分页 ===== */
.pager { margin-top:16px; text-align:center; }
.pager a, .pager span { display:inline-block; padding:6px 12px; margin:0 2px; border:1px solid #d1d5db; border-radius:4px; }
.pager .cur { background:#4a7cf7; color:#fff; border-color:#4a7cf7; }

/* ===== 登录页 ===== */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#4a7cf7,#7c3aed); }
.login-box { background:#fff; padding:40px; border-radius:12px; width:360px; box-shadow:0 10px 40px rgba(0,0,0,.15); }
.login-box h2 { text-align:center; margin-bottom:24px; color:#1f2937; }
.login-box .btn-primary { width:100%; padding:11px; }
.login-box .tip { color:#9ca3af; font-size:12px; text-align:center; margin-top:14px; }

/* ===== 图片预览 ===== */
.img-preview { display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }
.img-preview img { width:100px; height:100px; object-fit:cover; border-radius:4px; border:1px solid #e5e7eb; }
.img-item { position:relative; }
.img-item .del { position:absolute; top:-6px; right:-6px; width:20px; height:20px; background:#ef4444; color:#fff; border-radius:50%; text-align:center; line-height:20px; cursor:pointer; font-size:12px; }

/* ===== 编辑器容器 ===== */
#editor-container { border:1px solid #d1d5db; border-radius:4px; }
#editor-toolbar { border-bottom:1px solid #d1d5db; }

/* ===== 空状态 ===== */
.empty { text-align:center; padding:40px; color:#9ca3af; }
