/* ============ 管理后台样式 ============ */
/* 现代简洁后台风格，类似 Ant Design */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: #333;
  background: #f0f2f5;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ============ 登录页 ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-card h2 {
  text-align: center;
  font-size: 24px;
  color: #333;
  margin-bottom: 8px;
}

.login-card .login-subtitle {
  text-align: center;
  color: #999;
  font-size: 14px;
  margin-bottom: 32px;
}

.login-card .form-group {
  margin-bottom: 20px;
}

.login-card .form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #555;
}

.login-card .form-group input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s;
  outline: none;
}

.login-card .form-group input:focus {
  border-color: #07c160;
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.login-btn {
  width: 100%;
  height: 44px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 8px;
}

.login-btn:hover {
  background: #06ad56;
}

.login-btn:disabled {
  background: #a0d9b8;
  cursor: not-allowed;
}

.login-error {
  color: #ff4d4f;
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
}

/* ============ 主布局 ============ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* 左侧菜单栏 */
.sidebar {
  width: 220px;
  background: #001529;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: all 0.3s;
}

.sidebar-logo {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo h3 {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.sidebar-menu {
  padding: 12px 0;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  user-select: none;
}

.menu-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
  color: #fff;
  background: #07c160;
}

.menu-item .menu-icon {
  margin-right: 10px;
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* 右侧主内容区 */
.main-area {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶部导航栏 */
.header {
  height: 60px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 99;
}

.header-title {
  font-size: 17px;
  font-weight: 600;
  color: #333;
}

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

.header-admin {
  color: #666;
  font-size: 14px;
}

.header-admin .admin-name {
  color: #333;
  font-weight: 500;
}

.logout-btn {
  padding: 6px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  color: #666;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
}

.logout-btn:hover {
  color: #ff4d4f;
  border-color: #ff4d4f;
}

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

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

.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.3s;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.blue {
  background: rgba(24, 144, 255, 0.1);
  color: #1890ff;
}

.stat-icon.orange {
  background: rgba(250, 173, 20, 0.1);
  color: #faad14;
}

.stat-icon.green {
  background: rgba(7, 193, 96, 0.1);
  color: #07c160;
}

.stat-icon.purple {
  background: rgba(114, 46, 209, 0.1);
  color: #722ed1;
}

.stat-info h4 {
  font-size: 13px;
  color: #999;
  font-weight: 400;
  margin-bottom: 4px;
}

.stat-info .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #333;
}

/* ============ 筛选栏 ============ */
.filter-bar {
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.3s;
}

.filter-bar select:focus,
.filter-bar input:focus {
  border-color: #07c160;
}

.filter-bar select {
  min-width: 120px;
}

.filter-bar input[type="text"] {
  min-width: 160px;
}

.filter-bar input[type="date"] {
  min-width: 140px;
}

.filter-bar .filter-separator {
  color: #999;
  font-size: 13px;
}

/* ============ 表格 ============ */
.table-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

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

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

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: #fafafa;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #666;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
  color: #333;
  vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
  background: #fafafa;
}

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

/* 表格加载状态 */
.table-loading {
  text-align: center;
  padding: 48px 0;
  color: #999;
}

.table-loading .spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #f0f0f0;
  border-top-color: #07c160;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 空数据提示 */
.table-empty {
  text-align: center;
  padding: 48px 0;
  color: #999;
}

.table-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ============ 状态标签 ============ */
.status-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-tag.pending {
  background: #fff7e6;
  color: #d48806;
  border: 1px solid #ffd591;
}

.status-tag.accepted {
  background: #e6f7ff;
  color: #1890ff;
  border: 1px solid #91d5ff;
}

.status-tag.scheduled {
  background: #e6fffb;
  color: #13c2c2;
  border: 1px solid #87e8de;
}

.status-tag.in_progress {
  background: #f6ffed;
  color: #52c41a;
  border: 1px solid #b7eb8f;
}

.status-tag.completed {
  background: #f5f5f5;
  color: #8c8c8c;
  border: 1px solid #d9d9d9;
}

.status-tag.cancelled {
  background: #fff2f0;
  color: #ff4d4f;
  border: 1px solid #ffccc7;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #333;
  transition: all 0.3s;
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  border-color: #07c160;
  color: #07c160;
}

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

.btn-primary {
  background: #07c160;
  border-color: #07c160;
  color: #fff;
}

.btn-primary:hover {
  background: #06ad56;
  border-color: #06ad56;
  color: #fff;
}

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

.btn-danger:hover {
  background: #ff7875;
  border-color: #ff7875;
  color: #fff;
}

.btn-link {
  border: none;
  background: none;
  color: #1890ff;
  padding: 4px 8px;
}

.btn-link:hover {
  color: #40a9ff;
  border: none;
}

.btn-link.danger {
  color: #ff4d4f;
}

.btn-link.danger:hover {
  color: #ff7875;
}

.btn-sm {
  padding: 3px 8px;
  font-size: 12px;
}

.btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============ 模态框 ============ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

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

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  border-radius: 4px;
}

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

.modal-body {
  padding: 24px;
}

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

/* ============ 表单 ============ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #555;
  font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.3s;
}

.form-group textarea {
  height: 80px;
  padding: 8px 12px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #07c160;
  box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ============ 分页 ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 20px;
  gap: 8px;
}

.pagination .page-info {
  color: #666;
  font-size: 13px;
  margin-right: 12px;
}

.pagination .page-btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0 6px;
}

.pagination .page-btn:hover:not(:disabled) {
  border-color: #07c160;
  color: #07c160;
}

.pagination .page-btn.active {
  background: #07c160;
  border-color: #07c160;
  color: #fff;
}

.pagination .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============ 订单详情 ============ */
.detail-section {
  margin-bottom: 20px;
}

.detail-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-item {
  display: flex;
  font-size: 13px;
}

.detail-item .label {
  color: #999;
  min-width: 70px;
  flex-shrink: 0;
}

.detail-item .value {
  color: #333;
  font-weight: 500;
}

/* 物品明细表 */
.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.items-table th,
.items-table td {
  padding: 8px 12px;
  border: 1px solid #f0f0f0;
  font-size: 13px;
  text-align: left;
}

.items-table th {
  background: #fafafa;
  font-weight: 600;
  color: #666;
}

/* 价格输入 */
.price-input {
  width: 100px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}

.price-input:focus {
  border-color: #07c160;
}

/* ============ Toast 提示 ============ */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.toast {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: toastIn 0.3s;
  white-space: nowrap;
}

@keyframes toastIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast.success {
  background: #07c160;
}

.toast.error {
  background: #ff4d4f;
}

.toast.info {
  background: #1890ff;
}

/* ============ 品类树形缩进 ============ */
.category-child {
  padding-left: 32px;
}

.category-level-1 td:first-child {
  font-weight: 600;
}

.category-level-2 td:first-child {
  padding-left: 40px;
  color: #666;
}

/* 启用/禁用状态 */
.status-enabled {
  color: #07c160;
}

.status-disabled {
  color: #ff4d4f;
}

/* ============ 用户状态 ============ */
.user-status-active {
  color: #07c160;
}

.user-status-inactive {
  color: #999;
}

/* ============ 响应式适配 ============ */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar-logo h3 {
    display: none;
  }

  .menu-item {
    padding: 14px 0;
    justify-content: center;
  }

  .menu-item .menu-text {
    display: none;
  }

  .menu-item .menu-icon {
    margin-right: 0;
  }

  .main-area {
    margin-left: 60px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar select,
  .filter-bar input {
    width: 100%;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .data-table {
    display: block;
    overflow-x: auto;
  }

  .header-title {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 12px;
  }

  .modal {
    max-width: 100%;
    margin: 10px;
  }

  .pagination {
    justify-content: center;
    flex-wrap: wrap;
  }
}
