* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
}

/* 登录页面 */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 380px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  font-size: 24px;
  color: #333;
  margin-bottom: 8px;
}

.login-header p {
  color: #666;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.captcha-row {
  display: flex;
  gap: 10px;
}

.captcha-row input {
  flex: 1;
}

#captchaCanvas {
  background: #f0f0f0;
  border-radius: 4px;
  cursor: pointer;
}

.error-message {
  color: #e74c3c;
  font-size: 13px;
  margin-bottom: 15px;
  min-height: 20px;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 0.3s;
}

.btn-login:hover {
  opacity: 0.9;
}

/* 管理后台布局 */
.admin-container {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  background: #2c3e50;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px;
  background: #1a252f;
  text-align: center;
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 15px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  color: #ecf0f1;
  text-decoration: none;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255,255,255,0.1);
  border-left-color: #667eea;
}

.nav-icon {
  margin-right: 10px;
  font-size: 18px;
}

.sidebar-footer {
  padding: 15px 20px;
  background: #1a252f;
  font-size: 13px;
}

.sidebar-footer span {
  display: block;
  margin-bottom: 10px;
  color: #bdc3c7;
}

.btn-logout {
  width: 100%;
  padding: 10px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-logout:hover {
  background: #c0392b;
}

/* 主内容区 */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-header {
  padding: 20px 30px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  font-size: 20px;
  font-weight: 500;
}

.btn-view-site {
  padding: 10px 20px;
  background: #667eea;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-view-site:hover {
  background: #5568d3;
}

.admin-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

/* 控制台 */
.dashboard-cards {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  flex: 1;
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
}

.card-icon {
  font-size: 40px;
  margin-right: 20px;
}

.card-info {
  display: flex;
  flex-direction: column;
}

.card-value {
  font-size: 28px;
  font-weight: 600;
  color: #333;
}

.card-label {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

.system-info {
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.system-info h3 {
  margin-bottom: 15px;
  font-size: 16px;
  color: #333;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
}

.info-table td {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.info-table td:first-child {
  color: #666;
  width: 120px;
}

/* 用户管理 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header h2 {
  font-size: 18px;
}

.btn-add {
  padding: 10px 20px;
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-add:hover {
  background: #219a52;
}

.data-table {
  width: 100%;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border-collapse: collapse;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 15px 20px;
  text-align: left;
}

.data-table th {
  background: #f8f9fa;
  font-weight: 500;
  color: #555;
  font-size: 14px;
}

.data-table tr:not(:last-child) td {
  border-bottom: 1px solid #eee;
}

.data-table .role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
}

.role-badge.super_admin {
  background: #ffeaa7;
  color: #d63031;
}

.role-badge.admin {
  background: #dfe6e9;
  color: #2d3436;
}

.btn-edit,
.btn-delete {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  margin-right: 8px;
}

.btn-edit {
  background: #3498db;
  color: #fff;
}

.btn-delete {
  background: #e74c3c;
  color: #fff;
}

.btn-edit:hover {
  background: #2980b9;
}

.btn-delete:hover {
  background: #c0392b;
}

/* 修改密码 */
.profile-box {
  max-width: 450px;
  background: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.profile-box h2 {
  margin-bottom: 25px;
  font-size: 18px;
}

.form-error {
  color: #e74c3c;
  font-size: 13px;
  margin-bottom: 15px;
}

.form-success {
  color: #27ae60;
  font-size: 13px;
  margin-bottom: 15px;
}

.btn-submit {
  padding: 12px 30px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-submit:hover {
  background: #5568d3;
}

/* 弹窗 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 10px;
  width: 400px;
  max-width: 90%;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.modal-close:hover {
  color: #333;
}

#userForm {
  padding: 20px;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-cancel {
  padding: 10px 20px;
  background: #95a5a6;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-confirm {
  padding: 10px 20px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-cancel:hover {
  background: #7f8c8d;
}

.btn-confirm:hover {
  background: #5568d3;
}

/* 响应式 */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 60px;
  }
  
  .sidebar-header h2,
  .nav-item span,
  .sidebar-footer span,
  .btn-logout span {
    display: none;
  }
  
  .nav-item {
    justify-content: center;
    padding: 15px;
  }
  
  .nav-icon {
    margin-right: 0;
  }
  
  .dashboard-cards {
    flex-direction: column;
  }
}
