/* ============================================================
   中驰汽修 · 门店管理系统  样式表
   ============================================================ */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #101828;
  --ink-2: #4b5565;
  --ink-3: #8a94a6;
  --line: #e7ebf3;
  --line-strong: #d7deea;
  --brand: #2f6feb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eaf1ff;
  --nav: #0c1524;
  --nav-2: #111f35;
  --ok: #0f9d76;
  --ok-soft: #e7f8f1;
  --warn: #c2740a;
  --warn-soft: #fdf3e3;
  --danger: #df4b4b;
  --danger-soft: #fdecec;
  --purple: #7c5cf0;
  --purple-soft: #f1edff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -18px rgba(16, 24, 40, .25);
  --font: "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
/* 滚动条：轨道透明，滑块为浅灰 */
html { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.55) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.55); border: 2px solid transparent; border-radius: 8px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,.7); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }
svg { display: block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }

/* ---------------------------- 通用组件 ---------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: all .16s ease;
}
.btn:hover { border-color: #b9c4d6; color: var(--ink); background: #fbfcfe; }
.btn:active { transform: translateY(.5px); }
.btn .ico { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(180deg, #3d7bf5, var(--brand)); color: #fff; border-color: var(--brand);
  box-shadow: 0 4px 10px -4px rgba(47, 111, 235, .55);
}
.btn-primary:hover { background: linear-gradient(180deg, #326ef0, var(--brand-dark)); color: #fff; border-color: var(--brand-dark); }
.btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-dark); }
.btn-soft:hover { background: #dee9ff; border-color: transparent; color: var(--brand-dark); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #f1f4f9; border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #f2c9c9; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); border-color: #eab0b0; color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: .16s;
}
.icon-btn:hover { background: #f1f4f9; color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: #eef2f7; color: #5a6678;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.ok { background: var(--ok-soft); color: #0b7f60; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--brand-soft); color: var(--brand-dark); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.plain::before { display: none; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 14.5px; font-weight: 600; letter-spacing: .1px; }
.card-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 10px 20px 16px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; padding: 3px; background: #eef2f8; border-radius: 9px; gap: 2px; }
.seg button {
  border: 0; background: transparent; height: 30px; padding: 0 13px; border-radius: 7px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; transition: .16s;
}
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); font-weight: 500; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  font-size: 13.5px; font-family: inherit; outline: none; transition: .16s;
  -webkit-text-size-adjust: 100%;
}
.select option { font-size: 14px; -webkit-text-size-adjust: 100%; }
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 72px; line-height: 1.6; }

/* ---------------- 自定义下拉 picker ---------------- */
select.cpick-hidden { position: absolute; left: -9999px; opacity: 0; pointer-events: none; height: 0; }
.cpick-trigger {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  font-size: 13.5px; line-height: 1; cursor: pointer; user-select: none;
  -webkit-text-size-adjust: 100%;
  transition: .16s;
}
.cpick-trigger:hover { border-color: #b9c4d6; }
.cpick-trigger.open, .cpick-trigger:focus { border-color: #8fb4f8; box-shadow: 0 0 0 3px rgba(47, 111, 235, .12); outline: none; }
.cpick-trigger .cpick-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick-trigger .cpick-caret { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.cpick-pop {
  position: fixed; z-index: 999;
  max-height: min(280px, 60vh); overflow-y: auto;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 14px 32px -12px rgba(12, 21, 36, .35);
  padding: 6px;
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
  -webkit-text-size-adjust: 100%;
}
.cpick-pop.show { opacity: 1; transform: none; pointer-events: auto; }
.cpick-item {
  padding: 9px 11px; border-radius: 7px;
  font-size: 13.5px; line-height: 1.35; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cpick-item:hover { background: #f1f4f9; color: var(--ink); }
.cpick-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 500; }
.cpick-item.is-disabled { color: #c8d0de; cursor: default; background: transparent; }
.cpick-item.is-disabled:hover { background: transparent; }
.cpick-group { padding: 9px 11px 4px; font-size: 11px; font-weight: 600; letter-spacing: .6px; color: var(--ink-3); text-transform: uppercase; }
.cpick-trigger.disabled { color: var(--ink-3); background: #f4f6fa; cursor: not-allowed; opacity: .7; }
.cpick-trigger.disabled .cpick-caret { opacity: .4; }

/* ---------------- 手机端导航（默认隐藏，≤720px 显示） ---------------- */
.mheader, .mdrawer-mask, .mdrawer, .mtabbar { display: none; }
.mheader {
  position: sticky; top: 0; z-index: 50;
  height: 52px;
  background: #0c1524; color: #fff;
  align-items: center; gap: 10px; padding: 0 12px;
}
.mheader .m-menu {
  width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.mheader .m-menu:hover { background: rgba(255,255,255,.08); }
.mheader .m-menu svg { width: 20px; height: 20px; }
.mheader .m-title { flex: 1; min-width: 0; }
.mheader .m-t1 { font-size: 15px; font-weight: 600; line-height: 1.15; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mheader .m-t2 { font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mheader .m-avatar {
  width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.12);
  color: #fff; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}

.mdrawer-mask {
  position: fixed; inset: 0; background: rgba(12, 21, 36, .45); z-index: 80;
  opacity: 0; transition: opacity .2s ease;
}
.mdrawer-mask.show { display: block; opacity: 1; }
.mdrawer {
  position: fixed; left: 0; top: 0; bottom: 0; width: min(82vw, 320px);
  z-index: 90; background: var(--nav); color: #fff;
  transform: translateX(-100%); transition: transform .24s cubic-bezier(.2,.8,.3,1);
  flex-direction: column; box-shadow: 16px 0 36px -26px rgba(0,0,0,.5);
}
.mdrawer.show { transform: none; }
.mdrawer .md-brand {
  padding: 18px 18px 14px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.mdrawer .md-brand .logo-mark { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.mdrawer .md-brand .brand-name { font-size: 15px; font-weight: 600; }
.mdrawer .md-brand .brand-sub { font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: 2px; }
.mdrawer .md-brand .icon-btn { margin-left: auto; color: rgba(255,255,255,.75); }
.mdrawer .md-brand .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.mdrawer .mnav { flex: 1; overflow-y: auto; padding: 10px 10px 18px; }
.mdrawer .mnav .nav-group { padding: 14px 12px 6px; font-size: 11.5px; letter-spacing: .8px; color: rgba(255,255,255,.45); }
.mdrawer .mnav a {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px;
  border-radius: 9px; color: rgba(255,255,255,.78); font-size: 13.5px; font-weight: 500;
  transition: background .16s;
}
.mdrawer .mnav a svg { width: 18px; height: 18px; color: rgba(255,255,255,.58); flex: none; }
.mdrawer .mnav a .tag { margin-left: auto; }
.mdrawer .mnav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.mdrawer .mnav a.active { background: rgba(47, 111, 235, .22); color: #fff; }
.mdrawer .mnav a.active svg { color: #6fa1ff; }
.mdrawer .md-foot {
  padding: 12px 14px 18px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.mdrawer .md-me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.mdrawer .md-me .avatar { width: 32px; height: 32px; font-size: 12px; background: rgba(255,255,255,.12); color: #fff; }
.mdrawer .md-me .mi-name { font-size: 13px; font-weight: 600; }
.mdrawer .md-me .mi-role { font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: 1px; }
.mdrawer .md-foot .btn { color: rgba(255,255,255,.75); border-color: rgba(255,255,255,.18); }
.mdrawer .md-foot .btn:hover { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }

.mtabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 14px -8px rgba(12,21,36,.15);
  padding: 4px 0 calc(env(safe-area-inset-bottom) + 4px);
}
.mtabbar .mtab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; height: 56px; color: var(--ink-3);
  font-size: 11px; font-weight: 500; position: relative;
  transition: color .16s;
}
.mtabbar .mtab svg { width: 21px; height: 21px; flex: none; }
.mtabbar .mtab .tag {
  position: absolute; top: 8px; right: calc(50% - 26px); height: 17px; padding: 0 6px;
  font-size: 10px; line-height: 17px; font-weight: 600;
}
.mtabbar .mtab.active { color: var(--brand); }
.mtabbar .mtab.active svg { stroke-width: 2.2; }
.input:focus, .select:focus, .textarea:focus {
  border-color: #8fb4f8; box-shadow: 0 0 0 3px rgba(47, 111, 235, .12);
}
.input::placeholder, .textarea::placeholder { color: #a9b2c2; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.search {
  position: relative; display: inline-flex; align-items: center;
}
.search svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 33px; width: 230px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* 表格 */
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.2px; }
.table th {
  text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px; letter-spacing: .2px;
  padding: 11px 16px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid #f0f3f8; vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbfe; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.table .w-actions { text-align: right; white-space: nowrap; }
.table .cell-main { font-weight: 500; color: var(--ink); }
.table .cell-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.table .amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.row-actions { display: inline-flex; gap: 2px; opacity: .55; transition: .15s; }
tr:hover .row-actions { opacity: 1; }
.link { color: var(--brand); cursor: pointer; }
.link:hover { text-decoration: underline; }

/* 空状态 */
.empty { padding: 52px 20px; text-align: center; color: var(--ink-3); }
.empty svg { width: 42px; height: 42px; margin: 0 auto 10px; color: #c8d0de; }
.empty p { font-size: 13px; }
.empty .sub { font-size: 12px; margin-top: 4px; color: #aab3c2; }

/* Toast */
#toastRoot { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #101828; color: #fff; padding: 10px 18px; border-radius: 9px;
  font-size: 13px; box-shadow: 0 12px 30px -10px rgba(16,24,40,.5); animation: toastIn .22s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.err { background: #b42318; }
.toast.ok { background: #0b7f60; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(12, 21, 36, .45); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; z-index: 200; padding: 6vh 20px 40px;
  animation: fadeIn .16s ease; overflow: auto;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 560px; background: #fff; border-radius: 14px;
  box-shadow: 0 30px 70px -20px rgba(12,21,36,.5); animation: modalIn .2s cubic-bezier(.2,.8,.3,1);
  margin-bottom: 40px;
}
.modal.wide { max-width: 760px; }
.modal.narrow { max-width: 430px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 22px 14px; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-head .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.modal-body { padding: 4px 22px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--line); }

/* 进度条 */
.progress { height: 6px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.progress.low > i { background: var(--danger); }

/* 时间线 */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: grid; grid-template-columns: 22px 1fr; gap: 12px; position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: #e3e8f1;
  border: 3px solid #fff; box-shadow: 0 0 0 1px #e3e8f1; position: relative; z-index: 1;
}
.tl-item.done .tl-dot { background: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.tl-item.current .tl-dot { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,111,235,.16); }
.tl-item::before { content: ""; position: absolute; left: 5.5px; top: 14px; bottom: 0; width: 1px; background: #e7ebf3; }
.tl-item:last-child::before { display: none; }
.tl-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tl-item.done .tl-label { color: var(--ink); }
.tl-item.current .tl-label { color: var(--brand-dark); font-weight: 600; }
.tl-time { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; font-variant-numeric: tabular-nums; }

/* ---------------------------- 登录页 ---------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.auth-hero {
  position: relative; overflow: hidden; padding: 56px 60px; color: #fff;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(64,120,255,.42), transparent 62%),
    radial-gradient(600px 400px at 96% 108%, rgba(0,196,158,.16), transparent 60%),
    linear-gradient(150deg, #0b1424 0%, #0e1c33 55%, #0b1526 100%);
  display: flex; flex-direction: column;
}
.auth-hero > * { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, #4d8bff, #1e50c8); color: #fff; font-weight: 700; font-size: 19px;
  box-shadow: 0 8px 20px -8px rgba(61,123,245,.9); letter-spacing: 0;
}
.hero-brand .name { font-size: 17px; font-weight: 600; letter-spacing: 1px; }
.hero-brand .sub { font-size: 11.5px; color: rgba(255,255,255,.5); letter-spacing: 2.4px; margin-top: 1px; }
.auth-hero h1 { margin-top: auto; font-size: 40px; line-height: 1.28; font-weight: 600; letter-spacing: .5px; }
.auth-hero h1 em { font-style: normal; color: #7fb0ff; }
.auth-hero .lead { margin-top: 16px; font-size: 14.5px; line-height: 1.9; color: rgba(255,255,255,.62); max-width: 430px; }
.hero-points { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 26px; margin-top: 34px; }
.hero-point { display: flex; gap: 10px; align-items: flex-start; }
.hero-point svg { width: 17px; height: 17px; color: #6ea3ff; margin-top: 2px; flex: none; }
.hero-point b { display: block; font-size: 13px; font-weight: 500; }
.hero-point span { font-size: 12px; color: rgba(255,255,255,.45); }
.hero-foot { margin-top: auto; padding-top: 46px; font-size: 12px; color: rgba(255,255,255,.35); display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.foot-help { display: inline-flex; align-items: center; gap: 8px; }
.qr-btn {
  height: 26px; padding: 0 10px; border-radius: 7px; cursor: pointer; transition: .15s;
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08);
  color: #dfe9fb; font-size: 11.5px; font-family: inherit; white-space: nowrap;
}
.qr-btn:hover { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.35); }

.qr-modal { position: fixed; inset: 0; z-index: 120; padding: 20px; display: grid; place-items: center; background: rgba(6,12,24,.72); backdrop-filter: blur(4px); }
.qr-modal[hidden] { display: none; }
.qr-card { position: relative; width: 300px; max-width: 100%; padding: 22px 22px 18px; border-radius: 16px; background: #fff; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.qr-card h3 { font-size: 15px; color: #101828; }
.qr-card .sub { margin-top: 4px; font-size: 12px; color: #8a94a6; }
.qr-card img { display: block; width: 208px; height: 208px; margin: 14px auto 8px; border-radius: 10px; object-fit: contain; background: #f6f8fc; }
.qr-fallback { width: 208px; height: 208px; margin: 14px auto 8px; display: grid; place-items: center; border: 1px dashed #d5dce8; border-radius: 10px; background: #f6f8fc; font-size: 12px; color: #8a94a6; }
.qr-fallback[hidden] { display: none; }
.qr-card .tip { font-size: 11.5px; color: #8a94a6; }
.qr-close { position: absolute; top: 6px; right: 10px; border: 0; background: none; font-size: 20px; line-height: 1; color: #8a94a6; cursor: pointer; }
.qr-close:hover { color: #101828; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px 40px; }
.auth-card { width: 100%; max-width: 372px; }
.auth-card .brand-mobile { display: none; }
.auth-card h2 { font-size: 24px; font-weight: 600; letter-spacing: .2px; }
.auth-card .desc { color: var(--ink-3); font-size: 13px; margin-top: 6px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #f1f4f9; border-radius: 10px; margin: 24px 0 20px; }
.role-switch button {
  height: 38px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2);
  font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; transition: .16s;
}
.role-switch button svg { width: 15px; height: 15px; }
.role-switch button.active { background: #fff; color: var(--brand-dark); font-weight: 500; box-shadow: 0 2px 6px rgba(16,24,40,.1); }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn-primary { width: 100%; height: 42px; margin-top: 8px; font-size: 14px; }
.auth-hint { margin-top: 18px; background: #f8fafc; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 12px 14px; font-size: 12px; color: var(--ink-3); line-height: 1.9; }
.auth-hint b { color: var(--ink-2); font-weight: 500; }
.auth-error { margin-top: 12px; font-size: 12.5px; color: var(--danger); background: var(--danger-soft); padding: 9px 12px; border-radius: 8px; }
.auth-alt { margin-top: 20px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.auth-alt a { color: var(--brand); }

/* ---------------------------- 后台框架 ---------------------------- */
.admin { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: none; background:
    radial-gradient(420px 240px at 0% 0%, rgba(47,111,235,.22), transparent 65%),
    linear-gradient(180deg, #0c1524, #0b1420);
  color: #cdd6e5; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 30;
  transition: width .18s ease;
}
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px 15px; position: relative; }
.sidebar .brand > div:nth-child(2) { min-width: 0; }
.sidebar .brand-name, .sidebar .brand-sub { max-width: 146px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.foot-toggle {
  width: 26px; height: 26px; flex: none; border-radius: 7px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #b9c6da;
  display: grid; place-items: center; cursor: pointer; transition: .15s;
}
.foot-toggle:hover { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.24); }
.foot-toggle svg { width: 15px; height: 15px; transition: transform .18s ease; }
.admin.collapsed .foot-toggle svg { transform: rotate(180deg); }
.sidebar .logo-mark { width: 36px; height: 36px; font-size: 17px; border-radius: 10px; }
.sidebar .brand-name { font-size: 15px; font-weight: 600; color: #fff; letter-spacing: .6px; }
.sidebar .brand-sub { font-size: 10.5px; color: rgba(255,255,255,.38); letter-spacing: 1.4px; margin-top: 1px; }
.nav { flex: 1; overflow-y: auto; padding: 2px 12px 10px; scrollbar-width: none; -ms-overflow-style: none; }
.nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
.nav-section { display: flex; flex-direction: column; }
.nav-group {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  font-family: inherit; text-align: left; background: none; border: 0; cursor: pointer;
  font-size: 10.5px; letter-spacing: 1.6px; color: rgba(255,255,255,.46); padding: 12px 12px 5px;
  transition: color .14s;
}
.nav-group:hover { color: rgba(255,255,255,.72); }
.nav-group .chev { width: 12px; height: 12px; flex: none; opacity: .65; transition: transform .18s ease; }
.nav-section.closed .nav-group .chev { transform: rotate(-90deg); }
.nav-section.closed .nav-items { display: none; }
.admin.collapsed .nav-section.closed .nav-items { display: block !important; }
.nav a {
  display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 12px; border-radius: 8px;
  color: #c3cfdf; font-size: 13.2px; position: relative; transition: .14s; margin-bottom: 1px;
}
.nav a svg { width: 17px; height: 17px; color: #93a4bb; transition: .14s; }
.nav a:hover { background: rgba(255,255,255,.055); color: #e8eef8; }
.nav a:hover svg { color: #c3d2e8; }
.nav a.active { background: linear-gradient(90deg, rgba(47,111,235,.28), rgba(47,111,235,.1)); color: #fff; font-weight: 500; }
.nav a.active svg { color: #7fb0ff; }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: #4d8bff; box-shadow: 0 0 12px rgba(77,139,255,.8);
}
.nav .tag { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.1); color: #cfdbf0; border-radius: 999px; padding: 1px 7px; }
.sidebar-foot { padding: 11px 20px 13px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11.5px; color: rgba(255,255,255,.3); display: flex; align-items: center; justify-content: space-between; }

/* 侧边栏折叠态 */
.admin.collapsed .sidebar { width: 74px; }
.admin.collapsed .sidebar .brand { padding: 18px 0; justify-content: center; cursor: pointer; }
.admin.collapsed .sidebar .brand:hover { background: rgba(255,255,255,.05); }
.admin.collapsed .sidebar .brand > div:last-child { display: none; }
.admin.collapsed .nav-group,
.admin.collapsed .nav a span,
.admin.collapsed .nav .tag,
.admin.collapsed .sidebar-foot span { display: none; }
.admin.collapsed .nav a { justify-content: center; padding: 0; }
.admin.collapsed .nav a.active::before { left: -12px; }
.admin.collapsed .sidebar-foot { justify-content: center; }
.sidebar-foot .dot { width: 6px; height: 6px; border-radius: 50%; background: #16c79a; display: inline-block; margin-right: 6px; box-shadow: 0 0 8px #16c79a; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; flex: none; background: rgba(255,255,255,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar .page-title h1 { font-size: 16.5px; font-weight: 600; letter-spacing: .2px; }
.topbar .page-title p { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar .clock { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 999px; background: #f5f7fb; border: 1px solid var(--line); cursor: pointer; transition: .16s; }
.user-chip:hover { background: #fff; border-color: #c9d4e6; box-shadow: 0 2px 8px rgba(16, 24, 40, .06); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #4d8bff, #2457c8); color: #fff; font-size: 12.5px; font-weight: 600;
}
.user-chip .u-name { font-size: 12.5px; font-weight: 500; line-height: 1.25; }
.user-chip .u-role { font-size: 10.5px; color: var(--ink-3); line-height: 1.25; }

.view { padding: 22px 26px 60px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* 工作台 */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px 15px; box-shadow: var(--shadow); overflow: hidden; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .k-label { font-size: 12.5px; color: var(--ink-3); }
.kpi .k-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi .k-ico svg { width: 16px; height: 16px; }
.kpi .k-ico.ok { background: var(--ok-soft); color: var(--ok); }
.kpi .k-ico.warn { background: var(--warn-soft); color: var(--warn); }
.kpi .k-ico.purple { background: var(--purple-soft); color: var(--purple); }
.kpi .k-val { font-size: 27px; font-weight: 650; letter-spacing: -.5px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kpi .k-val small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.kpi .k-foot { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.kpi .k-foot .up { color: var(--ok); font-weight: 500; }
.kpi .k-foot .down { color: var(--danger); font-weight: 500; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.dash-grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.chart-box { padding: 6px 8px 4px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-3); align-items: center; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #f1f3f8; }
.list-item:last-child { border-bottom: 0; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.list-item .li-val { font-size: 12.5px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.stock-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); flex: none; box-shadow: 0 0 0 3px rgba(223,75,75,.12); }
.stock-dot.warn { background: #e8a33d; box-shadow: 0 0 0 3px rgba(232,163,61,.12); }

/* 工单详情 */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-head .dh-left { display: flex; align-items: center; gap: 14px; }
.back-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.back-btn:hover { background: #f7f9fc; }
.detail-head h2 { font-size: 19px; font-weight: 600; letter-spacing: .2px; display: flex; align-items: center; gap: 10px; }
.detail-head .dh-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.detail-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 18px; }
.info-item .i-label { font-size: 11.5px; color: var(--ink-3); margin-bottom: 3px; }
.info-item .i-val { font-size: 13.5px; font-weight: 500; word-break: break-all; }
.order-total { display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.order-total .ot-row { display: flex; justify-content: space-between; color: var(--ink-2); }
.order-total .ot-row.big { font-size: 15px; font-weight: 600; color: var(--ink); border-top: 1px dashed var(--line-strong); padding-top: 10px; margin-top: 2px; }
.order-total .ot-row.big b { font-size: 22px; color: var(--danger); letter-spacing: -.3px; }
.items-table td { padding-top: 11px; padding-bottom: 11px; }
.type-tag { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: #eef2f8; color: var(--ink-2); }
.type-tag.part { background: #eef4ff; color: var(--brand-dark); }

/* 工单维修项目列表（窄屏友好） */
.order-items { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.oi-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.oi-row:last-child { border-bottom: 0; }
.oi-main { min-width: 0; }
.oi-name { font-size: 13.5px; color: var(--ink); word-break: break-word; }
.oi-spec { margin-left: 6px; font-size: 11.5px; color: var(--ink-3); }
.oi-meta { margin-top: 5px; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); }
.oi-amount { flex: none; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 电子账单列表（窄屏友好） */
.bill-list { padding: 2px 0; }
.bl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #f0f3f8; }
.bl-row:last-child { border-bottom: 0; }
.bl-main { min-width: 0; }
.bl-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bl-top b { font-size: 13.5px; color: var(--ink); }
.bl-sub { font-size: 11.5px; color: var(--ink-3); }
.bl-meta { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); word-break: break-word; }
.bl-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.bl-amount { font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.add-item-box { background: #f8fafd; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 14px; margin-top: 12px; }
.add-item-row { display: grid; grid-template-columns: 1fr 1fr 86px 96px auto; gap: 9px; align-items: end; }
.add-item-row .input, .add-item-row .select { height: 35px; font-size: 13px; }
.add-item-grid { display: grid; grid-template-columns: minmax(0, 1fr) 72px 100px auto; gap: 9px; align-items: end; }
.suggest { position: relative; }
.suggest-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 9px; box-shadow: 0 14px 30px -12px rgba(16,24,40,.3); max-height: 220px; overflow: auto; z-index: 12;
}
.suggest-list div { padding: 8px 12px; font-size: 12.5px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.suggest-list div:hover { background: #f5f8fd; }
.suggest-list div span { color: var(--ink-3); }

/* 配件 */
.part-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.mini-stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 13px 16px; }
.mini-stat .ms-label { font-size: 12px; color: var(--ink-3); }
.mini-stat .ms-val { font-size: 21px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.mini-stat .ms-val small { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 2px; }
.stock-cell { min-width: 132px; }
.stock-cell .sc-top { display: flex; align-items: baseline; gap: 5px; font-size: 13px; font-weight: 500; }
.stock-cell .sc-top small { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.stock-cell .progress { margin-top: 6px; height: 5px; }

/* 报表 */
.report-range { display: flex; align-items: center; gap: 8px; }
.report-range .input { width: 148px; height: 34px; font-size: 12.5px; }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.report-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rank-list { display: flex; flex-direction: column; gap: 13px; padding: 4px 20px 18px; }
.rank-item { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.rank-item .rk { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.rank-item .rk.top { color: var(--brand); }
.rank-item .rk-name { min-width: 0; }
.rank-item .rk-name b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-item .rk-bar { height: 5px; border-radius: 99px; background: #eef2f8; margin-top: 6px; overflow: hidden; }
.rank-item .rk-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7fb0ff, var(--brand)); border-radius: 99px; }
.rank-item .rk-amount { font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pay-legend { display: flex; flex-direction: column; gap: 12px; padding: 2px 20px 18px; }
.pay-chart-row { display: flex; align-items: center; gap: 16px; padding: 18px 20px 8px; }
.pay-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.pay-item i { width: 9px; height: 9px; border-radius: 3px; }
.pay-item .pv { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.pay-item .pc { color: var(--ink-3); font-size: 11.5px; width: 46px; text-align: right; }

/* 车辆卡片（车主详情弹窗） */
.veh-list { display: grid; gap: 10px; }
.veh-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.veh-card .v-ico { width: 36px; height: 36px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.veh-card .v-main { flex: 1; min-width: 0; }
.veh-card .v-plate { font-weight: 600; font-size: 13.5px; letter-spacing: .4px; }
.veh-card .v-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.veh-card .v-mile { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------------------------- 车主端 ---------------------------- */
.portal { min-height: 100vh; background: linear-gradient(180deg, #eef3fb 0, #f6f8fc 320px); }
.portal-top {
  background:
    radial-gradient(700px 300px at 8% -30%, rgba(64,120,255,.5), transparent 62%),
    linear-gradient(120deg, #0b1526, #132844);
  color: #fff;
}
.portal-top .wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.portal-nav { height: 66px; display: flex; align-items: center; justify-content: space-between; }
.portal-nav .brand { display: flex; align-items: center; gap: 10px; }
.portal-nav .brand-name { font-size: 15px; font-weight: 600; letter-spacing: .6px; }
.portal-nav .brand-sub { font-size: 10.5px; color: rgba(255,255,255,.45); letter-spacing: 1.6px; }
.portal-nav .pn-right { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: rgba(255,255,255,.7); }
.portal-nav .pn-right .avatar { width: 28px; height: 28px; font-size: 12px; }
.portal-tabs { display: flex; gap: 26px; margin-top: 26px; padding-bottom: 0; overflow-x: auto; }
.portal-tabs button {
  background: none; border: 0; color: rgba(255,255,255,.55); font-size: 13.5px; padding: 10px 2px 16px;
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 7px;
  -webkit-tap-highlight-color: transparent; outline: none;
  transition: color .16s ease, border-color .16s ease;
}
.portal-tabs button svg { width: 16px; height: 16px; }
.portal-tabs button.active { color: #fff; border-bottom-color: #6ea3ff; }
.portal-tabs button:focus-visible { outline: 2px solid #6ea3ff; outline-offset: -2px; }
.portal-hero { padding: 10px 0 34px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.portal-hero h1 { font-size: 26px; font-weight: 600; letter-spacing: .3px; }
.portal-hero p { font-size: 13px; color: rgba(255,255,255,.55); margin-top: 6px; }
.portal-hero .ph-stats { display: flex; gap: 30px; }
.portal-hero .ph-stat b { display: block; font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.portal-hero .ph-stat span { font-size: 11.5px; color: rgba(255,255,255,.45); }
.portal-main { max-width: 1080px; margin: -22px auto 0; padding: 0 24px 70px; position: relative; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.portal .card-head { padding: 15px 18px; }
.portal .card-head h3 { font-size: 14px; }
.portal .card-body { padding: 16px 18px; }
.repair-card { border: 1px solid var(--line); border-radius: 11px; padding: 16px; background: #fff; }
.repair-card + .repair-card { margin-top: 12px; }
.repair-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.repair-plate { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.repair-model { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.repair-items { font-size: 12.5px; color: var(--ink-2); margin-top: 12px; background: #f8fafd; border-radius: 8px; padding: 9px 11px; }
.steps { display: flex; margin-top: 16px; }
.step { flex: 1; position: relative; text-align: center; font-size: 11.5px; color: var(--ink-3); }
.step::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: #e8ecf3; }
.step:first-child::before { display: none; }
.step .s-dot { width: 13px; height: 13px; border-radius: 50%; background: #e3e8f1; margin: 0 auto 7px; position: relative; z-index: 1; border: 2.5px solid #fff; box-shadow: 0 0 0 1px #e3e8f1; }
.step.done .s-dot { background: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.step.done::before { background: var(--brand); }
.step.current .s-dot { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,111,235,.18); }
.step.current { color: var(--brand-dark); font-weight: 600; }
.step.done { color: var(--ink-2); }
.appt-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f3f8; }
.appt-row:last-child { border-bottom: 0; padding-bottom: 0; }
.appt-date { width: 52px; flex: none; text-align: center; background: #f4f7fc; border-radius: 9px; padding: 6px 0; }
.appt-date b { display: block; font-size: 17px; font-weight: 600; line-height: 1.1; color: var(--ink); }
.appt-date span { font-size: 10.5px; color: var(--ink-3); }
.appt-main { flex: 1; min-width: 0; }
.appt-main b { font-size: 13px; font-weight: 500; display: block; }
.appt-main span { font-size: 11.5px; color: var(--ink-3); }
.appt-remark::before { content: " · "; }
.nw { white-space: nowrap; }
.veh-portal { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #f1f3f8; }
.veh-portal:last-child { border-bottom: 0; padding-bottom: 0; }
.veh-portal .vp-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.veh-portal b { font-size: 13px; font-weight: 600; letter-spacing: .3px; display: block; }
.veh-portal span { font-size: 11.5px; color: var(--ink-3); }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid #f1f3f8; cursor: pointer; }
.history-item:last-child { border-bottom: 0; }
.history-item:hover .hi-title { color: var(--brand); }
.hi-title { font-size: 13px; font-weight: 500; }
.hi-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.hi-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.portal .empty { padding: 34px 16px; }
.bill-hero { background: #f8fafd; border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.bill-hero .bh-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); padding: 3px 0; }
.bill-hero .bh-row.total { border-top: 1px dashed var(--line-strong); margin-top: 8px; padding-top: 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
.bill-hero .bh-row.total b { color: var(--danger); font-size: 20px; }

/* ---------------------------- 响应式 ---------------------------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .dash-grid-2, .detail-grid, .report-grid, .report-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .part-summary, .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-card .brand-mobile { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
  .auth-card .brand-mobile .name { font-size: 15px; font-weight: 600; }
  .auth-card .brand-mobile .sub { font-size: 10.5px; color: var(--ink-3); letter-spacing: 1.6px; }
  .table .hide-md { display: none; }
  .portal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  html, body { overflow-x: hidden; }

  /* ---- 后台框架：手机端用顶栏 + 抽屉 + 底部 tab，彻底隐藏左侧边栏 ---- */
  .sidebar, .topbar { display: none !important; }
  .mheader { display: flex; }
  .mtabbar { display: flex; }
  .mdrawer { display: flex; }
  .admin { min-height: 100vh; }
  .admin .main { margin-left: 0; display: flex; flex-direction: column; min-height: 100vh; }
  .admin .view { flex: 1; padding: 12px 12px calc(56px + env(safe-area-inset-bottom)); }
  /* 打开抽屉时禁止正文滚动 */
  body.mdrawer-open { overflow: hidden; }

  /* ---- 卡片头 / 筛选与操作按钮重排 ---- */
  .card-head { flex-wrap: wrap; gap: 10px; padding: 14px; }
  .card-head > .toolbar { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
  .card-head .search { flex: 1 1 100%; min-width: 0; }
  .card-head .search .input { width: 100%; min-width: 0; }
  .card-head > .btn-primary { flex: 1 1 100%; }
  .card-head .head-actions { flex: 1 1 100%; display: flex; gap: 8px; }
  .card-head .head-actions .btn { flex: 1; }
  .card-body { padding: 14px; }
  .toolbar .select { flex: 1 1 auto; min-width: 0; }
  .seg { display: flex; max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .seg button { flex: none; white-space: nowrap; }

  /* ---- 统计块 ---- */
  .kpi-grid, .part-summary, .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .k-val { font-size: 21px; }
  .mini-stat { padding: 11px 12px; }
  .mini-stat .ms-val { font-size: 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .add-item-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .add-item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .add-item-grid .ai-name { grid-column: 1 / -1; }
  .add-item-grid .ai-btn { grid-column: 1 / -1; height: 38px; }

  /* ---- 表格 → 卡片 ---- */
  .table-wrap { overflow: visible; -webkit-overflow-scrolling: touch; }
  .table-wrap[style] { max-height: none !important; }
  .table { display: block; width: 100%; }
  .table thead { display: none; }
  .table tbody { display: block; }
  .table > tbody > tr {
    display: flex; flex-direction: column; margin: 12px; padding: 10px 13px 4px;
    border: 1px solid var(--line); border-radius: 12px; background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  }
  .table > tbody > tr:hover { background: #fff; }
  .table > tbody > tr > td {
    display: block; padding: 3px 0; border: 0; text-align: left;
    white-space: normal !important; word-break: break-word;
    font-size: 12.8px; line-height: 1.6;
  }
  .table > tbody > tr > td[data-label]::before {
    content: attr(data-label) "："; color: var(--ink-3); font-size: 12px; margin-right: 2px;
  }
  .table > tbody > tr > td.right, .table > tbody > tr > td.right .num { text-align: left; }
  .table > tbody > tr > td.card-title {
    order: -1; padding: 2px 0 7px; margin-bottom: 5px; border-bottom: 1px dashed var(--line);
    font-size: 14.5px; font-weight: 600;
  }
  .table > tbody > tr > td.card-title::before { display: none; }
  .table > tbody > tr > td .cell-main { display: inline; font-weight: 500; }
  .table > tbody > tr > td .cell-sub { display: inline; margin: 0 0 0 6px; font-size: 12px; }
  .table > tbody > tr > td.w-actions {
    display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px;
    margin-top: 8px; padding: 10px 0 8px; border-top: 1px solid #f0f3f8;
  }
  .table > tbody > tr > td.w-actions::before { display: none; }
  .table > tbody > tr > td[colspan] { display: block; }
  .table > tbody > tr > td[colspan]::before { display: none; }
  .table .hide-md { display: block; }
  .table td .stock-cell { min-width: 0; }
  .table td .stock-cell .progress { max-width: 240px; }
  .items-table td { padding-top: 3px; padding-bottom: 3px; }

  /* ---- 工单详情 ---- */
  .detail-head { gap: 10px; }
  .detail-head .dh-left { width: 100%; gap: 10px; }
  .detail-head h2 { font-size: 16.5px; flex-wrap: wrap; }
  .detail-head .dh-sub { font-size: 12px; }
  .detail-actions { width: 100%; gap: 8px; }
  .detail-actions > .btn { flex: 1 1 calc(50% - 4px); }
  .detail-actions > .badge { flex: 1 1 100%; justify-content: center; }

  /* ---- 报表 ---- */
  .report-range { width: 100%; }
  .report-range .input { flex: 1; width: auto; min-width: 0; }
  .rank-list { padding-left: 14px; padding-right: 14px; }
  .pay-chart-row { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 14px 6px; }
  .pay-chart-row > svg { align-self: center; }
  .pay-chart-row .pay-legend { padding: 0; }

  /* ---- 弹窗 ---- */
  .modal-mask { padding: 10px; }
  .modal { max-width: 100% !important; border-radius: 12px; margin-bottom: 24px; }
  .modal-head { padding: 16px 16px 10px; }
  .modal-body { padding: 4px 16px 16px; }
  .modal-foot { padding: 12px 16px 16px; flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
  .modal-foot .btn-primary { flex-basis: 100%; }

  /* ---- 车主端 ---- */
  .portal-hero h1 { font-size: 21px; }
  .appt-row { flex-wrap: wrap; gap: 8px 10px; align-items: flex-start; }
  .appt-main { order: 2; flex: 1 1 100%; }
  .appt-row > .badge { order: 1; margin-left: auto; }
  .appt-row > .btn { order: 1; }
  .appt-main > span { display: block; }
  .appt-remark { display: block; }
  .appt-remark::before { content: ""; }
  .portal-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; overflow: visible; margin-top: 18px; }
  .portal-tabs button { justify-content: center; gap: 4px; padding: 9px 0 14px; font-size: 12px; }
  .portal-tabs button svg { width: 14px; height: 14px; }
}

@media (max-width: 340px) {
  .kpi-grid, .report-kpis, .part-summary { grid-template-columns: minmax(0, 1fr); }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .portal-tabs button { font-size: 11.5px; }
  .portal-tabs button svg { display: none; }
}
