* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f6fa; color: #333; }

/* 登录页 */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 2px 20px rgba(0,0,0,0.08); width: 380px; }
.login-box h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; color: #111; }
.login-box p { font-size: 14px; color: #888; margin-bottom: 28px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #fff; border-right: 1px solid #eee; padding: 20px 0; position: fixed; top: 0; left: 0; height: 100vh; }
.sidebar .logo { padding: 0 20px 20px; font-size: 18px; font-weight: 700; color: #111; border-bottom: 1px solid #eee; }
.sidebar nav { margin-top: 12px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 14px; color: #555; text-decoration: none; cursor: pointer; }
.sidebar nav a:hover, .sidebar nav a.active { background: #f0f4ff; color: #4361ee; }
.main { margin-left: 220px; padding: 30px; flex: 1; }

/* 页面头 */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h2 { font-size: 20px; font-weight: 600; }

/* 卡片 */
.card { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.stat-card .label { font-size: 13px; color: #888; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #111; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 12px; color: #888; border-bottom: 1px solid #eee; font-weight: 500; }
td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; color: #333; }
tr:hover td { background: #fafafa; }

/* 按钮 */
.btn { padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 500; }
.btn-primary { background: #4361ee; color: #fff; }
.btn-primary:hover { background: #3451d1; }
.btn-danger { background: #fff; color: #e53e3e; border: 1px solid #e53e3e; }
.btn-danger:hover { background: #fff5f5; }
.btn-ghost { background: #f5f6fa; color: #555; }
.btn-ghost:hover { background: #eee; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #555; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; color: #333; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: #4361ee;
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* 模态框 */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal.hidden { display: none; }
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); }
.modal-box { background: #fff; border-radius: 12px; padding: 28px; width: 500px; position: relative; z-index: 1; max-height: 90vh; overflow-y: auto; }
.modal-box h3 { font-size: 16px; font-weight: 600; margin-bottom: 20px; }

/* 徽章 */
.badge { padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 500; }
.badge-green { background: #e6f9f0; color: #2f9e44; }
.badge-blue { background: #e7f0ff; color: #4361ee; }
.badge-gray { background: #f0f0f0; color: #888; }

/* 代码框 */
.code-box { background: #f5f6fa; border: 1px solid #eee; border-radius: 6px; padding: 12px; font-family: monospace; font-size: 12px; word-break: break-all; color: #333; }

/* 分页 */
.pagination { display: flex; align-items: center; gap: 8px; margin-top: 16px; justify-content: flex-end; }
.pagination button { padding: 4px 10px; border: 1px solid #ddd; border-radius: 4px; background: #fff; cursor: pointer; font-size: 13px; }
.pagination button.active { background: #4361ee; color: #fff; border-color: #4361ee; }

/* 空状态 */
.empty { text-align: center; padding: 40px; color: #aaa; font-size: 14px; }

/* 提示 */
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: #fff5f5; color: #e53e3e; border: 1px solid #fed7d7; }
.alert-success { background: #f0fff4; color: #2f9e44; border: 1px solid #c3e6cb; }

.hidden { display: none !important; }
