* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}

/* 页面 */
.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: block;
}

/* 登录页 */
.login-box {
  max-width: 400px;
  margin: 100px auto;
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  text-align: center;
}

.login-icon {
  font-size: 60px;
  margin-bottom: 15px;
}

.login-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 30px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* 后台布局 */
.admin-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #001529;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-left .logo {
  font-size: 28px;
}

.header-left .title {
  font-size: 18px;
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.admin-sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  width: 200px;
  bottom: 0;
  background: #001529;
  padding: 10px 0;
  overflow-y: auto;
}

.menu-item {
  padding: 15px 20px;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
  position: relative;
}

.menu-item:hover,
.menu-item.active {
  color: white;
  background: #1890ff;
}

.menu-item .icon {
  font-size: 18px;
}

.menu-item .badge {
  position: absolute;
  right: 15px;
  background: #ff4d4f;
  color: white;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
}

.admin-content {
  margin-left: 200px;
  margin-top: 60px;
  padding: 20px;
  min-height: calc(100vh - 60px);
}

/* 内容区域 */
.section {
  display: none;
}

.section.active {
  display: block;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

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

.card-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 15px;
  color: #333;
}

/* 统计卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: #1890ff;
}

.stat-label {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

/* 表单元素 */
.input {
  padding: 10px 15px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.input:focus {
  border-color: #1890ff;
}

.input:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s;
}

.btn-primary {
  background: #1890ff;
  color: white;
}

.btn-primary:hover {
  background: #40a9ff;
}

.btn-success {
  background: #52c41a;
  color: white;
}

.btn-success:hover {
  background: #73d13d;
}

.btn-danger {
  background: #ff4d4f;
  color: white;
}

.btn-outline {
  background: white;
  color: #1890ff;
  border: 1px solid #1890ff;
}

.btn-outline:hover {
  background: #e6f7ff;
}

.btn-sm {
  padding: 6px 15px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.data-table th {
  background: #fafafa;
  font-weight: 500;
}

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

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.filter-bar .input {
  width: 150px;
}

.action-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 20px;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid #d9d9d9;
  background: white;
  cursor: pointer;
  border-radius: 4px;
}

.pagination button.active,
.pagination button:hover {
  background: #1890ff;
  color: white;
  border-color: #1890ff;
}

/* 状态标签 */
.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.status.success {
  background: #f6ffed;
  color: #52c41a;
}

.status.warning {
  background: #fffbe6;
  color: #faad14;
}

.status.error {
  background: #fff2f0;
  color: #ff4d4f;
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-header .close {
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.modal-header .close:hover {
  color: #333;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 表单组 */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  color: #333;
}

.form-group .input {
  width: 100%;
}

/* 二维码 */
.qr-placeholder {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.qr-placeholder img {
  max-width: 100%;
  max-height: 100%;
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 40px;
  color: #999;
}

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

.empty .icon {
  font-size: 48px;
  margin-bottom: 10px;
}

/* 响应式 */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 60px;
  }
  
  .menu-item {
    padding: 15px;
    justify-content: center;
  }
  
  .menu-item .icon {
    font-size: 20px;
  }
  
  .menu-item span:not(.icon):not(.badge) {
    display: none;
  }
  
  .admin-content {
    margin-left: 60px;
  }
  
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 审批卡片 */
.approval-card {
  background: #fafafa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.approval-card .header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.approval-card .name {
  font-weight: 500;
  font-size: 16px;
}

.approval-card .actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

/* 列表项 */
.list-item {
  background: white;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.list-item .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.list-item .meta {
  font-size: 13px;
  color: #999;
}
