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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* 登录 */
.login-box {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
}
.login-card {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 10px; }
.login-card input {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.err { color: var(--danger); font-size: 13px; min-height: 18px; text-align: center; }

/* 布局 */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 700; font-size: 16px; white-space: nowrap; }
.store-selector { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; color: var(--text); }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  border: none;
  background: none;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  border-radius: 8px;
}
.tab.active { background: #eff6ff; color: var(--primary); font-weight: 600; }
.top-right { display: flex; gap: 10px; align-items: center; }

.content { padding: 20px; max-width: 1200px; margin: 0 auto; width: 100%; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.filters { display: flex; gap: 10px; }
.filters input, .filters select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

/* 按钮 */
.btn {
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: .15s;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { background: #f8fafc; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.status-open { background: var(--success); color: #fff; }
.status-closed { background: var(--danger); color: #fff; }

/* 表格 */
.table {
  width: 100%;
  background: #fff;
  border-radius: 10px;
  border-collapse: collapse;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.table th, .table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table th { background: #f8fafc; color: var(--muted); font-weight: 600; font-size: 13px; }
.table tr:last-child td { border-bottom: none; }
.table .thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: #f1f5f9; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge.pending { background: #fef3c7; color: #b45309; }
.badge.accepted { background: #dbeafe; color: #1d4ed8; }
.badge.completed { background: #dcfce7; color: #15803d; }
.badge.cancelled { background: #fee2e2; color: #b91c1c; }
.badge.handled { background: #e2e8f0; color: #475569; }
.badge.active { background: #dcfce7; color: #15803d; }
.badge.inactive { background: #e2e8f0; color: #64748b; }

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 480px;
  max-height: 90vh;
  overflow: auto;
}
.modal-card h2 { margin-bottom: 18px; font-size: 18px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.form-row input, .form-row textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.image-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.image-box img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.image-box input[type="text"] { flex: 1; }
.upload-btn { cursor: pointer; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* 设置卡片 */
.settings-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.settings-card h3 { margin-bottom: 8px; }
.settings-card p { color: var(--muted); margin-bottom: 12px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: .3s;
  z-index: 200;
}
.toast.show { opacity: 1; }

.empty { text-align: center; color: var(--muted); padding: 30px; }
.call-types-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.call-type-tag { display: inline-flex; align-items: center; gap: 6px; background: #f1f5f9; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.call-type-tag .btn { padding: 0 6px; line-height: 1; }
.call-type-add { display: flex; gap: 10px; }
.call-type-add input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.copy-store-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; margin-bottom: 12px; }
.copy-store-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.copy-store-item:hover { background: #f8fafc; }
