/* 公共样式 - 总后台 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: #333;
  font-size: 14px;
}
:root {
  --primary: #FF5A1F;
  --primary-light: #fff0e8;
  --danger: #dc2626;
  --success: #10b981;
  --warning: #f59e0b;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-secondary: #6b7280;
}

/* 布局 */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: #1e293b;
  color: #cbd5e1;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
}
.main {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* 侧边栏 */
.logo {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.logo-text { color: #fff; font-size: 15px; font-weight: 700; line-height: 1.3; }
.logo-sub { font-size: 10px; font-weight: 400; opacity: 0.55; margin-top: 2px; }
.menu-group { padding-top: 14px; }
.menu-group-title {
  padding: 4px 20px 6px;
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.4;
}
.menu-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: 0.15s;
  border-left: 3px solid transparent;
}
.menu-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.menu-item.active {
  background: rgba(255,90,31,0.15);
  color: var(--primary);
  border-left-color: var(--primary);
}
.menu-icon { font-size: 16px; width: 20px; text-align: center; }
.badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
}

/* 顶部栏 */
.crumb { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.role-tag { background: var(--primary-light); color: var(--primary); font-size: 13px; padding: 5px 12px; border-radius: 8px; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #64748b; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #7c4a03;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.logout-btn { border: 1px solid var(--border); background: #fff; color: #64748b; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.logout-btn:hover { color: var(--danger); border-color: var(--danger); }

/* 内容区 */
.content { padding: 24px; flex: 1; }

/* 卡片 */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.more { font-size: 13px; color: var(--primary); cursor: pointer; font-weight: normal; }

/* 统计卡片 */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(255,90,31,.15); transform: translateY(-2px); }
.stat-card .label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-card .trend { font-size: 12px; margin-top: 4px; }
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-secondary); font-size: 13px; }
tr:hover { background: #f9fafb; }

/* 按钮 */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 13px; }

/* 状态标签 */
.status-tag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.status-online { background: #d1fae5; color: #065f46; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-offline { background: #fee2e2; color: #991b1b; }

/* 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-close { cursor: pointer; font-size: 20px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 13px; color: var(--text-secondary); }
.form-item input, .form-item select, .form-item textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.form-item input:focus { outline: none; border-color: var(--primary); }

/* Toast */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 2000;
  opacity: 0;
  transition: 0.3s;
}
.toast.show { opacity: 1; }

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FF6B35, #FF3D1F);
}
.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
