/* 公车管理系统 · 基础样式（员工端与管理端共用） */
:root {
  --red: #C8102E;
  --red-dark: #A00D25;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --bg: #f5f6f7;
  --card: #ffffff;
  --line: #e5e7eb;
  --green: #16a34a;
  --blue: #2563eb;
  --amber: #d97706;
  --purple: #7c3aed;
  --gray: #94a3b8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- 布局 ---------- */
.page { max-width: 720px; margin: 0 auto; padding: 0 0 76px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 14px;
  background: var(--red); color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.topbar .title { font-size: 16px; font-weight: 600; flex: 1; }
.topbar .back {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; cursor: pointer; margin-left: -6px;
}
.topbar .action { font-size: 14px; color: #fff; opacity: .92; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; margin: 12px;
}

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 14px 8px; font-size: 14px; color: var(--text-2); font-weight: 600;
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field > label {
  display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500;
}
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=tel], select, textarea {
  width: 100%; padding: 11px 12px; font-size: 15px; font-family: inherit;
  color: var(--text); background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
  outline: none; appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); }
textarea { min-height: 76px; resize: vertical; }
select { background-image: none; }
input[disabled], select[disabled] { background: #f3f4f6; color: var(--text-3); }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

.check {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 8px; cursor: pointer; background: #fff;
}
.check input { width: 20px; height: 20px; accent-color: var(--red); flex: none; }
.check.checked { border-color: var(--green); background: #f0fdf4; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; font-size: 15px; font-weight: 500; font-family: inherit;
  color: #fff; background: var(--red); border: 1px solid var(--red); border-radius: 8px;
  cursor: pointer; transition: opacity .15s;
}
.btn:active { opacity: .82; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn.ghost-red { background: #fff; color: var(--red); border-color: var(--red); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.btn.danger { background: #dc2626; border-color: #dc2626; }
.btn.plain { background: #fff; color: var(--blue); border-color: var(--line); }

/* ---------- 状态徽标 ---------- */
.tag {
  display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 6px;
  background: #f1f5f9; color: var(--text-2); white-space: nowrap;
}
.tag.free { background: #dcfce7; color: #15803d; }
.tag.reserved { background: #e2e8f0; color: #475569; }
.tag.in_use { background: #dbeafe; color: #1d4ed8; }
.tag.wait_return { background: #fef3c7; color: #b45309; }
.tag.overdue { background: #fee2e2; color: #b91c1c; }
.tag.long_term { background: #ede9fe; color: #6d28d9; }
.tag.maintenance { background: #f1f5f9; color: #64748b; }
.tag.pending { background: #fef3c7; color: #b45309; }
.tag.dispatched { background: #dbeafe; color: #1d4ed8; }
.tag.ongoing { background: #dbeafe; color: #1d4ed8; }
.tag.done { background: #dcfce7; color: #15803d; }
.tag.cancelled { background: #f1f5f9; color: #64748b; }

/* ---------- 底部导航（员工端） ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; text-align: center; padding: 8px 0 9px;
  font-size: 11px; color: var(--text-3);
}
.tabbar a .ico { display: block; font-size: 19px; line-height: 1.3; }
.tabbar a.active { color: var(--red); }

/* ---------- 提示 / 空态 ---------- */
.toast-wrap {
  position: fixed; left: 0; right: 0; top: 62px; z-index: 100;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: 90%; padding: 10px 16px; border-radius: 8px;
  font-size: 14px; color: #fff; background: rgba(31, 41, 55, .92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
  animation: toastIn .18s ease-out;
}
.toast.err { background: rgba(185, 28, 28, .95); }
.toast.ok { background: rgba(21, 128, 61, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; color: var(--text-3); font-size: 14px; padding: 40px 20px; }
.empty .ico { font-size: 34px; display: block; margin-bottom: 8px; opacity: .5; }
.loading { text-align: center; color: var(--text-3); font-size: 14px; padding: 36px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- 表格（管理端） ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.table th, .table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.table th { font-size: 13px; color: var(--text-2); font-weight: 600; background: #fafbfc; white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fcfcfd; }

@media (max-width: 640px) {
  .page { padding-bottom: 70px; }
}
