/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e6e6e6;
  line-height: 1.6;
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 按钮样式 */
.btn-primary {
  background: linear-gradient(to right, #4cc9f0 0%, #4361ee 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(76, 201, 240, 0.3);
  font-weight: 500;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 201, 240, 0.4);
}

.btn-secondary {
  background: linear-gradient(to right, #3a86ff 0%, #8338ec 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(58, 134, 255, 0.3);
  font-weight: 500;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(58, 134, 255, 0.4);
}

.btn-danger {
  background: linear-gradient(to right, #ff006e 0%, #fb5607 100%);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 110, 0.4);
}

.btn-success {
  background: linear-gradient(to right, #3a0ca3 0%, #7209b7 100%);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(58, 12, 163, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(58, 12, 163, 0.4);
}

.btn-logout {
  background: linear-gradient(to right, #ff006e 0%, #fb5607 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3);
}

.btn-logout:hover {
  background: linear-gradient(to right, #e0005c 0%, #e04d06 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 110, 0.4);
}

.user-info {
  display: flex;
  align-items: center;
  position: relative;
}

.user-avatar {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 20px;
  transition: background-color 0.3s ease;
}

.user-avatar:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-avatar i {
  font-size: 24px;
  color: #4cc9f0;
  margin-right: 8px;
}

.username {
  font-weight: 500;
  color: #e6e6e6;
  margin-right: 5px;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  min-width: 150px;
}

.dropdown-item {
  width: 100%;
  text-align: left;
  border-radius: 8px;
  margin-bottom: 5px;
  justify-content: flex-start;
  padding: 10px 15px;
}

.dropdown-item:last-child {
  margin-bottom: 0;
}

.btn-view {
  background: linear-gradient(to right, #4cc9f0 0%, #4361ee 100%);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 5px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(76, 201, 240, 0.3);
}

.btn-view:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(76, 201, 240, 0.4);
}

.btn-delete {
  background: transparent;
  color: #ff6b6b;
  border: none;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
}

.btn-delete:hover {
  background: rgba(255, 107, 107, 0.2);
  color: #ff5252;
  transform: translateY(-1px);
}

.btn-delete:active {
  transform: translateY(0);
}

/* 表格样式 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: rgba(30, 30, 46, 0.85);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  overflow: hidden;
  color: #e6e6e6;
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th {
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.3) 0%, rgba(67, 97, 238, 0.1) 100%);
  font-weight: 600;
  color: #e6e6e6;
  backdrop-filter: blur(5px);
  white-space: nowrap;
  text-align: center;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background: rgba(67, 97, 238, 0.2);
  transform: scale(1.01);
  transition: transform 0.2s ease;
}

.positive {
  color: #4CAF50;
  font-weight: 500;
}

.negative {
  color: #F44336;
  font-weight: 500;
}

/* 表格容器 */
.table-container {
  overflow-x: auto;
  margin-top: 20px;
  flex: 1;
  min-height: 0;
  padding: 10px;
}

/* 模态框样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(22, 33, 62, 0.9) 100%);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.2) 0%, rgba(76, 201, 240, 0.1) 100%);
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  color: #e6e6e6;
  font-weight: 600;
}

.close {
  font-size: 24px;
  cursor: pointer;
  color: #999;
  transition: color 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close:hover {
  color: #e6e6e6;
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 20px;
  color: #e6e6e6;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #ccc;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 14px;
  background: rgba(40, 40, 60, 0.7);
  backdrop-filter: blur(5px);
  color: #e6e6e6;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4cc9f0;
  box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.2);
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #444;
  border-top: 3px solid #4cc9f0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}