/* ===== 基础 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f4f6fa;
  color: #2c3e50;
  font-size: 14px;
  line-height: 1.5;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1600px; margin: 0 auto; padding: 20px; }
.muted { color: #999; }
.mono { font-family: Consolas, Monaco, monospace; font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.hint { color: #888; font-size: 12.5px; margin: 6px 0; }

/* ===== 导航 ===== */
.topbar { background: linear-gradient(90deg,#1e3a8a,#2563eb); color:#fff; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.topbar-inner { max-width:1600px; margin:0 auto; padding:0 20px; height:54px; display:flex; align-items:center; justify-content:space-between; }
.brand { color:#fff; font-size:17px; font-weight:600; }
.nav-links a { color:#dbeafe; margin-left:18px; font-size:14px; }
.nav-links a:hover { color:#fff; }

/* ===== 页头 ===== */
.page-head { display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:14px; flex-wrap:wrap; gap:10px; }
.page-head h2, .container > h2 { font-size:20px; margin-bottom:14px; }
.legend { font-size:12.5px; color:#666; }
.legend-item { margin-left:14px; }
.dot { display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:4px; vertical-align:middle; }
.dot-red { background:#e74c3c; }

/* ===== 筛选栏 ===== */
.filter-bar {
  display:flex; flex-wrap:wrap; gap:8px; align-items:center;
  background:#fff; padding:12px 14px; border-radius:8px; margin-bottom:14px;
  box-shadow:0 1px 3px rgba(0,0,0,.05);
}
.filter-bar select, .filter-bar input[type=text], .filter-bar input[type=date] {
  height:34px; padding:0 10px; border:1px solid #d0d7de; border-radius:6px; font-size:13.5px; background:#fff;
}
.filter-bar input[type=text] { min-width:220px; }
.date-label { font-size:13px; color:#555; display:flex; align-items:center; gap:4px; }

/* ===== 批量栏 ===== */
.batch-bar {
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  background:#fff; padding:10px 14px; border-radius:8px; margin-bottom:12px;
  box-shadow:0 1px 3px rgba(0,0,0,.05); font-size:13.5px;
}
.batch-bar b { color:#2563eb; }
.select-all { margin-left:auto; display:flex; align-items:center; gap:4px; cursor:pointer; }

/* ===== 按钮 ===== */
.btn {
  display:inline-block; padding:7px 14px; border:1px solid #d0d7de; border-radius:6px;
  background:#fff; color:#333; cursor:pointer; font-size:13.5px; line-height:1.2;
  transition:all .15s;
}
.btn:hover { background:#f0f3f7; }
.btn-primary { background:#2563eb; border-color:#2563eb; color:#fff; }
.btn-primary:hover { background:#1d4ed8; }
.btn-success { background:#16a34a; border-color:#16a34a; color:#fff; }
.btn-success:hover { background:#15803d; }
.btn-danger { background:#dc2626; border-color:#dc2626; color:#fff; }
.btn-danger:hover { background:#b91c1c; }
.btn-sm { padding:4px 9px; font-size:12px; }

/* ===== 表格 ===== */
.table-wrap { background:#fff; border-radius:8px; overflow:auto; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.data-table { width:100%; min-width:1600px; border-collapse:collapse; font-size:13px; table-layout: fixed; }
.data-table th, .data-table td { padding:9px 10px; border-bottom:1px solid #eef0f3; text-align:left; vertical-align:top; word-break:break-all; line-height:1.5; }
.data-table th { background:#f8fafc; font-weight:600; color:#475569; position:sticky; top:0; z-index:1; white-space:nowrap; }
.data-table tbody tr:hover { background:#f8fafc; }
.data-table td.cell-product, .data-table td.cell-addr { white-space:normal; }
.col-chk { width:40px !important; text-align:center; min-width:40px; }
.col-action { width:170px !important; min-width:170px; }
/* 认领页各列固定宽度 */
.claim-table th:nth-child(1), .claim-table td:nth-child(1) { width:40px !important; text-align:center; } /* 勾选 */
.claim-table th:nth-child(2), .claim-table td:nth-child(2) { width:70px !important; }  /* 收货人 */
.claim-table th:nth-child(3), .claim-table td:nth-child(3) { width:110px !important; } /* 电话 */
.claim-table th:nth-child(4), .claim-table td:nth-child(4) { width:220px !important; } /* 地址 */
.claim-table th:nth-child(5), .claim-table td:nth-child(5) { width:260px !important; } /* 商品 */
.claim-table th:nth-child(6), .claim-table td:nth-child(6) { width:130px !important; } /* 规格 */
.claim-table th:nth-child(7), .claim-table td:nth-child(7) { width:55px !important; text-align:right; } /* 组数 */
.claim-table th:nth-child(8), .claim-table td:nth-child(8) { width:150px !important; } /* 创建预约时间 */
.claim-table th:nth-child(9), .claim-table td:nth-child(9) { width:160px !important; } /* 来客订单编号 */
.claim-table th:nth-child(10), .claim-table td:nth-child(10) { width:180px !important; } /* 奶站 */
.claim-table th:nth-child(11), .claim-table td:nth-child(11) { width:90px !important; text-align:right; } /* 金额 */
.claim-table th:nth-child(12), .claim-table td:nth-child(12) { width:80px !important; }  /* 订单状态 */
.claim-table th:nth-child(13), .claim-table td:nth-child(13) { width:80px !important; }  /* 领客状态 */
.claim-table th:nth-child(14), .claim-table td:nth-child(14) { width:80px !important; }  /* 处理状态 */
.claim-table th:nth-child(15), .claim-table td:nth-child(15) { width:170px !important; } /* 操作 */
.empty { text-align:center; color:#999; padding:30px; }
.row-overtime { background:#fff5f5 !important; }
.row-overtime:hover { background:#ffe8e8 !important; }
.row-overtime td { color:#7f1d1d; }

/* ===== 状态标签 ===== */
.tag { display:inline-block; padding:2px 9px; border-radius:10px; font-size:12px; font-weight:500; }
.tag-pending { background:#fef3c7; color:#92400e; }
.tag-claimed { background:#dcfce7; color:#166534; }
.tag-refunding { background:#ffedd5; color:#c2410c; }
.tag-refunded { background:#fee2e2; color:#991b1b; }
.tag-processed { background:#e0e7ff; color:#4338ca; }

/* ===== 领客订单状态标签 ===== */
.lk-tag { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:500; white-space:nowrap; }
.lk-pending    { background:#f1f5f9; color:#475569; }
.lk-accepted   { background:#dcfce7; color:#166534; }
.lk-delivering { background:#dbeafe; color:#1e40af; }
.lk-completed  { background:#e0e7ff; color:#3730a3; }
.lk-refunding  { background:#fef3c7; color:#92400e; }
.lk-refunded   { background:#fee2e2; color:#991b1b; }
.lk-cancelled  { background:#f3f4f6; color:#6b7280; }
.lk-unknown    { background:#f9fafb; color:#9ca3af; }
.lk-none       { background:#f9fafb; color:#d1d5db; }

/* ===== 分页 ===== */
.pager { margin-top:14px; text-align:center; }
.pager a { display:inline-block; min-width:32px; height:32px; line-height:30px; padding:0 8px; margin:0 2px;
  border:1px solid #d0d7de; border-radius:6px; color:#555; background:#fff; }
.pager a:hover { background:#f0f3f7; text-decoration:none; }
.pager a.cur { background:#2563eb; border-color:#2563eb; color:#fff; }

/* ===== 统计卡片 ===== */
.stats { display:flex; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.stat-card { flex:1; min-width:140px; background:#fff; border-radius:8px; padding:14px 18px; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.stat-card .num { display:block; font-size:24px; font-weight:700; color:#1e3a8a; }
.stat-card .lbl { display:block; font-size:12.5px; color:#888; margin-top:4px; }
.stat-pending .num { color:#92400e; }
.stat-claimed .num { color:#166534; }
.stat-refunded .num { color:#991b1b; }

/* ===== 登录页 ===== */
.login-body { display:flex; align-items:center; justify-content:center; min-height:100vh; background:linear-gradient(135deg,#1e3a8a,#2563eb); }
.login-card { background:#fff; padding:30px 34px; border-radius:12px; width:340px; box-shadow:0 10px 40px rgba(0,0,0,.2); }
.login-card h2 { margin-bottom:18px; color:#1e3a8a; }
.login-card label { display:block; margin-bottom:12px; font-size:13px; color:#555; }
.login-card input { display:block; width:100%; height:38px; padding:0 12px; margin-top:5px;
  border:1px solid #d0d7de; border-radius:6px; font-size:14px; }
.login-card .btn-primary { width:100%; height:40px; margin-top:6px; }
.login-tip { margin-top:14px; text-align:center; font-size:13px; }

/* ===== 导入表单 ===== */
.import-form { background:#fff; padding:20px; border-radius:8px; box-shadow:0 1px 3px rgba(0,0,0,.05); max-width:760px; }
.file-label { display:inline-block; padding:10px 16px; border:1px dashed #94a3b8; border-radius:6px; cursor:pointer; background:#f8fafc; }
.file-label input { margin-left:8px; }

/* ===== 弹框 ===== */
.alert { padding:10px 14px; border-radius:6px; margin-bottom:14px; font-size:13.5px; }
.alert-success { background:#dcfce7; color:#166534; border:1px solid #86efac; }
.alert-error { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }

.modal-mask { position:fixed; inset:0; background:rgba(0,0,0,.45); display:none; align-items:center; justify-content:center; z-index:100; }
.modal-mask.show { display:flex; }
.modal-card { background:#fff; border-radius:10px; padding:22px 24px; width:420px; max-width:92vw; }
.modal-card h3 { margin-bottom:12px; font-size:16px; }
.modal-card label { display:block; margin:10px 0 4px; font-size:13px; color:#555; }
.modal-card input, .modal-card textarea { width:100%; padding:8px 10px; border:1px solid #d0d7de; border-radius:6px; font-size:13.5px; }
.modal-card textarea { resize:vertical; min-height:60px; }
.modal-actions { margin-top:16px; text-align:right; }
.modal-actions .btn { margin-left:8px; }

/* 退款原因快捷选择 */
.reason-chips { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.reason-chips .chip { display:inline-block; padding:4px 10px; border:1px solid #d0d7de; border-radius:14px; font-size:12px; color:#555; cursor:pointer; user-select:none; transition:all .15s; }
.reason-chips .chip:hover { border-color:#dc2626; color:#dc2626; }
.reason-chips .chip.selected { background:#fee2e2; border-color:#dc2626; color:#991b1b; }

/* 响应式 */
@media (max-width:768px) {
  .filter-bar input[type=text] { min-width:160px; }
  .col-action { width:auto; }
}
