/* 车辆管理使用系统 样式 —— 移动优先 */
:root {
  --primary: #1f4e79;
  --primary-light: #2e6da4;
  --accent: #e8b339;
  --bg: #f0f3f7;
  --card: #ffffff;
  --text: #1c2733;
  --text-2: #5b6b7c;
  --border: #e3e8ef;
  --danger: #d64541;
  --success: #2e9e6b;
  --warn: #e8912d;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(20, 40, 70, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }

/* ---------- 登录 ---------- */
.login-view {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #16324f 0%, #1f4e79 55%, #2e6da4 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: 16px; padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo { font-size: 44px; text-align: center; }
.login-title { text-align: center; font-size: 20px; color: var(--primary); margin-top: 6px; }
.login-sub { text-align: center; color: var(--text-2); font-size: 13px; margin: 6px 0 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none; background: #fbfcfe; transition: border .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary-light); }
.login-tip { margin-top: 18px; padding: 12px; background: #f6f8fb; border-radius: 8px; font-size: 12px; color: var(--text-2); line-height: 1.7; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 8px; padding: 10px 16px; font-size: 14px; cursor: pointer;
  background: #eef2f7; color: var(--text); transition: all .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-danger { background: #fdecea; color: var(--danger); }
.btn-success { background: #e7f6ee; color: var(--success); }
.btn-warn { background: #fdf3e4; color: var(--warn); }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 布局 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 56px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.brand-icon { font-size: 22px; }
.brand-name { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip { font-size: 13px; opacity: .95; }
.layout { display: flex; min-height: calc(100vh - 56px); }

.sidebar {
  width: 210px; background: #fff; border-right: 1px solid var(--border);
  padding: 12px 0; flex-shrink: 0; display: none;
}
.sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px;
  color: var(--text-2); font-size: 14px; border-left: 3px solid transparent;
}
.sidebar a.active { color: var(--primary); background: #f0f5fb; border-left-color: var(--primary); font-weight: 600; }
.sidebar a .ico { width: 20px; text-align: center; }

.content { flex: 1; padding: 16px; width: 100%; overflow-x: hidden; padding-bottom: 80px; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: #fff; border-top: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.bottom-nav a {
  flex: 1; min-width: 62px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; color: var(--text-2); font-size: 11px; white-space: nowrap;
}
.bottom-nav a .ico { font-size: 20px; }
.bottom-nav a.active { color: var(--primary); font-weight: 600; }

@media (min-width: 900px) {
  .sidebar { display: block; }
  .bottom-nav { display: none; }
  .content { padding: 20px 24px; padding-bottom: 24px; }
}

/* ---------- 卡片 & 页面头 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.page-title { font-size: 18px; font-weight: 700; }
.page-desc { color: var(--text-2); font-size: 13px; }

/* ---------- 搜索栏 ---------- */
.search-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.search-bar input, .search-bar select {
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; outline: none; background: #fff;
  min-width: 0;
}
.search-bar input { flex: 1; min-width: 140px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-2); font-weight: 600; background: #f7f9fc; position: sticky; top: 0; }
tbody tr:hover { background: #f8fafd; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag-blue { background: #e8f0fa; color: var(--primary); }
.tag-green { background: #e7f6ee; color: var(--success); }
.tag-red { background: #fdecea; color: var(--danger); }
.tag-orange { background: #fdf3e4; color: var(--warn); }
.tag-gray { background: #eef2f7; color: var(--text-2); }
.link-btn { color: var(--primary); cursor: pointer; margin-right: 10px; font-size: 13px; background: none; border: none; }
.link-btn.danger { color: var(--danger); }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.empty { text-align: center; padding: 40px 0; color: var(--text-2); font-size: 13px; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat-card .lbl { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.stat-card.accent .num { color: var(--accent); }
.stat-card.danger .num { color: var(--danger); }
.stat-card.success .num { color: var(--success); }

/* ---------- 图表 ---------- */
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .chart-grid.two { grid-template-columns: 1fr 1fr; } }
.chart-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.chart-box h3 { font-size: 15px; margin-bottom: 10px; color: var(--text); }
.chart { width: 100%; height: 280px; }

/* ---------- 弹窗 ---------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(15,25,40,.5); }
.modal-box {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 16px 16px 0 0; padding: 20px; animation: slideUp .25s;
}
@media (min-width: 700px) {
  .modal-root { align-items: center; padding: 20px; }
  .modal-box { border-radius: 14px; }
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { font-size: 17px; }
.modal-close { font-size: 24px; cursor: pointer; color: var(--text-2); background: none; border: none; line-height: 1; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 详情 / 时间线 ---------- */
.detail-row { display: flex; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.detail-row .k { width: 110px; color: var(--text-2); flex-shrink: 0; }
.detail-row .v { flex: 1; }
.timeline { list-style: none; padding-left: 20px; border-left: 2px solid var(--border); margin: 12px 0; }
.timeline li { position: relative; padding: 0 0 18px 16px; }
.timeline li::before {
  content: ""; position: absolute; left: -25px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: #c7d2de; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--border);
}
.timeline li.done::before { background: var(--success); box-shadow: 0 0 0 2px #d7efe3; }
.timeline li.now::before { background: var(--warn); box-shadow: 0 0 0 2px #f7e4c8; }
.timeline .t-title { font-weight: 600; font-size: 14px; }
.timeline .t-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ---------- 提醒列表 ---------- */
.reminder-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: #f8fafd; margin-bottom: 10px; }
.reminder-item .r-ico { font-size: 22px; }
.reminder-item .r-main { flex: 1; }
.reminder-item .r-title { font-weight: 600; }
.reminder-item .r-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(20,30,45,.92); color: #fff; padding: 10px 20px; border-radius: 22px;
  font-size: 14px; z-index: 200; max-width: 86vw;
}

/* ---------- 分段控制 ---------- */
.tabs { display: flex; gap: 6px; background: #eef2f7; padding: 4px; border-radius: 10px; margin-bottom: 14px; overflow-x: auto; }
.tabs button {
  flex: 1; border: none; background: transparent; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.tabs button.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- 手写签名板 ---------- */
.sign-pad { touch-action: none; cursor: crosshair; display: block; width: 100%; height: 130px; background: #fafbfc; border: 1px dashed var(--border); border-radius: 8px; }

/* ---------- 派修单打印 ---------- */
.print-wrap { max-width: 920px; margin: 0 auto; }
.print-sheet { background: #fff; border: 1px solid #c9d2dd; padding: 26px 28px; margin-bottom: 22px; font-size: 14px; color: #000; }
.print-sheet h2 { text-align: center; font-size: 20px; letter-spacing: 2px; margin-bottom: 4px; }
.print-sheet .sheet-no { text-align: right; font-size: 13px; margin-bottom: 10px; }
.print-sheet .sheet-tag { text-align: right; font-size: 13px; margin-top: 8px; }
.print-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.print-table td { border: 1px solid #000; padding: 10px 12px; vertical-align: middle; word-break: break-all; }
.print-table td.lbl { width: 150px; font-weight: 600; text-align: center; background: #f6f7f9; }
.print-table td .sig-img { height: 52px; max-width: 220px; object-fit: contain; display: inline-block; vertical-align: middle; }
.print-table td .date-cell { display: inline-block; margin-left: 16px; font-size: 13px; }
.print-note { font-size: 12px; color: #333; margin-top: 8px; line-height: 1.8; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
  .topbar, .sidebar, .bottom-nav { display: none !important; }
  .layout { min-height: auto !important; }
  .content { padding: 0 !important; }
  .print-sheet { border: none; padding: 10px; page-break-after: always; }
  .print-sheet:last-child { page-break-after: auto; }
}

/* ---------- 修理厂防泄密安全模式 ---------- */
body.secure-mode { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body.secure-mode img, body.secure-mode canvas, body.secure-mode a, body.secure-mode svg { -webkit-user-drag: none; }
@media print {
  body.secure-mode { visibility: hidden !important; }
}
