/* ============================================================
 * 机票行程系统 - 浅色主题 + 响应式（手机优先）
 * ============================================================ */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #1f2328;
  --muted: #6b7280;
  --danger: #dc2626;
  --radius: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: 16px; /* 防 iOS 自动缩放 */
}
button { cursor: pointer; }

.app { min-height: 100vh; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-size: 16px; font-weight: 600; letter-spacing: 0.3px; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.nav-on { background: #eaf1fe; color: var(--primary); font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.role-badge {
  background: #eaf1fe; color: var(--primary);
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.who { font-size: 14px; color: var(--muted); }
.main { max-width: 1100px; margin: 0 auto; padding: 16px; }

/* ---------- 通用 ---------- */
.page { padding-bottom: 40px; }
.page-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.page-head h2 { margin: 0; font-size: 20px; font-weight: 600; }
.head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
}
.card-h { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.card-h-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-h-row .card-h { margin: 0; }
.sub-h { font-size: 14px; font-weight: 600; margin: 16px 0 8px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.loading, .empty { padding: 30px 0; text-align: center; color: var(--muted); }
.err-line { color: var(--danger); font-size: 14px; margin: 8px 0; }
.boot { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  min-height: 40px;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #f9fafb; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { border-color: var(--border); color: var(--muted); }
.btn.danger { border-color: #f3c7c7; color: var(--danger); }
.btn.small { padding: 5px 10px; min-height: 34px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.s-gray { background: #f1efe8; color: #5f5e5a; }
.s-amber { background: #faeeda; color: #854f0b; }
.s-blue { background: #e6f1fb; color: #185fa5; }
.s-purple { background: #eeedfe; color: #534ab7; }
.s-teal { background: #e1f5ee; color: #0f6e56; }
.s-green { background: #eaf3de; color: #3b6d11; }
.s-red { background: #fcebeb; color: #a32d2d; }

.tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.tag-leave { background: #fff3e0; color: #8a4b00; }
.tag-dispatch { background: #e8f0fe; color: #1a4fa0; }

.chip {
  font-size: 12.5px; padding: 3px 10px; border-radius: 20px;
  background: #f3f4f6; color: var(--muted); border: 1px solid var(--border);
}
.chip-on { background: #e1f5ee; color: #0f6e56; border-color: #9fe1cb; font-weight: 600; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 看板 ---------- */
.todo-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.todo-num { font-size: 28px; font-weight: 700; color: #b45309; line-height: 1; }
.todo-text { flex: 1; font-size: 15px; color: #92400e; font-weight: 500; }
.todo-arrow { font-size: 24px; color: #b45309; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.stat-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  cursor: pointer;
}
.stat-item:hover { background: #f9fafb; }
.stat-num { font-size: 24px; font-weight: 700; margin-top: 6px; }
.money-line { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 14px; }

.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius); cursor: pointer;
}
.lv-red { background: #fcebeb; border: 1px solid #f7c1c1; }
.lv-amber { background: #faeeda; border: 1px solid #fac775; }
.alert-doc { font-size: 14px; font-weight: 500; }
.alert-date { font-size: 13px; }

.row-line {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid #f1f2f4; cursor: pointer;
  flex-wrap: wrap;
}
.row-line:last-child { border-bottom: none; }
.r-date { font-size: 13px; color: var(--muted); min-width: 88px; }
.r-name { font-weight: 600; }
.r-sub { font-size: 13px; flex: 1; }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px;
}
.filter-bar input, .filter-bar select {
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 8px 10px; min-height: 40px; background: #fff;
}
.filter-bar .grow { min-width: 140px; }
.date-input { min-width: 140px; }

/* ---------- 行程卡片 ---------- */
.trip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.trip-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  cursor: pointer;
}
.trip-card:hover { border-color: var(--primary); }
.tc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tc-no { font-size: 12.5px; }
.tc-name { font-size: 16px; font-weight: 600; margin: 6px 0 2px; }
.tc-route { font-size: 13px; }
.tc-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.tc-foot { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- 详情 ---------- */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.d-no { font-size: 13px; }
.d-title { font-size: 20px; font-weight: 600; }
.d-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ig { display: flex; flex-direction: column; gap: 2px; }
.ig.wide { grid-column: 1 / -1; }
.ig-k { font-size: 12.5px; color: var(--muted); }
.ig-v { font-size: 15px; }

/* ---------- 接送机 ---------- */
.transfer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-card {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  min-height: 84px;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.tf-card:hover { border-color: var(--primary); }
.tf-on {
  border-style: solid;
  border-color: #1d9e75;
  background: #e1f5ee;
}
.tf-name { font-size: 15px; font-weight: 600; }
.tf-state { font-size: 13px; color: var(--muted); }
.tf-on .tf-state { color: #0f6e56; font-weight: 600; }

/* ---------- 乘客 ---------- */
.pax-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid #f1f2f4;
}
.pax-row:last-child { border-bottom: none; }
.pax-main { font-size: 15px; }
.pax-docs { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-chip { font-size: 12.5px; padding: 2px 8px; border-radius: 6px; background: #f3f4f6; color: var(--muted); }
.doc-warn { background: #faeeda; color: #854f0b; font-weight: 600; }
.doc-bad { background: #fcebeb; color: #a32d2d; font-weight: 600; }
.pax-acts { margin-left: auto; display: flex; gap: 6px; }
.pax-form { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.pax-draft { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.pax-draft input { flex: 1; min-width: 110px; }

/* ---------- 附件 ---------- */
.att-group { margin-bottom: 12px; }
.att-kind { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.att-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid #f1f2f4;
}
.att-name { font-size: 14px; flex: 1; min-width: 120px; word-break: break-all; }
.att-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.upload-box {
  margin-top: 12px; padding: 12px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: #fafbfc;
}
.up-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.up-row select, .up-row input[type=text] {
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 8px 10px; min-height: 40px; background: #fff;
}
.up-file { flex: 1; min-width: 180px; font-size: 14px; }
.up-kind, .up-pax { min-width: 120px; }

/* ---------- 表单 ---------- */
.form-card { display: block; }
.f-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.f-col { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.f-col label { font-size: 13px; color: var(--muted); }
.f-col input, .f-col select, .f-col textarea {
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 9px 10px; min-height: 42px; background: #fff; width: 100%;
}
.f-col textarea { min-height: 62px; resize: vertical; }
.inline2 { display: flex; gap: 8px; }
.inline2 input { flex: 1; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 12px; }
.chk input { width: 18px; height: 18px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- 时间轴 ---------- */
.cmt-box { display: flex; gap: 8px; margin-bottom: 12px; }
.cmt-box input {
  flex: 1; border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 9px 10px; min-height: 42px;
}
.log-row {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid #f1f2f4; font-size: 14px;
}
.log-time { font-size: 12.5px; min-width: 116px; }
.log-act { font-weight: 600; font-size: 13px; }
.log-who { color: var(--muted); font-size: 13px; }
.log-note { flex: 1; min-width: 140px; word-break: break-word; }

/* ---------- 账号 ---------- */
.user-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid #f1f2f4;
}
.user-row:last-child { border-bottom: none; }
.u-left { flex: 1; min-width: 150px; }
.u-meta { font-size: 12.5px; }
.u-role {
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 6px 8px; min-height: 36px; background: #fff;
}

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px 24px;
  width: 100%; max-width: 380px; position: relative;
}
.login-title { margin: 0 0 18px; font-size: 20px; font-weight: 600; text-align: center; }
.lang-btn {
  position: absolute; top: 14px; right: 14px;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  border-radius: 6px; padding: 4px 10px; font-size: 13px;
}
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.login-card input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 11px 12px; min-height: 44px;
}
.login-card .btn { margin-top: 20px; }

/* ---------- 弹窗 / 提示 ---------- */
.modal {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 80px; z-index: 50;
}
.modal-card {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 20px; width: 100%; max-width: 360px;
}
.modal-card h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.modal-card label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.modal-card input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 10px 11px; min-height: 42px;
}
.toast {
  position: absolute; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: #1f2328; color: #fff; padding: 10px 18px;
  border-radius: 22px; font-size: 14px; z-index: 90;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.fatal {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #fcebeb; color: #a32d2d; padding: 10px 16px;
  font-size: 13px; z-index: 100;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .main { padding: 12px; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

@media (max-width: 640px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand { font-size: 15px; width: 100%; }
  .nav { order: 3; width: 100%; }
  .nav a { padding: 8px 12px; min-height: 44px; }
  .top-right { margin-left: auto; }
  .who { display: none; }
  .main { padding: 10px; }
  .card { padding: 13px; border-radius: var(--radius); }
  .info-grid { grid-template-columns: 1fr; }
  .transfer-grid { grid-template-columns: 1fr; }
  .trip-grid { grid-template-columns: 1fr; }
  .f-col { min-width: 100%; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 38px; }
  .filter-bar input, .filter-bar select { width: 100%; }
  .up-file { width: 100%; }
  .r-date { min-width: 80px; }
  .pax-acts { margin-left: 0; width: 100%; }
  .toast { bottom: 20px; width: calc(100% - 40px); text-align: center; }
}
