/* =====================================================================
   K13中转平台 · 网页版管理平台 · 全局样式
   统一风格：简洁清爽物流管理后台（浅灰底 + 白卡片 + 主色 #1a73e8）
   无任何外部依赖（无 CDN / 无图标字体库），支持移动端响应式
   ===================================================================== */

:root {
  --primary: #1a73e8;
  --primary-dark: #1765c4;
  --primary-light: #e8f0fe;
  --bg: #f0f2f5;
  --card: #ffffff;
  --border: #e3e6eb;
  --text: #202124;
  --text-2: #5f6368;
  --text-3: #9aa0a6;
  --danger: #d93025;
  --danger-light: #fce8e6;
  --success: #188038;
  --success-light: #e6f4ea;
  --warning: #e8710a;
  --warning-light: #fef7e0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
input[type="checkbox"] { accent-color: var(--primary); }
h1, h2, h3, h4 { font-weight: 600; }
img { max-width: 100%; }

.hidden { display: none !important; }
.nav-group { padding: 10px 16px 4px; font-size: 12px; color: #8a97a8; }
.sec-scroll { overflow-x: auto; }
.sec-scroll .table { min-width: 760px; }
.btn-link { background: none; border: none; color: #2f6fed; padding: 2px 6px; cursor: pointer; text-decoration: underline; }
.loading { text-align: center; color: var(--text-3); padding: 28px 16px; font-size: 13px; }
.cell-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { color: var(--text-3); font-size: 12px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 6px;
  padding: 8px 16px; font-size: 14px; line-height: 1.4;
  background: #fff; color: var(--text-2);
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.btn:hover { filter: brightness(.97); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); filter: none; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-danger-outline { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-light); filter: none; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: #f2f4f7; filter: none; }
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 5px; }
.btn-block { width: 100%; }

/* ---------------- 表单 ---------------- */
.form-group { margin-bottom: 16px; }
.form-group > label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-2); }
.form-group label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 115, 232, .12); }
.form-control:disabled, .form-control[readonly] { background: #f5f6f8; color: var(--text-2); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.form-hint.ok { color: var(--success); }
.form-hint.warn { color: var(--warning); }
.form-error { color: var(--danger); font-size: 13px; min-height: 20px; margin: 4px 0 8px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1 1 200px; }
.checkbox-line { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.checkbox-line input { margin-top: 3px; }
.checkbox-line.center { align-items: center; }
.checkbox-line.center input { margin-top: 0; }

/* ---------------- 顶栏 / 侧边导航（管理页复用） ---------------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; gap: 12px;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-logo { height: 32px; width: 32px; object-fit: contain; border-radius: 6px; display: none; }
.topbar-name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { color: var(--text-2); font-size: 13px; white-space: nowrap; }

.sidebar {
  position: fixed; top: 56px; left: 0; bottom: 0; width: 200px; z-index: 90;
  background: #fff; border-right: 1px solid var(--border);
  padding: 12px 10px; overflow-y: auto;
}
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 14px; border: none; border-radius: 6px; background: transparent;
  font-size: 14px; color: var(--text-2); text-align: left; cursor: pointer;
}
.nav-item { background: #e6f0fb; color: #1f4e8c; }
.nav-item:hover { background: #d3e4f9; color: #1f4e8c; text-decoration: none; }
.nav-item.active { background: #0b4ea2; color: #ffffff; font-weight: 600; }
.nav-logout { color: var(--danger); }
.nav-logout:hover { background: var(--danger-light); color: var(--danger); }

.main-content { margin-left: 200px; margin-top: 56px; padding: 24px; min-height: calc(100vh - 56px); }

/* 宽表格横向滚动（避免窄屏被截断） */
.sec { overflow-x: auto; }
.sec .table { min-width: 720px; }

/* ---------------- 页面结构 / 卡片 ---------------- */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
.page-title { font-size: 18px; font-weight: 600; }
.page-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.card-desc { font-size: 13px; color: var(--text-2); margin-bottom: 16px; }

.filter-tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; }
.filter-tabs button { border: none; background: transparent; padding: 6px 14px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.filter-tabs button.active { background: var(--primary); color: #fff; }
.filter-tabs button + button { border-left: 1px solid var(--border); }

.admin-section { display: none; }
.admin-section.active { display: block; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  text-align: left; vertical-align: middle; font-size: 13px;
}
.table th { background: #f8f9fb; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #f6f9fe; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table .empty { text-align: center; padding: 40px 16px; color: var(--text-3); }
tr.row-pending td { background: var(--warning-light); }
tr.row-pending:hover td { background: #fdf0d3; }

/* ---------------- 徽章 ---------------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 1.8; white-space: nowrap; }
.badge.success { background: var(--success-light); color: var(--success); }
.badge.danger { background: var(--danger-light); color: var(--danger); }
.badge.warning { background: var(--warning-light); color: var(--warning); }
.badge.info { background: var(--primary-light); color: var(--primary); }
/* 派车10状态配色 */
.badge.orange { background: var(--warning-light); color: var(--warning); }
.badge.blue { background: var(--primary-light); color: var(--primary); }
.badge.purple { background: #f3e8ff; color: #7c3aed; }
.badge.green { background: var(--success-light); color: var(--success); }
.badge.gray { background: #f1f3f4; color: #5f6368; }

/* ---------------- 弹窗 ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(32, 33, 36, .45);
  display: none; align-items: center; justify-content: center;
  padding: 16px; z-index: 200;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: 12px; width: min(560px, 100%);
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { border: none; background: transparent; font-size: 22px; color: var(--text-3); cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ---------------- Toast ---------------- */
.toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 400;
  display: flex; flex-direction: column; gap: 8px; max-width: 90vw;
}
.toast {
  background: #323232; color: #fff; padding: 10px 16px; border-radius: 6px;
  font-size: 13px; box-shadow: var(--shadow); max-width: 360px;
  animation: toast-in .25s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 登录页 ---------------- */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(160deg, #e8f0fe 0%, var(--bg) 45%);
}
.auth-brand {
  position: absolute; top: 20px; left: 24px; z-index: 10;
  display: flex; align-items: center; gap: 10px;
}
.auth-logo { height: 36px; width: 36px; object-fit: contain; border-radius: 8px; display: none; }
.auth-brand-name { font-size: 17px; font-weight: 600; }
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 96px 16px 48px; }
.auth-card { width: min(400px, 100%); padding: 36px 32px; }
.auth-title { font-size: 22px; margin-bottom: 4px; text-align: center; }
.auth-sub { text-align: center; color: var(--text-2); font-size: 13px; margin-bottom: 24px; }
.auth-links { margin-top: 16px; text-align: center; font-size: 13px; }

/* ---------------- 申请页 ---------------- */
.apply-header {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.apply-header .topbar-brand { min-width: 0; }
.apply-header .header-link { font-size: 13px; white-space: nowrap; }
.apply-wrap { max-width: 640px; margin: 24px auto; padding: 0 16px 48px; }

.wechat-box {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; background: #fafbfc; margin-bottom: 20px;
}
.wechat-box .wx-icon { font-size: 38px; margin-bottom: 8px; line-height: 1; }
.wechat-box .wx-tip { color: var(--text-2); font-size: 13px; margin-bottom: 12px; }
.wx-status { font-size: 13px; margin-top: 10px; color: var(--text-3); word-break: break-all; }
.wx-status.ok { color: var(--success); }
.wx-status.warn { color: var(--warning); }
.sim-login { margin-top: 12px; font-size: 13px; }

.loc-row { display: flex; gap: 8px; align-items: center; }
.loc-row .form-control { flex: 1; min-width: 0; }

.terms-box {
  background: #f8fafc; border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 14px; font-size: 12.5px; color: var(--text-2);
  max-height: 120px; overflow-y: auto; margin-bottom: 8px; line-height: 1.7;
}

/* ---------------- 报价策略 / 公斤段 ---------------- */
.strategy-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.strategy-line select { flex: 1 1 220px; min-width: 0; }

.seg-panel {
  margin-top: 12px; padding: 12px; background: #f8fafc;
  border: 1px solid var(--border); border-radius: 6px;
}
.seg-note { font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; }
.seg-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.seg-check {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 12px; font-size: 13px; color: var(--text-2);
}
.seg-check.checked { background: var(--primary-light); border-color: #b6d2f8; color: var(--text); }

.seg-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.seg-row .seg-min, .seg-row .seg-max { width: 110px; }
.seg-row .seg-add { width: 150px; }
.seg-sep { color: var(--text-3); }

/* ---------------- 系统设置 ---------------- */
.logo-upload { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-preview {
  width: 76px; height: 76px; border: 1px dashed var(--border); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: #fafbfc; overflow: hidden; color: var(--text-3); font-size: 12px;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------------- 计价模式单选（策略二选一：上浮比例 / 公斤段加价） ---------------- */
.mode-radios { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-line { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.radio-line input { accent-color: var(--primary); }

/* ---------------- 响应式（移动端） ---------------- */
@media (max-width: 860px) {
  .topbar { position: static; height: auto; padding: 10px 12px; flex-wrap: wrap; }
  .sidebar {
    position: static; width: 100%; border-right: none;
    border-bottom: 1px solid var(--border); padding: 8px 10px;
  }
  .sidebar nav { flex-direction: row; overflow-x: auto; gap: 6px; }
  .nav-item { width: auto; white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  .nav-logout { display: none; } /* 顶栏已有退出按钮 */
  .main-content { margin: 0; padding: 16px 12px; min-height: auto; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-tools { justify-content: flex-start; }
  .card { padding: 16px; }
  .modal-body { padding: 16px; }
}

@media (max-width: 560px) {
  .loc-row { flex-direction: column; align-items: stretch; }
  .topbar-user { display: none; }
}

/* ===== 客户端蓝色商务登录页 ===== */
.login-blue-wrap { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 40px; overflow: hidden; background:
    radial-gradient(1100px 560px at 82% 18%, rgba(64,150,255,.28), transparent 60%),
    radial-gradient(900px 520px at 8% 88%, rgba(16,94,190,.45), transparent 55%),
    radial-gradient(600px 400px at 45% 30%, rgba(56,189,248,.14), transparent 60%),
    linear-gradient(158deg, #06182e 0%, #0a2f5c 40%, #0d56b4 100%); }
.login-blue-wrap::before { content: ''; position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: linear-gradient(160deg, rgba(0,0,0,0) 20%, #000 100%);
  mask-image: linear-gradient(160deg, rgba(0,0,0,0) 20%, #000 100%);
  pointer-events: none; }
.login-blue-wrap::after { content: ''; position: absolute; left: -12%; top: -46%; width: 72%; height: 220%;
  background: repeating-linear-gradient(112deg, transparent 0 30px, rgba(255,255,255,.055) 30px 33px);
  transform: rotate(-6deg);
  pointer-events: none; }
.login-blue-card { position: relative; width: 100%; max-width: 400px; min-height: 520px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #ffffff; border: none; border-radius: 16px; padding: 40px 30px 28px; text-align: center; box-shadow: 0 18px 48px rgba(0,30,70,.45); }
@media (max-width: 900px) {
  .login-blue-wrap { justify-content: center; padding: 24px 12px; }
}
.login-blue-head { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; width: 100%; }
.login-blue-logo { width: 52px; height: 52px; border-radius: 10px; background: #eef4fb; object-fit: contain; padding: 4px; }
.login-blue-name { color: #0b3a75; font-size: 22px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
.login-blue-sub { color: #64748b; font-size: 12px; margin-top: 2px; }
.login-blue-qrbox { flex: 1; display: flex; flex-direction: column; justify-content: center; margin: 14px 0 18px; width: 100%; }
.login-blue-tip { color: #94a3b8; font-size: 12px; margin-top: 10px; }
.login-blue-links { margin-bottom: 6px; color: #475569; font-size: 14px; }
.login-blue-link { color: #0b4ea2; text-decoration: none; margin: 0 6px; font-weight: 500; }
.login-blue-link:active { color: #1668c7; }
.login-blue-sep { color: #cbd5e1; }
.login-blue-form { background: #f8fafd; border-radius: 12px; padding: 14px 14px 10px; }
.filter-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #eee; flex-wrap: wrap; }
.filter-bar span { font-size: 13px; color: #555; }
.filter-bar select.fs { width: auto; min-width: 110px; margin: 0; }