/* V Car 司机网页版 —— 只面向手机：iPhone（Safari）与三星（Samsung Internet / Chrome），含 Fold 折叠与展开 */
:root {
  --brand: #e8501e; --brand-dark: #c9400f; --brand-soft: #fdeee8;
  --ink: #1c1917; --muted: #78716c; --line: #ebe7e2; --canvas: #f6f4f1; --card: #ffffff;
  --ok: #15803d; --ok-soft: #e8f5ec; --danger: #b91c1c; --danger-soft: #fdecec;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --tabbar: 58px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--canvas); }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", "PingFang SC", "SamsungOne", "One UI Sans KR", "Noto Sans KR", "Noto Sans SC", "Malgun Gothic", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; word-break: break-word;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
[v-cloak] { display: none; }

.boot { height: 100vh; height: 100dvh; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; letter-spacing: .08em; }
.shell { min-height: 100vh; min-height: 100dvh; max-width: 640px; margin: 0 auto; padding-left: var(--sal); padding-right: var(--sar); }

/* 顶栏 */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); padding-top: var(--sat); }
.top-in { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; }
.top h1 { flex: 1; min-width: 0; margin: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .logo { height: 30px; width: auto; display: block; border-radius: 6px; }
.top .brandname { font-size: 17px; font-weight: 700; margin-left: 8px; flex: 1; }
.icon-btn { min-width: 44px; height: 44px; padding: 0 10px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; color: var(--muted); font-weight: 600; }
.icon-btn:active { background: var(--canvas); }
.icon-btn.back { margin-left: -12px; font-size: 26px; color: var(--ink); font-weight: 400; }
.lang-btn { border: 1px solid var(--line); height: 36px; min-width: 56px; border-radius: 18px; font-size: 14px; color: var(--ink); background: #fff; }

.page { padding: 12px 12px calc(var(--tabbar) + var(--sab) + 20px); }
.page.no-tab { padding-bottom: calc(var(--sab) + 24px); }
.page.with-action { padding-bottom: calc(var(--sab) + 150px); }

/* 底部导航 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); padding-bottom: var(--sab); }
.tabbar-in { max-width: 640px; margin: 0 auto; height: var(--tabbar); display: flex; padding: 0 var(--sar) 0 var(--sal); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); font-weight: 600; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--brand); }

/* 分段切换 */
.seg { display: flex; background: #ece8e3; border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; height: 40px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.day { margin: 16px 4px 8px; font-size: 14px; font-weight: 700; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.day b { color: var(--ink); font-size: 16px; }
.day.today b { color: var(--brand); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
button.card { display: block; width: 100%; text-align: left; }
button.card:active { background: #fbfaf8; }
.job-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.job-time { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.job-meta { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { flex: none; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--canvas); color: var(--muted); white-space: nowrap; }
.pill.live { background: var(--brand-soft); color: var(--brand-dark); }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }

.route { position: relative; padding-left: 22px; }
.route::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; border-left: 2px dotted #d6d0c8; }
.route .pt { position: relative; padding: 2px 0; font-size: 15px; line-height: 1.4; }
.route .pt + .pt { margin-top: 8px; }
.route .pt::before { content: ""; position: absolute; left: -22px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); }
.route .pt.to::before { border-color: var(--brand); }
.route .pt small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.job-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.job-foot b { color: var(--ink); font-weight: 600; }

.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty .big { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 20px; }
.hint { font-size: 13px; color: var(--muted); }
.err { background: var(--danger-soft); color: var(--danger); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 12px; font-size: 16px; font-weight: 700; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn:active { filter: brightness(.96); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 58px; font-size: 18px; border-radius: 14px; }
.btn.ghost-danger { color: var(--danger); background: transparent; border-color: transparent; font-weight: 600; font-size: 15px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; min-width: 0; }

/* 详情页 */
.hero { text-align: left; }
.hero .when { font-size: 15px; color: var(--muted); font-weight: 600; }
.hero .time { font-size: 40px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.steps { display: flex; gap: 4px; margin: 14px 0 6px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: #e7e2dc; }
.steps i.on { background: var(--brand); }
.step-name { font-size: 14px; font-weight: 700; color: var(--brand-dark); }
.sect-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; margin-bottom: 4px; }
.addr { font-size: 17px; font-weight: 600; line-height: 1.4; }
.addr-actions { display: flex; gap: 8px; margin-top: 10px; }
.addr-actions .btn { flex: 1; min-height: 44px; font-size: 15px; padding: 0 8px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 15px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span:first-child { color: var(--muted); flex: none; }
.kv span:last-child { text-align: right; font-weight: 600; min-width: 0; }
.pax-row { display: flex; align-items: center; gap: 12px; }
.pax-row .who { flex: 1; min-width: 0; }
.pax-row .who b { display: block; font-size: 17px; }
.pax-row .who span { font-size: 14px; color: var(--muted); }

.action { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); padding: 12px 12px calc(12px + var(--sab)); }
.action-in { max-width: 616px; margin: 0 auto; padding: 0 var(--sar) 0 var(--sal); }
.action .loc { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.action .loc.on { color: var(--ok); }

/* 底部弹层 */
.mask { position: fixed; inset: 0; z-index: 50; background: rgba(28,25,23,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; background: #fff; border-radius: 20px 20px 0 0; padding: 20px 16px calc(16px + var(--sab)); max-height: 86vh; max-height: 86dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet h3 { margin: 0 0 6px; font-size: 19px; }
.sheet p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.sheet .btn + .btn { margin-top: 10px; }
.sheet .btn-row .btn + .btn { margin-top: 0; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; font-size: 16px; font-weight: 600; text-align: left; }
.opt.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.opt .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cfc8bf; flex: none; }
.opt.on .dot { border: 6px solid var(--brand); }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--sab) + 28px); transform: translateX(-50%); z-index: 60; background: rgba(28,25,23,.92); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; max-width: 86vw; text-align: center; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.input { width: 100%; height: 50px; border: 1px solid #d9d3cb; border-radius: 12px; padding: 0 14px; font-size: 17px; background: #fff; outline: none; -webkit-appearance: none; appearance: none; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input[readonly] { background: #faf8f6; color: var(--muted); }
.input.code { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.search-row { display: flex; gap: 8px; }
.search-row .input { flex: 1; min-width: 0; }
.search-row .btn { flex: none; min-height: 50px; }

/* 合同 */
.langs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.langs .btn { min-height: 54px; }
.langs .btn.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.kicker { font-size: 12px; font-weight: 700; color: var(--brand-dark); letter-spacing: .06em; }
.c-title { margin: 2px 0 12px; font-size: 18px; font-weight: 800; }
.agreement { max-height: 46vh; max-height: 46dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fcfbfa; font-size: 14px; line-height: 1.65; }
.agreement h4 { margin: 0 0 4px; font-size: 16px; text-align: center; }
.agreement .date { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.agreement h5 { margin: 12px 0 2px; font-size: 14px; }
.agreement p { margin: 0; }
.parties { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; }
.consent { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 12px 2px; font-size: 14px; line-height: 1.5; }
.consent .box { flex: none; width: 26px; height: 26px; border-radius: 7px; border: 2px solid #cfc8bf; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 17px; font-weight: 800; }
.consent.on .box { background: var(--brand); border-color: var(--brand); }
.pad-wrap { position: relative; border: 2px dashed #cfc8bf; border-radius: 14px; background: #fff; overflow: hidden; }
.pad-wrap canvas { display: block; width: 100%; height: 200px; touch-action: none; -webkit-user-select: none; user-select: none; }
.pad-wrap .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #c4bdb4; font-size: 16px; pointer-events: none; }
.pad-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.signed-img { display: block; max-width: 100%; max-height: 140px; margin: 8px auto 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.okmark { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 34px; display: flex; align-items: center; justify-content: center; margin: 8px auto 12px; }
.center { text-align: center; }

.gate { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 28px calc(32px + var(--sab)); }
.gate-logo { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; margin-bottom: 26px; }
.gate-logo img { height: 48px; display: block; }
.gate h2 { margin: 0 0 10px; font-size: 21px; }
.gate p { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #e3ddd6; border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 很窄的屏幕：Galaxy Fold 折叠态（约 280–344px）、iPhone SE 一代 */
@media (max-width: 350px) {
  body { font-size: 15px; }
  .page { padding-left: 8px; padding-right: 8px; }
  .card { padding: 12px; border-radius: 14px; }
  .job-time { font-size: 23px; }
  .hero .time { font-size: 34px; }
  .top-in { padding-left: 12px; }
  .top .brandname { visibility: hidden; width: 0; margin: 0; }
  .btn { padding: 0 10px; font-size: 15px; }
  .btn.big { font-size: 16px; min-height: 54px; }
  .addr-actions { flex-wrap: wrap; }
  .seg button { font-size: 14px; }
  .langs { grid-template-columns: 1fr; }
  .pad-wrap canvas { height: 170px; }
}
/* 宽一些的屏幕：Fold 展开、横屏 */
@media (min-width: 600px) {
  .page { padding-left: 20px; padding-right: 20px; }
  .pad-wrap canvas { height: 240px; }
}
/* 横屏且很矮：把签名区留够 */
@media (orientation: landscape) and (max-height: 480px) {
  .agreement { max-height: 60vh; }
  .pad-wrap canvas { height: 180px; }
  .top-in { height: 46px; }
}
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }
