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

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px; background: #1a1a2e; color: #fff; padding: 20px 0; flex-shrink: 0;
}
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 10px; }
.sidebar-header h2 { font-size: 18px; }
.nav-list { list-style: none; }
.nav-list li a {
  display: block; padding: 10px 20px; color: #ccc; text-decoration: none; transition: 0.2s;
}
.nav-list li a:hover, .nav-list li a.active { background: rgba(255,255,255,0.1); color: #fff; }

.content { flex: 1; padding: 24px; }

h1 { margin-bottom: 20px; font-size: 24px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.stat-value { font-size: 32px; font-weight: bold; color: #1a1a2e; }
.stat-label { font-size: 14px; color: #666; margin-top: 4px; }

.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input, .search-bar select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.search-bar input { flex: 1; }

.data-table { width: 100%; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.data-table th { background: #f8f9fa; padding: 10px 12px; text-align: left; font-weight: 600; font-size: 13px; color: #666; }
.data-table td { padding: 10px 12px; border-top: 1px solid #eee; font-size: 14px; }
.data-table .empty { text-align: center; color: #999; padding: 40px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.badge-online { background: #e8f5e9; color: #2e7d32; }
.badge-offline { background: #f5f5f5; color: #999; }
.badge-banned { background: #fbe9e7; color: #c62828; }

.btn {
  display: inline-block; padding: 8px 16px; background: #1a1a2e; color: #fff; border: none;
  border-radius: 4px; cursor: pointer; font-size: 14px; text-decoration: none;
}
.btn:hover { opacity: 0.9; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-danger { background: #c62828; }
.btn-cancel { background: #999; }

.text-muted { color: #999; font-size: 13px; }
.text-danger { color: #c62828; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 500; }
.form-group input[type="text"], .form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; font-family: inherit;
}
.form-group textarea { font-family: 'Consolas', 'Monaco', monospace; font-size: 13px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.detail-section { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 16px; }
.detail-section h3 { font-size: 16px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.detail-table { width: 100%; }
.detail-table td { padding: 6px 0; font-size: 14px; }
.detail-table td:first-child { color: #666; width: 100px; }
.action-buttons { display: flex; flex-direction: column; gap: 8px; }

.pagination { display: flex; gap: 4px; margin-top: 16px; justify-content: center; }
.pagination a {
  padding: 6px 12px; background: #fff; border: 1px solid #ddd; border-radius: 4px;
  text-decoration: none; color: #333; font-size: 14px;
}
.pagination a.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }

.broadcast-form { background: #fff; padding: 16px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.broadcast-form input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }

.plugin-form { background: #fff; padding: 24px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.plugin-status { font-size: 13px; }

/* ===== 用户管理 - 项目侧边栏布局 ===== */
.user-layout { display: flex; gap: 20px; align-items: flex-start; }

.project-sidebar {
  width: 200px; flex-shrink: 0; background: #fff; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); overflow: hidden;
}
.sidebar-title { font-size: 14px; padding: 12px 16px; background: #f8f9fa; margin: 0; border-bottom: 1px solid #eee; }
.project-list { list-style: none; }
.project-item { border-bottom: 1px solid #f5f5f5; }
.project-item:last-child { border-bottom: none; }
.project-item a {
  display: block; padding: 10px 16px; text-decoration: none; color: #333; font-size: 14px; transition: 0.15s;
}
.project-item a:hover { background: #f0f0ff; }
.project-item.active { background: #1a1a2e; }
.project-item.active a { color: #fff; font-weight: 500; }

.user-main { flex: 1; min-width: 0; }

/* ===== 分组相关样式 ===== */
.group-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.group-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 4px;
  white-space: nowrap;
}

.group-count {
  float: right;
  font-size: 12px;
  color: #999;
}

.group-count-online {
  color: #2e7d32;
  font-weight: 600;
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.batch-actions select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

/* 颜色选择器 */
.color-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.color-swatch.active,
.color-swatch:hover {
  border-color: #333;
}

.color-picker input[type="color"] {
  width: 32px;
  height: 32px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
}

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; padding: 10px 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .user-layout { flex-direction: column; }
  .project-sidebar { width: 100%; }
}

/* ========== Login Page ========== */
.login-page {
  background: #f0f2f5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  padding: 40px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  font-size: 24px;
  color: #1a1a2e;
  margin: 0 0 8px 0;
}

.login-header p {
  font-size: 14px;
  color: #888;
  margin: 0;
}

.login-form input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.login-form input[type="password"]:focus {
  border-color: #4a6cf7;
}

.login-form button {
  width: 100%;
  padding: 12px;
  background: #4a6cf7;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.login-form button:hover {
  background: #3b5de7;
}

.error-message {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #ff4d4f;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

/* ========== Sidebar Footer ========== */
.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid #2a2a4a;
}

.sidebar-footer a {
  color: #888;
  text-decoration: none;
  font-size: 14px;
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.sidebar-footer a:hover {
  color: #fff;
  background: #2a2a4a;
}
