* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: #f5f6f8; color: #333; font-size: 14px; }
a { color: #4a6cf7; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea, #764ba2); }
.login-box { background: #fff; padding: 36px 40px; border-radius: 10px; width: 360px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.login-box h2 { text-align: center; margin-bottom: 24px; color: #333; font-weight: 600; }
.login-box .form-item { margin-bottom: 16px; }
.login-box label { display: block; margin-bottom: 6px; color: #666; }
.login-box input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.login-box input:focus { outline: none; border-color: #667eea; }
.login-box button { width: 100%; padding: 11px; background: #667eea; color: #fff; border: none; border-radius: 6px; font-size: 15px; cursor: pointer; margin-top: 8px; }
.login-box button:hover { background: #5568d3; }
.login-tip { text-align: center; color: #999; font-size: 12px; margin-top: 16px; }

/* 后台布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: #2b2f3a; color: #cfd2dc; }
.sidebar .logo { padding: 18px 20px; font-size: 17px; font-weight: 600; color: #fff; border-bottom: 1px solid #3a3f4b; }
.sidebar .logo small { display: block; font-size: 11px; color: #8b90a0; font-weight: 400; margin-top: 3px; }
.sidebar nav a { display: block; padding: 12px 20px; color: #cfd2dc; border-left: 3px solid transparent; }
.sidebar nav a:hover, .sidebar nav a.active { background: #353a47; color: #fff; border-left-color: #667eea; text-decoration: none; }
.main { flex: 1; display: flex; flex-direction: column; }
.topbar { height: 52px; background: #fff; border-bottom: 1px solid #e6e8eb; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.topbar .title { font-weight: 600; }
.topbar .user { color: #666; }
.topbar .user a { margin-left: 12px; }
.content { padding: 20px; flex: 1; }

/* 卡片与表格 */
.card { background: #fff; border-radius: 8px; padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card h3 { margin-bottom: 14px; font-size: 15px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 8px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat .num { font-size: 28px; font-weight: 600; color: #4a6cf7; }
.stat .label { color: #999; margin-top: 4px; font-size: 13px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; font-size: 13px; }
th { background: #fafbfc; color: #666; font-weight: 600; }
tr:hover td { background: #fafbfc; }

.btn { display: inline-block; padding: 6px 14px; border-radius: 5px; border: none; cursor: pointer; font-size: 13px; }
.btn-primary { background: #4a6cf7; color: #fff; }
.btn-primary:hover { background: #3a5ce0; color: #fff; text-decoration: none; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #d04434; color: #fff; text-decoration: none; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-link { color: #4a6cf7; background: none; border: none; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }

.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.form-inline label { color: #666; font-size: 13px; }
.form-inline input, .form-inline select { padding: 6px 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; margin-bottom: 6px; color: #555; }
.form-item input[type=text], .form-item input[type=number], .form-item textarea { width: 100%; max-width: 480px; padding: 8px 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px; }
.form-item textarea { min-height: 70px; resize: vertical; }
.empty { text-align: center; color: #aaa; padding: 40px 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #eef1ff; color: #4a6cf7; }
.tag-red { background: #fdecea; color: #e74c3c; }
.muted { color: #999; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 10px 0; }
.bar-chart .bar { flex: 1; background: #667eea; border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.bar-chart .bar span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10px; color: #999; }
.dist-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #eee; font-size: 13px; }

/* ===== 分页 ===== */
.pagination-wrap { margin-top: 18px; display: flex; justify-content: center; }
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; }
.pagination .page-item { list-style: none; }
.pagination .page-link {
  display: inline-block; min-width: 34px; padding: 6px 12px; text-align: center;
  border: 1px solid #e3e6ea; border-radius: 5px; color: #555; font-size: 13px;
  text-decoration: none; background: #fff; box-sizing: border-box;
}
.pagination .page-link:hover { border-color: #4a6cf7; color: #4a6cf7; text-decoration: none; }
.pagination .page-item.active .page-link { background: #4a6cf7; border-color: #4a6cf7; color: #fff; }
.pagination .page-item.disabled .page-link { color: #ccc; cursor: not-allowed; }

/* 表格长文本列收敛，避免撑乱布局 */
table td { word-break: break-all; }
table .col-detail { max-width: 320px; }
