/* main.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

/* 登录页面样式 */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 30px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #2196F3;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: #2196F3;
}

.btn {
  width: 100%;
  padding: 12px;
  background-color: #2196F3;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
  text-align: center;
}

.btn:hover {
  background-color: #1976D2;
}

.btn-secondary {
  background-color: #9E9E9E;
}

.btn-secondary:hover {
  background-color: #757575;
}

.error-message {
  color: #F44336;
  margin-bottom: 20px;
  text-align: center;
}

/* 管理员界面布局 */
.admin-container {
  display: flex;
  height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 130px;
  background-color: #2C3E50;
  color: #fff;
  padding: 15px 0;
  flex-shrink: 0;
}

.sidebar ul li a {
  font-size: 14px;
  height: 45px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 8px 10px;
  color: white;
  text-decoration: none;
  transition: all 0.3s;
}

.sidebar h3 {
  text-align: center;
  margin-bottom: 30px;
  color: #3498DB;
  font-size: 18px;
  padding: 0 10px;
  line-height: 1.4;
}

.sidebar ul {
  list-style: none;
}

.sidebar ul li {
  cursor: pointer;
  transition: background-color 0.3s;
  position: relative;
}

.sidebar ul li:hover {
  background-color: #34495E;
}

.sidebar ul li.active {
  background-color: #3498DB;
}

.sidebar ul li.menu-divider {
  height: 1px;
  background-color: rgba(255,255,255,0.15);
  margin: 8px 15px;
  cursor: default;
}

.sidebar ul li.menu-divider:hover {
  background-color: rgba(255,255,255,0.15);
}

/* 主内容区 */
.main-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* 顶部导航栏 */
.navbar {
  background-color: #fff;
  padding: 10px 20px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar h2 {
  color: #2C3E50;
  text-align: center;
  flex: 1;
}

.user-info {
  display: flex;
  align-items: center;
}

.user-info span {
  margin-right: 20px;
}

/* 卡片样式 */
.card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.card h3 {
  margin-bottom: 20px;
  color: #2C3E50;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  text-align: center;
}

/* 表格样式 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #e8e8e8;
  font-size: 14px;
}

.data-table th {
  background-color: #4a5568;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

.data-table th:first-child {
  border-radius: 8px 0 0 0;
}

.data-table th:last-child {
  border-radius: 0 8px 0 0;
}

.data-table tr:hover {
  background-color: #f8f9fa;
}

.data-table tr:last-child td:first-child {
  border-radius: 0 0 0 8px;
}

.data-table tr:last-child td:last-child {
  border-radius: 0 0 8px 0;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table td {
  color: #495057;
}

.data-table td.status-normal {
  color: #28a745;
  font-weight: 500;
}

.data-table td.status-abnormal {
  color: #dc3545;
  font-weight: 500;
}

/* 操作按钮 */
.action-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 6px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s ease;
  min-width: 70px;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.action-btn:active {
  transform: translateY(0);
}

.edit-btn {
  background-color: #28a745;
  color: #fff;
}

.edit-btn:hover {
  background-color: #218838;
}

.delete-btn {
  background-color: #dc3545;
  color: #fff;
}

.delete-btn:hover {
  background-color: #c82333;
}

.view-btn {
  background-color: #17a2b8;
  color: #fff;
}

.view-btn:hover {
  background-color: #138496;
}

/* 统计卡片 */
.stats-container {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  flex: 1;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  text-align: center;
}

.stat-card h4 {
  color: #757575;
  margin-bottom: 10px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #2196F3;
}

/* 表单样式 */
.form-container {
  max-width: 600px;
  margin: 0 auto;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.form-row .form-group {
  flex: 1;
}

.form-actions {
  text-align: center;
  margin-top: 20px;
}

.form-actions button {
  margin-left: 10px;
}

/* 备案信息样式 */
.footer-beian {
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  padding: 12px 20px;
  text-align: center;
  font-size: 12px;
  color: #6c757d;
}

.footer-beian .beian-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-beian a {
  color: #495057;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-beian a:hover {
  color: #007bff;
  text-decoration: underline;
}

.beian-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 4px;
}

/* 响应式设计 */

@media (max-width: 768px) {
  .admin-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
  }
  
  .stats-container {
    flex-direction: column;
  }
  
  .form-row {
    flex-direction: column;
  }
  
  .footer-beian {
    padding: 10px 15px;
    font-size: 11px;
  }
}