/* 手机版（2026-11-17）。body.is-mobile 由 public/mobile.js 按屏幕宽度加上；电脑宽度下这里的规则基本不生效。 */

/* ---- 外壳 ---- */
.m-top, .m-tabs { display: none; }
body.is-mobile { background: #f2f4f7; -webkit-text-size-adjust: 100%; }
body.is-mobile .shell { display: block; min-height: 100vh; min-height: 100dvh; padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
body.is-mobile .sidebar { display: none; }
body.is-mobile .main { padding: 12px 12px 20px; }
body.is-mobile .shell > #totpBanner { margin: 10px 12px 0; font-size: 13px; }
/* 安全提醒只在首页露一次，别的页面不占地方 */
body.is-mobile:not(.m-at-home) .shell > #totpBanner { display: none; }
body.is-mobile .m-top { position: sticky; top: 0; z-index: 12; display: flex; align-items: center; gap: 6px; min-height: 46px; padding: env(safe-area-inset-top) 6px 0 12px; background: var(--navy); color: #fff; }
.m-top-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.m-top-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-top-btn { width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 0; color: inherit; border-radius: 10px; }
.m-top-btn:active { background: rgba(255, 255, 255, .14); }
.m-top > .m-top-btn:first-child { margin-left: -8px; }
body.is-mobile .m-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; display: flex; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.m-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 5px; font-size: 11px; color: #7a8598; text-decoration: none; }
.m-tab[aria-current="page"] { color: var(--navy); font-weight: 600; }
.m-tab[aria-current="page"] svg { stroke-width: 2.2; }
body.is-mobile .toast { bottom: calc(72px + env(safe-area-inset-bottom)); max-width: 88vw; text-align: center; }
body.is-mobile .app-update-bar { bottom: calc(66px + env(safe-area-inset-bottom)); }

/* 手机横过来：标签栏挪到左边竖着放，标题栏收掉，把高度都留给内容 */
@media (orientation: landscape) and (max-height: 500px) {
  body.is-mobile .shell { padding-bottom: 0; padding-left: calc(58px + env(safe-area-inset-left)); }
  body.is-mobile .m-tabs { top: 0; right: auto; width: calc(58px + env(safe-area-inset-left)); padding: 0 0 0 env(safe-area-inset-left); flex-direction: column; justify-content: center; border-top: 0; border-right: 1px solid var(--line); }
  body.is-mobile .m-tab { flex: 0 0 auto; padding: 7px 0; }
  body.is-mobile .m-top { display: none; }
  body.is-mobile .main { padding: 8px 10px 12px; }
}

/* ---- 通用小件 ---- */
.m-page { display: flex; flex-direction: column; gap: 10px; }
.m-card { background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(13, 42, 71, .06); }
.m-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.m-card-head h2 { margin: 0; font-size: 15px; color: var(--navy); }
.m-card-head h2 small { font-weight: 400; color: var(--muted); font-size: 12px; }
.m-card-head a { font-size: 13px; color: #4b6584; text-decoration: none; white-space: nowrap; }
.m-empty { margin: 0; padding: 14px 0; text-align: center; color: var(--muted); font-size: 13px; }
.m-empty.is-error { color: var(--bad); }
.m-foot-note { margin: 2px 4px 0; font-size: 12px; color: #8a94a6; line-height: 1.6; text-align: center; }
.m-icon-btn { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); padding: 0; }
.m-icon-btn.is-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.m-badge { min-width: 18px; padding: 0 5px; border-radius: 9px; background: #d92d20; color: #fff; font-size: 11px; font-style: normal; line-height: 18px; text-align: center; }

/* 彩色小标签：同一个字同一种颜色 */
.m-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.m-pill { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; line-height: 20px; white-space: nowrap; background: #eef1f5; color: #344054; }
.m-tone-0 { background: #dbeafe; color: #1e40af; } .m-tone-1 { background: #cffafe; color: #155e75; } .m-tone-2 { background: #e0e7ff; color: #3730a3; }
.m-tone-3 { background: #fce7f3; color: #9d174d; } .m-tone-4 { background: #fef3c7; color: #92400e; } .m-tone-5 { background: #ede9fe; color: #5b21b6; }
.m-tone-6 { background: #ffedd5; color: #9a3412; } .m-tone-7 { background: #d1fae5; color: #065f46; } .m-tone-8 { background: #e2e8f0; color: #334155; }
.m-tone-9 { background: #ccfbf1; color: #115e59; }
.m-pill-type { background: #dcfce7; color: #166534; }
.m-pill-delivery { background: #fff1e6; color: #c2410c; font-weight: 600; }
.m-pill-result { background: #f1f5f9; color: #334155; }
.m-month-1, .m-month-7 { background: #dbeafe; color: #1e40af; } .m-month-2, .m-month-8 { background: #fce7f3; color: #9d174d; }
.m-month-3, .m-month-9 { background: #cffafe; color: #155e75; } .m-month-4, .m-month-10 { background: #fef3c7; color: #92400e; }
.m-month-5, .m-month-11 { background: #ede9fe; color: #5b21b6; } .m-month-6, .m-month-12 { background: #d1fae5; color: #065f46; }
.m-stage { font-weight: 600; background: #eef1f5; color: #475467; }
.m-stage.is-wait { background: #eef2ff; color: #3730a3; } .m-stage.is-warn { background: #fff4e0; color: #b25e09; } .m-stage.is-go { background: #e0f2fe; color: #075985; }
.m-stage.is-sent { background: #ede9fe; color: #5b21b6; } .m-stage.is-ok { background: #dcfce7; color: #166534; } .m-stage.is-bad { background: #fee2e2; color: #991b1b; }

/* ---- 一行安排 ---- */
.m-appt { display: flex; align-items: stretch; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid #eef1f5; background: none; text-align: left; color: inherit; }
.m-card-head + .m-appt, .m-cal-dayhead + .m-cal-item > .m-appt { border-top: 0; }
.m-appt-time { flex: 0 0 44px; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; line-height: 1.35; }
.m-appt-time b { font-size: 15px; color: var(--navy); }
.m-appt-time b.is-pending { font-size: 13px; color: var(--warn); }
.m-appt-time small { font-size: 12px; color: #98a2b3; }
.m-appt-bar { flex: 0 0 3px; border-radius: 2px; background: #7c5cd6; }
.m-appt.is-done .m-appt-bar { background: #16a34a; }
.m-appt.is-conflict .m-appt-bar { background: #d92d20; }
.m-appt.is-past:not(.is-done) .m-appt-bar { background: #c9b8f0; }
.m-appt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.m-appt-title { font-size: 15px; line-height: 1.4; color: #1c2430; overflow-wrap: anywhere; }
.m-appt.is-done .m-appt-title { color: #15803d; }
.m-appt.is-past:not(.is-done) .m-appt-title { color: #667085; }
.m-appt.is-cancelled .m-appt-title { text-decoration: line-through; color: #98a2b3; }
.m-appt-delivery { font-style: normal; color: #c2410c; font-size: 13px; }
.m-appt-sub { font-size: 13px; color: #475467; }
.m-appt-meta { font-size: 12px; color: #8a94a6; }
.m-appt-note { align-self: flex-start; margin-top: 3px; padding: 1px 7px; border-radius: 5px; border-left: 3px solid #f5b301; background: #fff8db; color: #7a5200; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.m-appt-side { flex: 0 0 auto; align-self: center; min-width: 30px; padding: 2px 6px; border-radius: 10px; background: #f1f5f9; color: #64748b; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.m-appt.is-done .m-appt-side { background: #dcfce7; color: #15803d; font-weight: 700; }

/* ---- 首页 ---- */
.m-hello { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 4px 4px 0; }
.m-hello b { font-size: 18px; color: var(--navy); }
.m-hello span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.m-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.m-tiles:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.m-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(13, 42, 71, .06); text-decoration: none; color: inherit; }
.m-tile b { font-size: 24px; line-height: 1.15; color: var(--navy); font-variant-numeric: tabular-nums; }
.m-tile span { font-size: 12px; color: var(--muted); }
.m-tile.is-warn b { color: var(--bad); }
.m-more-link { display: block; padding: 8px 0 2px; border-top: 1px solid #eef1f5; font-size: 13px; color: #4b6584; text-align: center; text-decoration: none; }
.m-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.m-grid-item { position: relative; display: grid; place-items: center; min-height: 46px; padding: 6px 4px; border-radius: 10px; background: #f4f6f9; color: #243b53; font-size: 13px; text-align: center; text-decoration: none; line-height: 1.3; }
.m-grid-item:active { background: #e6ebf2; }
.m-grid-item .m-badge { position: absolute; top: -5px; right: -3px; }
@media (min-width: 560px) { .m-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ---- 更多 ---- */
.m-me { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.m-me b { display: block; font-size: 16px; color: var(--navy); }
.m-me small { color: var(--muted); }
.m-me-actions { display: flex; gap: 6px; }

/* ---- 台账 ---- */
.m-ledger-head { position: sticky; top: calc(46px + env(safe-area-inset-top)); z-index: 5; display: flex; flex-direction: column; gap: 8px; margin: -12px -12px 0; padding: 10px 12px 8px; background: #f2f4f7; }
.m-search-row { display: flex; gap: 8px; }
.m-search { flex: 1; min-width: 0; height: 40px; border-radius: 10px; font-size: 16px; padding: 0 12px; }
.m-selects, .m-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
.m-selects::-webkit-scrollbar, .m-chips::-webkit-scrollbar { display: none; }
.m-selects select { flex: 0 0 auto; width: auto; max-width: 46vw; height: 32px; padding: 0 8px; border-radius: 16px; font-size: 13px; background: #fff; }
.m-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid var(--line); background: #fff; color: #475467; font-size: 13px; }
.m-chip small { color: #98a2b3; font-size: 11px; }
.m-chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.m-chip[aria-pressed="true"] small { color: rgba(255, 255, 255, .75); }
.m-count { margin: 0 4px; font-size: 12px; color: #8a94a6; }
.m-cards { display: flex; flex-direction: column; gap: 8px; }
.m-lcard { position: relative; display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 12px 14px; border: 0; border-left: 4px solid transparent; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(13, 42, 71, .06); text-align: left; color: inherit; }
.m-lcard:active { background: #f8fafc; }
.m-lcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.m-lcard-name { font-size: 16px; line-height: 1.35; color: #1c2430; overflow-wrap: anywhere; }
.m-lcard-name small { font-weight: 400; font-size: 12px; color: var(--muted); }
.m-when { font-size: 13px; color: #344054; font-variant-numeric: tabular-nums; }
.m-when b { margin-right: 6px; padding: 0 6px; border-radius: 5px; background: #d92d20; color: #fff; font-size: 12px; }
.m-when.is-near { color: #b42318; font-weight: 600; }
.m-when.is-past { color: #98a2b3; }
.m-when.is-none { color: #b25e09; }
.m-lcard-meta { font-size: 12px; color: #8a94a6; }
.m-lcard-note { padding: 3px 8px; border-radius: 6px; border-left: 3px solid #f5b301; background: #fff8db; color: #7a5200; font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.m-lcard-money { font-size: 12px; color: #475467; font-variant-numeric: tabular-nums; }
.m-lcard-money .is-unpaid, .m-td-num.is-unpaid { color: var(--bad); }
.m-lcard-id { position: absolute; right: 12px; bottom: 8px; font-size: 11px; color: #c0c7d2; }
.m-load-more { width: 100%; margin-top: 8px; padding: 10px; border-radius: 12px; }
.m-row-red { border-left-color: #e5484d; } .m-row-orange { border-left-color: #f97316; } .m-row-amber { border-left-color: #e2a400; } .m-row-lime { border-left-color: #84b816; }
.m-row-green { border-left-color: #30a46c; } .m-row-teal { border-left-color: #12a594; } .m-row-cyan { border-left-color: #0ea5c6; } .m-row-blue { border-left-color: #3b6fe0; }
.m-row-indigo { border-left-color: #5b5bd6; } .m-row-purple { border-left-color: #8e4ec6; } .m-row-pink { border-left-color: #d6409f; } .m-row-gray { border-left-color: #8b8d98; }

/* 表格模式（横屏默认）：表头吸顶、姓名列冻结 */
.m-table-wrap { overflow: auto; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(13, 42, 71, .06); -webkit-overflow-scrolling: touch; }
.m-table { border-collapse: separate; border-spacing: 0; font-size: 13px; white-space: nowrap; }
.m-table th, .m-table td { padding: 8px 10px; border-bottom: 1px solid #eef1f5; text-align: left; vertical-align: middle; }
.m-table thead th { position: sticky; top: 0; z-index: 2; background: #f6f8fb; color: #667085; font-weight: 500; font-size: 12px; }
.m-table .m-th-name { position: sticky; left: 0; z-index: 1; min-width: 96px; max-width: 150px; white-space: normal; background: #fff; box-shadow: 1px 0 0 #e2e5ea; font-weight: 600; color: #1c2430; }
.m-table thead .m-th-name { z-index: 3; background: #f6f8fb; font-weight: 500; color: #667085; }
.m-table tbody .m-th-name { border-left: 3px solid transparent; }
.m-table tr.m-row-red .m-th-name { border-left-color: #e5484d; } .m-table tr.m-row-orange .m-th-name { border-left-color: #f97316; } .m-table tr.m-row-amber .m-th-name { border-left-color: #e2a400; }
.m-table tr.m-row-lime .m-th-name { border-left-color: #84b816; } .m-table tr.m-row-green .m-th-name { border-left-color: #30a46c; } .m-table tr.m-row-teal .m-th-name { border-left-color: #12a594; }
.m-table tr.m-row-cyan .m-th-name { border-left-color: #0ea5c6; } .m-table tr.m-row-blue .m-th-name { border-left-color: #3b6fe0; } .m-table tr.m-row-indigo .m-th-name { border-left-color: #5b5bd6; }
.m-table tr.m-row-purple .m-th-name { border-left-color: #8e4ec6; } .m-table tr.m-row-pink .m-th-name { border-left-color: #d6409f; } .m-table tr.m-row-gray .m-th-name { border-left-color: #8b8d98; }
.m-th-name small { display: block; font-weight: 400; font-size: 11px; color: #b0b8c4; }
.m-table tbody tr:active td, .m-table tbody tr:active .m-th-name { background: #f4f7fb; }
.m-td-when, .m-td-num { font-variant-numeric: tabular-nums; }
.m-td-num { text-align: right !important; }
.m-td-note { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: #7a5200; }
@media (orientation: landscape) and (max-height: 500px) {
  .m-ledger-head { position: static; margin: 0; padding: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .m-ledger-head .m-search-row { flex: 1 1 240px; }
  .m-ledger-head .m-selects { flex: 2 1 320px; margin: 0; padding: 0; }
  .m-ledger-head .m-chips { flex: 1 1 100%; margin: 0; padding: 0; }
  .m-search, .m-icon-btn { height: 34px; }
  .m-icon-btn { width: 34px; }
  .m-table-wrap { max-height: calc(100dvh - 118px); }
  .m-ledger .m-count { display: none; }
}

/* ---- 台账详情（全屏一页） ---- */
.m-sheet { width: 100vw; max-width: 720px; height: 100vh; height: 100dvh; max-height: none; margin: 0 auto; padding: 0; border: 0; background: #f2f4f7; color: var(--text); }
.m-sheet::backdrop { background: rgba(13, 42, 71, .45); }
.m-sheet-body { display: flex; flex-direction: column; gap: 10px; padding: 0 12px calc(20px + env(safe-area-inset-bottom)); }
.m-sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px; margin: 0 -12px; padding: env(safe-area-inset-top) 12px 0 4px; min-height: 50px; background: var(--navy); color: #fff; }
.m-sheet-title { min-width: 0; }
.m-sheet-title b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-sheet-title small { font-size: 12px; opacity: .75; }
.m-sheet-actions { display: flex; gap: 8px; overflow-x: auto; }
.m-sheet-actions > * { flex: 0 0 auto; padding: 7px 14px; border-radius: 18px; font-size: 13px; text-decoration: none; color: var(--navy); }
.m-kv-group { padding: 10px 0 2px; }
.m-kv-group .m-card-head { padding: 0 14px; }
.m-kv { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 42px; padding: 10px 14px; border: 0; border-top: 1px solid #f0f2f5; background: none; text-align: left; color: inherit; font-size: 14px; }
.m-kv.is-editable:active { background: #f6f8fb; }
.m-kv-k { flex: 0 0 92px; color: #8a94a6; font-size: 13px; line-height: 22px; }
.m-kv-v { flex: 1; min-width: 0; line-height: 22px; overflow-wrap: anywhere; white-space: pre-wrap; }
.m-kv > .m-pill { margin-right: auto; }
.m-kv-v.is-blank { color: #c0c7d2; }
.m-kv-v.is-warn { color: var(--bad); font-weight: 600; }
.m-kv-v.is-note { color: #7a5200; }
.m-kv-go { flex: 0 0 auto; color: #c0c7d2; font-size: 18px; line-height: 22px; }
.m-edit input, .m-edit select, .m-edit textarea { font-size: 16px; min-height: 42px; }
.m-edit-pair { display: flex; flex-direction: column; gap: 4px; }
.m-edit-hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

/* ---- 日历（手机排法，页面骨架在 business.js calendar() 里） ---- */
.m-cal { gap: 8px; }
.m-cal-head { display: flex; align-items: center; gap: 6px; }
.m-cal-nav { width: 34px; height: 40px; border: 0; background: none; color: var(--navy); font-size: 24px; line-height: 1; padding: 0; }
.m-cal-title { position: relative; flex: 1; min-width: 0; margin: 0; text-align: center; }
.m-cal-title h2 { margin: 0; font-size: 18px; color: var(--navy); white-space: nowrap; }
.m-cal-title input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.m-cal-today { height: 34px; border-radius: 17px; padding: 0 12px; }
.m-cal-panel { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; background: #fff; }
.m-cal-panel input, .m-cal-panel select { font-size: 16px; }
.m-cal-panel .business-cal-search { margin: 0; }
.m-cal-board { padding: 8px 6px 2px; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(13, 42, 71, .06); }
.m-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; }
.m-cal-wd { padding: 2px 0 6px; text-align: center; font-size: 12px; color: #98a2b3; }
.m-cal-wd:nth-child(6), .m-cal-wd:nth-child(7) { color: #c0c7d2; }
.m-cal-day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 3px 0 4px; border: 0; background: none; color: #1c2430; border-radius: 12px; }
.m-cal-num { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 17px; font-variant-numeric: tabular-nums; }
.m-cal-n { font-size: 10px; line-height: 13px; color: #7c5cd6; font-weight: 600; }
.m-cal-n.is-none { color: #d5dae2; font-weight: 400; }
.m-cal-day.is-outside .m-cal-num { color: #c0c7d2; }
.m-cal-day.is-outside .m-cal-n { opacity: .55; }
.m-cal-day.is-rest .m-cal-num { color: #d92d20; }
.m-cal-day.is-rest .m-cal-n.is-none { color: #d92d20; }
.m-cal-day.is-work .m-cal-n.is-none { color: #667085; }
.m-cal-hol { position: absolute; top: 0; right: 4px; font-size: 9px; font-style: normal; color: #d92d20; }
.m-cal-day.is-work .m-cal-hol { color: #667085; }
.m-cal-day.is-today .m-cal-num { color: #1f6feb; font-weight: 700; }
.m-cal-day[aria-pressed="true"] .m-cal-num { background: var(--navy); color: #fff; font-weight: 600; }
.m-cal-day.is-today[aria-pressed="true"] .m-cal-num { background: #1f6feb; }
.m-cal-fold { display: block; width: 100%; padding: 4px 0 6px; border: 0; background: none; color: #98a2b3; font-size: 12px; }
.m-cal-agenda { padding: 10px 14px 4px; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(13, 42, 71, .06); }
.m-cal-dayhead { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; }
.m-cal-dayhead b { font-size: 16px; color: var(--navy); }
.m-cal-dayhead > span:last-child { margin-left: auto; font-size: 13px; color: var(--muted); }
.m-cal-city { margin: 10px 0 0; padding: 3px 8px; border-left: 3px solid var(--gold); background: #faf7f0; border-radius: 0 6px 6px 0; font-size: 13px; color: var(--navy); }
.m-cal-city small { font-weight: 400; color: var(--muted); }
.m-cal-city + .m-cal-item > .m-appt { border-top: 0; }
.m-cal-item.is-open > .m-appt { background: #f8fafc; margin: 0 -14px; padding-left: 14px; padding-right: 14px; width: calc(100% + 28px); }
.m-cal-detail { margin: 0 -8px 8px; }
.m-cal-detail .appt-card { border: 1px solid #e1e7ef; border-radius: 12px; }
.m-cal-detail .appt-main { padding: 10px 12px 4px; gap: 8px; }
.m-cal-detail .appt-when, .m-cal-detail .appt-names { display: none; } /* 时间和名字上面那一行已经有了 */
.m-cal-detail .appt-title { font-size: 13px; font-weight: 400; color: #475467; }
.m-cal-detail .appt-card > .business-checks { padding: 8px 12px 0; }
.m-cal-detail .business-check-btn { flex: 1 1 calc(50% - 8px); justify-content: flex-start; padding: 9px 10px; }
.m-cal-detail .appt-foot { padding: 8px 12px 10px; }
.m-cal-undated { padding: 10px 14px 4px; border-radius: 14px; }
.m-cal-undated h2 { margin: 0 0 2px; font-size: 14px; color: var(--warn); }

/* ---- 沿用电脑版页面时的收紧（酒店、结款、图表、知识库等） ---- */
body.is-mobile .page-head { margin-bottom: 10px; gap: 8px; }
body.is-mobile .page-head h1 { display: none; }
body.is-mobile .page-head p { font-size: 12px; line-height: 1.5; margin: 0; color: #8a94a6; }
body.is-mobile .page-head .actions { width: 100%; }
body.is-mobile .card, body.is-mobile .business-card { padding: 12px 14px; }
body.is-mobile input, body.is-mobile select, body.is-mobile textarea { font-size: 16px; } /* 小于 16px iPhone 会自动放大页面 */
body.is-mobile .m-selects select { font-size: 13px; }
body.is-mobile .dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92dvh; }
body.is-mobile .dialog-body { max-height: calc(92dvh - 150px); }
body.is-mobile .dialog footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
body.is-mobile .dialog footer button { flex: 1; padding: 10px; }
body.is-mobile .business-form-grid { grid-template-columns: 1fr; }
body.is-mobile table { font-size: 13px; }
body.is-mobile .table-wrap, body.is-mobile .business-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 知识库：手机上先看搜索和正文，目录树排到后面（不然第一屏全是目录） */
body.is-mobile .kb-shell, body.is-mobile .kb-shell.has-toc { display: flex; flex-direction: column; gap: 12px; margin: 0; }
body.is-mobile .kb-main { order: 1; width: 100%; }
body.is-mobile .kb-side { order: 2; position: static; max-height: none; width: 100%; }
body.is-mobile .kb-article { padding: 14px; }

/* 手机横过来看日历：左边月历、右边当天安排 */
@media (orientation: landscape) and (max-height: 500px) {
  .m-cal { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 8px 10px; align-items: start; }
  .m-cal > .m-cal-head, .m-cal > .m-cal-panel, .m-cal > .business-error, .m-cal > .business-note { grid-column: 1 / -1; }
  .m-cal > .m-cal-board { grid-column: 1; position: sticky; top: 8px; }
  .m-cal > .m-cal-agenda, .m-cal > .m-cal-undated { grid-column: 2; }
  .m-cal-num { width: 28px; height: 28px; font-size: 15px; }
  .m-cal-day { padding: 1px 0 2px; }
  .m-cal-head { margin-bottom: -2px; }
}

/* ---- 第二期：随手记跟进 ---- */
.m-btn { flex: 0 0 auto; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-size: 14px; font-weight: 600; white-space: nowrap; }
.m-btn.is-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.m-btn.is-block { display: block; width: 100%; height: 46px; font-size: 16px; }
.m-btn:disabled { opacity: .55; }
.m-quick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--navy); color: #fff; text-align: left; }
.m-quick svg { flex: 0 0 auto; width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.m-quick b { display: block; font-size: 16px; }
.m-quick small { font-size: 12px; opacity: .8; }
.m-quick:active { opacity: .88; }
.m-lead-list { padding: 2px 0; }
.m-lead { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 9px 14px; border: 0; border-top: 1px solid #f0f2f5; background: none; text-align: left; color: inherit; }
.m-lead:first-child { border-top: 0; }
.m-lead:active { background: #f6f8fb; }
.m-lead-main { flex: 1; min-width: 0; }
.m-lead-main b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-lead-main small { display: block; font-size: 12px; color: #8a94a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-lead-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.m-lead-side small { font-size: 11px; color: #8a94a6; }
.m-lead-side small.is-due { color: var(--bad); font-weight: 600; }
.m-form { display: flex; flex-direction: column; gap: 10px; }
.m-form-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.m-form-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #8a94a6; }
.m-form-card label.m-form-inline { flex-direction: row; align-items: center; gap: 10px; }
.m-form-card input, .m-form-card textarea, .m-form-card select { font-size: 16px; min-height: 42px; color: var(--text); }
.m-form-card label.m-form-inline input { flex: 1; min-width: 0; }
.m-form-k { font-size: 13px; color: #8a94a6; }
.m-chips.m-chips-wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.m-chips-wrap .m-chip { height: 34px; padding: 0 13px; font-size: 14px; }
.m-form-error { margin: 0; min-height: 18px; font-size: 13px; color: var(--bad); }
.m-form-error:empty { display: none; }

/* ---- 第二期：结款的手机排法 ---- */
.m-tiles.m-tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.m-recv .m-tile { border: 0; text-align: left; font: inherit; }
.m-recv .m-tile b { font-size: 20px; }
.m-link { border: 0; background: none; padding: 0; font-size: 13px; color: #4b6584; }
.m-rgroups { padding-bottom: 2px; }
.m-rgroup { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 8px 0; border: 0; border-top: 1px solid #f0f2f5; background: none; text-align: left; color: inherit; }
.m-rgroup.is-on { background: #eef4fb; margin: 0 -14px; padding: 8px 14px; width: calc(100% + 28px); }
.m-rgroup-main { flex: 1; min-width: 0; }
.m-rgroup-main b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-rgroup-main small { display: block; font-size: 12px; color: #8a94a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-rgroup-num { flex: 0 0 auto; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: #475467; }
.m-rgroup-num.is-unpaid, .m-rcard-nums .is-unpaid { color: var(--bad); }
.m-rcard { text-align: left; color: inherit; font: inherit; }
.m-rcard.is-late { border-left-color: var(--bad); }
.m-rcard-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.m-rcard-nums small { display: block; font-size: 11px; font-weight: 400; color: #8a94a6; }

/* 拍照传材料 */
.m-link-btn { margin-left: 10px; padding: 0; border: 0; background: none; color: #c0392b; font-size: 13px; text-decoration: underline; }

/* ---- 第三期（2026-11-17）：财务、酒店、图表、知识库的手机排法 ---- */
body.is-mobile .desk-only { display: none !important; }
/* 数字块：一排小格，不再一个数占半屏 */
body.is-mobile .business-stats, body.is-mobile .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 8px; margin-bottom: 10px; }
body.is-mobile .business-stat, body.is-mobile .stat { padding: 8px 10px; border-radius: 10px; min-width: 0; }
body.is-mobile .business-stat small, body.is-mobile .stat small { display: block; font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.is-mobile .business-stat strong, body.is-mobile .stat b { font-size: 18px; margin-top: 2px; white-space: nowrap; }
body.is-mobile .stats-page .stats .stat .small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.is-mobile .stats-page .stats { grid-template-columns: repeat(3, 1fr); }
body.is-mobile .stats-grid { grid-template-columns: 1fr; gap: 10px; }
/* 财务 */
body.is-mobile .business-page .business-tabs { position: sticky; top: 0; z-index: 3; }
body.is-mobile .business-page > .business-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
body.is-mobile .business-page > .business-actions > input[type="search"] { grid-column: 1 / -1; }
body.is-mobile .business-page > .business-actions > select, body.is-mobile .business-page > .business-actions > input, body.is-mobile .business-page > .business-actions > button { width: 100%; min-width: 0; }
body.is-mobile .business-record > summary { gap: 6px 8px; }
body.is-mobile .business-record-title { flex: 1 1 120px; min-width: 0; }
body.is-mobile .business-record-title strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-mobile .business-record-title .business-note { font-size: 12px; }
body.is-mobile .business-amount.is-in { color: #1a7f4b; }
body.is-mobile .business-amount.is-in::before { content: "+"; }
body.is-mobile .business-amount.is-out { color: #b42318; }
body.is-mobile .business-amount.is-out::before { content: "−"; }
/* 酒店 */
body.is-mobile .hotel-page .hotel-stats { grid-template-columns: repeat(5, 1fr); gap: 6px; }
body.is-mobile .hotel-page .hotel-stats .stat { padding: 7px 6px; text-align: center; }
body.is-mobile .hotel-page .hotel-stats .stat small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 28px; }
body.is-mobile .hotel-page .it-hints { font-size: 12px; padding: 6px 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.is-mobile .hotel-page .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
body.is-mobile .hotel-page .tabs .tab { flex: 0 0 auto; white-space: nowrap; }
body.is-mobile .hotel-list-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
body.is-mobile .hotel-list-toolbar input[type="search"] { grid-column: 1 / -1; }
body.is-mobile .hotel-list-toolbar select { width: 100%; max-width: none; min-width: 0; font-size: 14px; }
/* 即将取消：一单一卡 */
body.is-mobile .hotel-upcoming, body.is-mobile .hotel-upcoming tbody { display: block; }
body.is-mobile .hotel-upcoming thead { display: none; }
body.is-mobile .hotel-upcoming tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
body.is-mobile .hotel-upcoming td { display: block; padding: 0; border: 0; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
body.is-mobile .hotel-upcoming td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: #8a94a6; }
body.is-mobile .hotel-upcoming td:empty { display: none; }
body.is-mobile .hotel-upcoming td.list-no { display: none; }
body.is-mobile .hotel-upcoming td[data-label="方式"], body.is-mobile .hotel-upcoming td[data-label="城市 / 酒店"], body.is-mobile .hotel-upcoming td[data-label="免费取消截止"], body.is-mobile .hotel-upcoming td[data-label="添加 / 下单"], body.is-mobile .hotel-upcoming td:last-child { grid-column: 1 / -1; }
body.is-mobile .hotel-upcoming td:last-child a { display: block; text-align: center; padding: 8px; }
body.is-mobile .list-pager { flex-wrap: wrap; gap: 8px; }
/* 知识库文章：操作按钮排成一行，左右滑 */
body.is-mobile .kb-doc-actions { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
body.is-mobile .kb-doc-actions > * { flex: 0 0 auto; white-space: nowrap; padding: 6px 12px; font-size: 13px; }
body.is-mobile .kb-tbl-hint { display: none; }
body.is-mobile .business-page > .business-actions > .m-skip { display: none; }
