/* 省心集运后台 - 样式 */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
  font-size: 14px;
}
a { color: #1e88e5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #1e3a5f 0%, #1a2e4a 100%);
  color: #fff;
  flex-shrink: 0;
}
.sidebar .brand {
  padding: 20px;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  letter-spacing: 1px;
}
.sidebar nav { padding: 10px 0; }
.sidebar nav a {
  display: block;
  padding: 12px 20px;
  color: rgba(255,255,255,0.85);
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.05); color: #fff; text-decoration: none; }
.sidebar nav a.active {
  background: rgba(255,255,255,0.1);
  border-left-color: #42a5f5;
  color: #fff;
  font-weight: 500;
}
.sidebar nav .sep { padding: 15px 20px 5px; color: rgba(255,255,255,0.4); font-size: 12px; }
.sidebar .user {
  position: absolute;
  bottom: 0;
  width: 220px;
  padding: 15px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  background: rgba(0,0,0,0.2);
}

.main { flex: 1; min-width: 0; }
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e1e4e8;
  display: flex;
  align-items: center;
  padding: 0 24px;
  justify-content: space-between;
}
.topbar h1 { margin: 0; font-size: 18px; }
.topbar .user-info { color: #666; font-size: 13px; }
.content { padding: 24px; }

/* 卡片 */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 20px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #fafbfc; font-weight: 600; color: #555; font-size: 13px; }
tbody tr:hover { background: #fafbfc; }
.text-muted { color: #999; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* 按钮 */
.btn {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  transition: all 0.15s;
}
.btn:hover { border-color: #1e88e5; color: #1e88e5; text-decoration: none; }
.btn-primary {
  background: #1e88e5;
  border-color: #1e88e5;
  color: #fff;
}
.btn-primary:hover { background: #1976d2; border-color: #1976d2; color: #fff; }
.btn-danger { color: #e53935; border-color: #e53935; }
.btn-danger:hover { background: #e53935; color: #fff; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn-group .btn { margin-right: 4px; }

/* 状态徽章 */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}
.badge-on { background: #e8f5e9; color: #2e7d32; }
.badge-off { background: #fafafa; color: #999; }
.badge-pending { background: #fff3e0; color: #ef6c00; }
.badge-confirmed { background: #e3f2fd; color: #1565c0; }
.badge-shipped { background: #e8eaf6; color: #3949ab; }
.badge-delivered { background: #e8f5e9; color: #2e7d32; }
.badge-cancelled { background: #fafafa; color: #999; }

/* 表单 */
.form-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.form-row label { width: 90px; color: #666; }
.form-row input, .form-row select, .form-row textarea {
  flex: 1;
  min-width: 200px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: #1e88e5;
}

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.stat-card .label { color: #999; font-size: 13px; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 600; color: #1e88e5; }
.stat-card .sub { color: #999; font-size: 12px; margin-top: 4px; }

/* 模态框 */
.modal-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 8px;
  width: 500px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal-header { padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #eee; text-align: right; }
.modal-footer .btn { margin-left: 8px; }
.modal-close { cursor: pointer; font-size: 20px; color: #999; line-height: 1; }

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  background: #333;
  color: #fff;
  border-radius: 4px;
  z-index: 2000;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.toast.show { display: block; animation: slideIn 0.2s; }
.toast.success { background: #2e7d32; }
.toast.error { background: #c62828; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* 分页 */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}
.pagination a:hover { background: #f5f5f5; text-decoration: none; }
.pagination .current { background: #1e88e5; border-color: #1e88e5; color: #fff; }
.pagination .disabled { color: #ccc; }

/* 登录页 */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #fff;
  border-radius: 8px;
  padding: 40px;
  width: 360px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.login-box h1 { text-align: center; margin: 0 0 30px; color: #1e88e5; font-size: 22px; }
.login-box .form-row { flex-direction: column; align-items: stretch; }
.login-box .form-row label { width: 100%; margin-bottom: 6px; }
.login-box .error { color: #c62828; font-size: 13px; text-align: center; margin-bottom: 12px; }

.empty { text-align: center; color: #999; padding: 40px 0; }
