/* 登录与账号管理页的专属样式。
   颜色、间距、圆角一律取 ui.css 里的 --app-* 令牌，不另造一套。 */

.app { background: var(--app-surface); -webkit-tap-highlight-color: transparent; }
/* 要 App 手感，第一条就是整页不回弹：拉到底不橡皮筋、不触发浏览器下拉刷新。 */
html, body { overscroll-behavior-y: none; }
.app-root { min-height: 100dvh; }

/* ---------- 登录 ---------- */
.login-screen { --login-ink: #193e31; --login-muted: #5d7468; position: relative; isolation: isolate;
  display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100svh;
  padding: 64px clamp(32px, 6vw, 100px); background-color: #edf2e8;
  background-image: linear-gradient(90deg, rgba(245, 248, 240, .44), rgba(247, 250, 242, .12) 54%, rgba(248, 250, 244, .32)), url('assets/login-desktop-v2.webp');
  background-size: cover; background-position: center; }
.login-screen::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(244, 248, 240, .4); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.login-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 430px; align-items: center;
  gap: clamp(48px, 7vw, 136px); width: 100%; max-width: 1160px; }
.login-intro { display: flex; flex-direction: column; justify-content: center; min-width: 0; min-height: 0; color: var(--login-ink); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 18px; }
.login-logo { flex-shrink: 0; width: 128px; height: 128px; border: 0;
  overflow: visible; background: transparent; box-shadow: none; }
.login-brand img { width: 100%; height: 100%; display: block; }
.login-brand h1 { font-size: 36px; font-weight: 650; letter-spacing: 3px; white-space: nowrap; }
.login-system-name { margin-top: 8px; font-size: 16px; line-height: 1.5; color: var(--login-muted); white-space: nowrap; }
.login-card { position: relative; width: 100%; min-width: 0; padding: 38px 36px 28px; background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .96); border-radius: 28px; box-shadow: 0 28px 88px rgba(28, 65, 44, .14), 0 2px 8px rgba(28, 65, 44, .04);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
.login-card-head { margin-bottom: 26px; }
.login-card-head h2 { margin-top: 12px; font-size: 28px; line-height: 1.4; font-weight: 600; color: var(--login-ink); }
.login-field { margin-bottom: 18px; }
.login-field label { display: block; font-size: 13px; color: var(--app-text-secondary); margin-bottom: 9px; }
.login-field input { width: 100%; height: 50px; padding: 0 15px; border: 1px solid #d8e2d9; border-radius: 12px;
  font: inherit; font-size: 15px; color: var(--app-text); background: rgba(255, 255, 255, .94); outline: none; transition: border-color .16s, box-shadow .16s; }
.login-field input::placeholder { color: #8b9a91; }
.login-field input:focus { border-color: var(--app-primary); box-shadow: 0 0 0 3px var(--app-primary-soft); }
.login-password { position: relative; }
.login-password input { padding-right: 72px; }
.login-password-toggle { position: absolute; right: 4px; top: 3px; bottom: 3px; min-width: 60px; border: 0; border-radius: 8px;
  background: transparent; color: var(--login-muted); font-size: 12px; cursor: pointer; }
.login-captcha__row { display: grid; grid-template-columns: minmax(0, 1fr) clamp(116px, 48%, 156px); gap: 8px; }
.login-captcha__row input { min-width: 0; letter-spacing: .18em; text-transform: uppercase; }
.login-captcha__button { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 4px;
  padding: 0 7px; border: 1px solid #d8e2d9; border-radius: 12px; background: #eef6ef; color: var(--login-ink);
  font: inherit; cursor: pointer; }
.login-captcha__button:enabled:hover { border-color: var(--app-primary); }
.login-captcha__button:focus-visible { outline: 2px solid var(--app-primary); outline-offset: 2px; }
.login-captcha__button:disabled { cursor: wait; }
.login-captcha__image { display: block; width: calc(100% - 20px); height: auto; }
.login-captcha__icon { width: 16px; font-size: 17px; text-align: center; }
.login-captcha__status { font-size: 14px; white-space: nowrap; }
.login-captcha__button [hidden] { display: none; }
.login-error { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #efc4be; border-left: 4px solid #b42318; border-radius: 10px; background: var(--app-danger-soft); color: #b42318; font-size: 15px; line-height: 1.6; }
.login-form .login-submit { width: 100%; height: 50px; margin-top: 6px; border-radius: 12px; font-size: 15px; font-weight: 600; letter-spacing: 2px;
  box-shadow: 0 8px 20px rgba(22, 163, 74, .18); }
@media (min-width: 900px) and (max-width: 1100px) {
  .login-layout { grid-template-columns: minmax(0, 1fr) 390px; gap: 40px; }
  .login-card { padding: 32px 28px 26px; }
  .login-brand { gap: 12px; }
  .login-logo { width: 90px; height: 90px; border-radius: 24px; }
  .login-brand h1 { font-size: 30px; }
}
@media (max-width: 899px) {
  .login-screen { padding: max(32px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
    background-image: linear-gradient(180deg, rgba(243, 248, 237, .22), rgba(245, 249, 240, .24) 45%, rgba(236, 243, 232, .58)), url('assets/login-mobile-v2.webp');
    background-position: 28% center; }
  .login-layout { display: flex; flex-direction: column; gap: 24px; max-width: 410px; }
  .login-intro { min-height: 0; width: 100%; align-items: center; }
  .login-brand { gap: 14px; }
  .login-logo { width: 96px; height: 96px; border-radius: 24px; }
  .login-brand h1 { font-size: 30px; letter-spacing: 3px; }
  .login-card { padding: 28px 24px 23px; border-radius: 24px; }
  .login-card::before { left: 24px; }
  .login-card-head { margin-bottom: 22px; }
  .login-card-head h2 { font-size: 25px; margin-top: 10px; }
  .login-field { margin-bottom: 16px; }
  .keyboard-open .login-screen { justify-content: flex-start; }
}
@media (max-width: 899px) and (max-height: 720px) {
  .login-screen { padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)); }
  .login-layout { gap: 16px; }
  .login-logo { width: 80px; height: 80px; border-radius: 20px; }
  .login-brand h1 { font-size: 28px; }
  .login-card { padding: 22px 20px 18px; }
  .login-card-head { margin-bottom: 18px; }
  .login-card-head h2 { margin-top: 6px; font-size: 24px; }
  .login-field { margin-bottom: 14px; }
  .login-field input { height: 48px; }
}

/* ---------- 主框架 ---------- */
.app-shell { display: flex; height: 100dvh; overflow: hidden; }
.app-side { width: 216px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--app-white); border-right: 1px solid var(--app-line); }
.app-brand { display: flex; align-items: center; gap: 10px; padding: 20px 12px; }
.app-brand img { width: 72px; height: 72px; flex-shrink: 0; display: block; }
.app-brand__text { min-width: 0; }
.app-brand strong { display: block; font-size: 17px; }
.app-brand__text span { display: block; margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--app-muted); white-space: nowrap; }
.app-store { margin: 0 16px 12px; padding: 11px 13px; border: 1px solid var(--app-line); border-radius: var(--app-radius); background: var(--app-surface); font-size: 13px; color: var(--app-text-secondary); }
.app-store b { display: block; font-size: 13px; color: var(--app-text); font-weight: 500; }
.app-nav { flex: 1; padding: 4px 12px; overflow: auto; }
.app-nav__label { margin: 18px 8px 7px; font-size: 14px; font-weight: 600; color: var(--app-muted); }
.app-nav__account { margin-top: 18px; padding-top: 8px; border-top: 1px solid var(--app-line); }
.app-nav__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 11px; border: 0; border-radius: var(--app-radius); background: none; color: var(--app-text-secondary); font-size: 14px; text-align: left; cursor: pointer; }
.app-nav__item:hover { background: var(--app-surface); }
.app-nav__item.is-on { background: var(--app-primary-soft); color: var(--app-primary-dark); font-weight: 600; }
.app-menu-icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.app-menu-label { flex: 1; min-width: 0; }
.app-nav__item .app-menu-icon { width: 18px; height: 18px; }
.app-side__foot { padding: 14px 16px; border-top: 1px solid var(--app-line); font-size: 12px; color: var(--app-muted); }
.app-side__foot b { color: var(--app-text); font-weight: 500; }

/* 桌面侧栏：分类是静态标题，功能项通过缩进、字号和交互状态明确区分。 */
@media (min-width: 900px) {
  .app-side .app-nav { min-height: 0; padding: 6px 10px 16px; overflow-x: hidden; overflow-y: auto;
    overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--app-muted) transparent; }
  .app-nav::-webkit-scrollbar { width: 8px; }
  .app-nav::-webkit-scrollbar-track { background: transparent; }
  .app-nav::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: var(--app-radius); background: var(--app-muted); background-clip: padding-box; }
  .app-side .app-nav__label { display: flex; align-items: center; gap: 10px; min-height: 24px; margin: 14px 10px 6px;
    color: var(--app-muted); font-size: 14px; font-weight: 600; line-height: 1.5; white-space: nowrap; cursor: default; }
  .app-side .app-nav__label::after { content: ''; flex: 1; height: 1px; background: var(--app-line); }
  .app-side .app-nav__item { position: relative; gap: 12px; min-height: 44px; padding: 8px 12px;
    border-radius: var(--app-radius); color: var(--app-text); font-size: 16px; font-weight: 400; line-height: 1.5; }
  .app-side .app-nav__group > .app-nav__item { padding-left: 22px; }
  .app-side .app-nav__item .app-menu-icon { width: 20px; height: 20px; }
  .app-side .app-nav__item:hover:not(.is-on) { background: var(--app-hover); color: var(--app-text); }
  .app-side .app-nav__item:active:not(.is-on) { background: var(--app-line); }
  .app-side .app-nav__item.is-on { background: var(--app-primary-soft); color: var(--app-primary-dark); font-weight: 600; }
  .app-side .app-nav__item.is-on::before { content: ''; position: absolute; left: 4px; top: 50%; width: 3px; height: 20px;
    border-radius: 2px; background: var(--app-primary); transform: translateY(-50%); }
  .app-side .app-nav__item:focus-visible { outline: 2px solid var(--app-primary); outline-offset: -2px; }
}

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-top { height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px; background: var(--app-white); border-bottom: 1px solid var(--app-line); }
.app-crumb { font-size: 14px; color: var(--app-muted); }
.app-crumb b { color: var(--app-text); font-weight: 500; }
.app-who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--app-muted); }
.app-who b { color: var(--app-text); font-weight: 500; }
.app-scroll { flex: 1; min-height: 0; overflow: auto; padding: 28px 24px 40px; }
.app-wrap { max-width: 1080px; margin: 0 auto; }

/* ---------- 页头与卡片 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; }
.page-head p { margin-top: 9px; font-size: 14px; color: var(--app-muted); line-height: 1.7; }
.app-page-bar--mobile { display: none; }
/* 会员档案头部：姓名与操作分区，返回使用浏览器历史或会员导航。 */
.member-detail-head { align-items: center; }
.member-detail-title { flex: 1; min-width: 0; }
.member-detail-title h1 { font-size: 24px; overflow-wrap: anywhere; }
.member-detail-actions { display: flex; flex-wrap: wrap; flex-shrink: 0; gap: 10px; }
.panel { background: var(--app-white); border: 1px solid var(--app-line); border-radius: var(--app-card-radius); overflow: hidden; }
.panel + .panel { margin-top: 18px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--app-line); }
.panel__head h2 { font-size: 16px; }
.panel__head span { font-size: 13px; color: var(--app-muted); }
.panel__body { padding: 18px 20px; }

/* 表格沿用全站口径：等宽数字、右对齐金额 */
.app-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.app-table th { padding: 11px 14px; background: var(--app-surface); color: var(--app-text-secondary); font-weight: 500; font-size: 13px; text-align: left; white-space: nowrap; }
.app-table td { padding: 13px 14px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; line-height: 1.5; }
.app-table tbody tr:last-child td { border-bottom: 0; }
.app-table tbody tr:hover { background: #fbfcfb; }
.app-table .right { text-align: right; }
.app-table .actions { text-align: right; white-space: nowrap; }
.app-table .actions button { margin-left: 6px; }

.tag-role { display: inline-flex; padding: 3px 9px; border-radius: 6px; background: var(--app-hover); color: var(--app-text-secondary); font-size: 12px; }
.tag-role.admin { background: var(--app-primary-soft); color: var(--app-primary-dark); }

/* ---------- 我的账号 ---------- */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.account-grid dt { font-size: 13px; color: var(--app-muted); }
.account-grid dd { margin: 6px 0 0; font-size: 15px; }
.pw-form { max-width: 360px; }
.pw-form .app-field { margin-bottom: 14px; }
.pw-form .app-input { font-size: 14px; }

/* ---------- 轻提示 ---------- */
.app-toast { position: fixed; top: max(18px, env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: max-content; padding: 10px 14px; min-height: 48px; border-radius: 12px; background: #203e2c; color: #fff; font-size: 15px; line-height: 1.5; box-shadow: 0 10px 30px rgba(16, 34, 38, .25); z-index: 2000; max-width: calc(100vw - 32px); }
.app-toast.bad { background: #7f2318; }
.app-toast__mark { flex: 0 0 22px; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid currentColor; border-radius: 50%; font-size: 14px; font-weight: 600; }
.app-toast__message { min-width: 0; overflow-wrap: anywhere; }
.app-toast__close { flex: 0 0 44px; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 22px; cursor: pointer; }
/* 撤销这类"就地补救"的动作挂在提示条上，不再多弹一层 */
.app-toast__action { flex-shrink: 0; min-height: 44px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .55); white-space: nowrap;
  border-radius: 8px; background: rgba(255, 255, 255, .16); color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.app-modal__close:disabled { opacity: .45; cursor: wait; }

/* 公共分段点选：销售开单、复查跟进用的是同一件控件 */
.app-segment { display: inline-flex; flex-shrink: 0; gap: 3px; padding: 3px; border-radius: 999px; background: #eef2ef; }
.app-segment-tab { min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: none;
  color: #56645a; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .16s, color .16s, box-shadow .16s; }
.app-segment-tab.is-on { background: var(--app-white); color: var(--app-primary-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(17, 24, 39, .14); }
.app-segment-tab:focus-visible { outline-offset: -3px; }
.payment-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 5px; }
.payment-method { min-width: 0; min-height: 44px; padding: 4px 2px; border: 1px solid var(--app-line);
  border-radius: 8px; background: var(--app-white); color: var(--app-text-secondary); font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer; }
.payment-method[aria-pressed="true"] { border-color: var(--app-primary); background: var(--app-primary-soft); color: var(--app-primary-dark); }
.payment-fill { justify-self: start; }
.app-input[aria-invalid="true"] { border-color: var(--app-danger-text); }

/* 公共选人控件：登记寄存、登记复查都是先搜到人再填单子 */
.member-pick { display: grid; gap: 2px; }
.member-pick-row { display: flex; gap: 8px; }
.member-pick-row .app-input { flex: 1; min-width: 0; }
.member-pick-results { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.member-pick-results .business-empty { padding: 8px 0; }
.member-pick-button { min-height: 44px; justify-content: flex-start; text-align: left; }
.member-pick-chosen { display: block; padding-top: 8px; font-size: 14px; color: var(--app-primary-dark); }

/* ---------- 登录页选门店 ---------- */
.login-stores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.store-chip { min-height: 42px; border: 1px solid var(--app-line); border-radius: var(--app-radius); background: var(--app-white); color: var(--app-text-secondary); font-size: 14px; cursor: pointer; }
.store-chip:hover { border-color: var(--app-primary); }
.store-chip.is-on { border-color: var(--app-primary); background: var(--app-primary-soft); color: var(--app-primary-dark); font-weight: 600; }
.login-form .store-chip { min-height: 46px; padding: 8px 10px; border-radius: 11px; background: rgba(255, 255, 255, .8); border-color: #d8e2d9; }
.login-form .store-chip.is-on { border-color: var(--app-primary); background: #edf7ee; color: var(--app-primary-dark); box-shadow: inset 0 0 0 1px rgba(22, 163, 74, .08); }

/* ---------- 操作日志 ---------- */
.app-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--app-line); font-size: 13px; color: var(--app-muted); }
.panel__head .btn { white-space: nowrap; flex-shrink: 0; }

/* ---------- 手机：底部导航 + 卡片列表 ---------- */
.app-tabbar { display: none; }

.app-drawer { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; max-height: calc(100dvh - 12px - env(safe-area-inset-top, 0px));
  border: 1px solid var(--app-line); border-bottom: 0; border-radius: 20px 20px 0 0; padding: 0;
  background: var(--app-white); color: var(--app-text); font-family: var(--app-font); font-size: 14px; overflow: hidden; }
.app-drawer[open] { display: flex; flex-direction: column; }
.app-drawer:not([open]) { display: none; }
.app-drawer::backdrop { background: rgba(31, 41, 55, .32); }
.app-drawer__head { height: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 20px; border-bottom: 1px solid var(--app-line); }
.app-drawer__head h2 { font-size: 16px; }
.app-drawer__head .app-modal__close { position: static; width: 44px; height: 44px; border: 1px solid var(--app-line); border-radius: 50%; }
.app-drawer__body { min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 16px 12px calc(18px + env(safe-area-inset-bottom, 0px)); }
.app-drawer__store { display: flex; align-items: center; gap: 12px; padding: 12px; margin: 0 0 12px; border: 1px solid var(--app-line); border-radius: 12px; background: var(--app-surface); }
.app-drawer__store img { display: block; width: 64px; height: 64px; flex-shrink: 0; }
.app-drawer__store > div { min-width: 0; }
.app-drawer__store strong { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.app-drawer__store span { display: block; margin-top: 4px; font-size: 14px; color: var(--app-text-secondary); overflow-wrap: anywhere; }
.app-drawer__label { font-size: 14px; font-weight: 600; color: var(--app-text-secondary); margin: 18px 4px 10px; }
.app-drawer__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.app-drawer__item { display: flex; align-items: center; gap: 12px; min-height: 54px; width: 100%;
  padding: 0 12px; border: 0; border-radius: 10px; background: var(--app-white);
  color: var(--app-text); font-size: 14px; text-align: left; cursor: pointer; }
.app-drawer__item:hover { background: var(--app-surface); }
.app-drawer__item.is-on { border-color: transparent; background: var(--app-primary-soft); color: var(--app-primary-dark); font-weight: 600; }
/* 宫格只作用于分类内入口；首页和账号区保留横向按钮。 */
.app-drawer .app-drawer__grid > .app-drawer__item { flex-direction: column; justify-content: center; gap: 6px; min-width: 0; min-height: 94px; padding: 10px 3px; text-align: center; }
.app-drawer__grid .app-menu-icon { box-sizing: content-box; width: 28px; height: 28px; padding: 8px; border-radius: 14px; background: var(--app-surface); }
.app-drawer__grid .app-menu-label { flex: none; width: 100%; font-size: 14px; line-height: 1.4; white-space: nowrap; }
.app-drawer__item.is-on .app-menu-icon { color: var(--app-primary-dark); }
.app-drawer__shortcut > .app-drawer__item { gap: 12px; padding-inline: 12px; }
.app-drawer__foot { display: grid; gap: 12px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--app-line); color: var(--app-muted); }
.app-drawer__who { min-width: 0; overflow-wrap: anywhere; }
.app-drawer__who b { display: block; font-size: 14px; color: var(--app-text); font-weight: 500; }
.app-drawer__account-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.app-drawer__account-actions .app-drawer__item { min-width: 0; min-height: 44px; padding-inline: 12px; background: var(--app-surface); }
.app-drawer__account-actions .app-menu-label, .app-drawer__account-actions .btn { white-space: nowrap; }
.app-drawer__account-actions .btn { min-height: 44px; }
.app-drawer__about .app-drawer__item { min-height: 44px; background: var(--app-surface); }

/* 品牌资料按需查看，不占用日常业务页面。 */
.brand-page { max-width: 640px; margin-inline: auto; }
.brand-card { padding: 28px clamp(20px, 5vw, 44px) 32px; text-align: center; background: #fff; }
.brand-card__logo { display: block; width: min(240px, 68%); height: auto; margin: 0 auto 18px; }
.brand-card h2 { font-size: clamp(21px, 4vw, 26px); line-height: 1.5; font-weight: 600; }
.brand-card__details { display: grid; gap: 0; margin: 26px 0 0; border-top: 1px solid var(--app-line); text-align: left; }
.brand-card__details > div { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 16px; padding-block: 17px; font-size: 15px; line-height: 1.6; }
.brand-card__details > div + div { border-top: 1px solid var(--app-line); }
.brand-card__details dt { color: var(--app-text-secondary); }
.brand-card__details dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
@media (max-width: 319px) {
  .app-drawer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 600px) and (max-width: 899px) {
  .app-drawer__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 跟手的新增入口：每页只声明"这页新增什么"，位置由这里统一管 ---------- */
.app-fab-host { display: flex; }
.app-fab { display: inline-flex; align-items: center; gap: 7px; min-height: 46px; padding: 0 18px 0 15px;
  border: 0; border-radius: 23px; background: var(--app-primary); color: #fff; font: inherit; font-size: 15px;
  font-weight: 600; box-shadow: 0 10px 24px rgba(22, 101, 52, .26), 0 2px 6px rgba(17, 24, 39, .14); cursor: pointer; }
.app-fab:active { transform: translateY(1px); }
.app-fab__plus { font-size: 21px; font-weight: 500; line-height: 1; }
@media (min-width: 900px) {
  .app-fab-host { position: fixed; right: 26px; bottom: 26px; z-index: 45; }
}

@media (max-width: 899px) {
  .app-shell { display: block; height: auto; min-height: 100dvh; overflow: visible; }
  .app-side { display: none; }
  /* 手机上滚动交给文档本身。这里不再给 100dvh：地址栏收起/弹出时 dvh 会连续变化，
     内容跟着重新排版就是一跳一跳；整页高度由 .app-root 兜住就够了。 */
  .app-main {
    display: block;
    --app-mobile-gutter: 14px;
    --app-page-bar-height: calc(54px + env(safe-area-inset-top, 0px));
  }
  /* 手机隐藏桌面顶栏，门店信息和退出入口统一放在“更多”。 */
  .app-top { display: none; }
  .app-scroll {
    overflow: visible;
    padding: 0 var(--app-mobile-gutter) calc(104px + env(safe-area-inset-bottom, 0px));
  }

  /* 悬浮玻璃胶囊：离底边一点距离，内容从下面滑过去 */
  .app-tabbar { position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 50;
    display: flex; gap: 2px; padding: 6px; border-radius: 26px; overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .16));
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, .6);
    box-shadow: 0 18px 42px rgba(17, 24, 39, .22), 0 2px 6px rgba(17, 24, 39, .08),
                inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .35); }
  /* 顶部一条由亮到透明的反光，模拟镜面高光 */
  .app-tabbar::before { content: ''; position: absolute; inset: 1px 1px auto; height: 48%;
    border-radius: 26px 26px 16px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .68), rgba(255, 255, 255, 0));
    pointer-events: none; }
  .app-tabbar__item { position: relative; z-index: 1; flex: 1; min-height: 52px; border-radius: 21px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    border: 0; background: none; color: #4B5563; font-size: 12px; cursor: pointer; transition: background .18s, color .18s; }
  .app-tabbar__item.is-on { background: var(--app-primary); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(22, 163, 74, .32); }
  .app-tabbar__ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .app-tabbar__item.is-on .app-tabbar__ico { stroke-width: 1.9; }

  /* 新增入口抬到导航条上方：拇指本来就停在那一片，不用够到屏幕顶上。
     离导航条留出约 30px，两颗浮着的控件挤在一起既不好看也不好点。 */
  .app-fab-host { position: fixed; right: 16px; bottom: calc(106px + env(safe-area-inset-bottom, 0px)); z-index: 45; }
  /* 有悬浮按钮时留足底部空间，优先于玻璃导航的通用留白，末行与分页才不会被盖住。 */
  body.app.has-fab .app-scroll { padding-bottom: calc(168px + env(safe-area-inset-bottom, 0px)); }

  .page-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .page-head h1 { font-size: 22px; }
  .page-head .btn { width: 100%; }
  .app-wrap .app-page-bar {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--app-page-bar-height);
    margin: 0 calc(-1 * var(--app-mobile-gutter)) 14px;
    padding: env(safe-area-inset-top, 0px) var(--app-mobile-gutter) 0;
    background: var(--app-white);
    border-bottom: 1px solid var(--app-line);
  }
  .app-wrap .app-page-bar h1 { margin: 0; font-size: 20px; line-height: 1.4; }
  .app-wrap .app-page-bar .btn { flex: none; width: auto; white-space: nowrap; }
  .account-grid { grid-template-columns: minmax(0, 1fr); }

  /* 表格变卡片：一行一张，字段名压在值上面 */
  .app-table { display: block; }
  .app-table tbody { display: block; }
  .app-table thead { display: none; }
  .app-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
    padding: 14px; border-bottom: 1px solid var(--app-line); }
  .app-table tbody tr:last-child { border-bottom: 0; }
  .app-table td, .app-table td:first-child { display: block; padding: 0; border: 0; min-width: 0; }
  .app-table td::before { content: attr(data-label); display: block; font-size: 12px; color: var(--app-muted); margin-bottom: 4px; }
  /* 没给 data-label 的格子不该凭空多出 4px；只补这一条，不去抢各表"隐藏字段名"的优先级 */
  .app-table td:not([data-label])::before { display: none; }
  .app-table td.cell-main { grid-column: 1 / -1; font-size: 15px; }
  .app-table td.cell-main::before { display: none; }
  .app-table td.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }

  /* 卡片式表格的公共排布：一行分 12 栏，格子用 span-N 决定占多宽。
     每个模块自己写一遍行列的话，两处会慢慢长歪，这里统一给。
     格子本身不加左内边距：每行的第一格会莫名比上一行缩进半格，间距交给 gap 管。 */
  .app-table.app-cards tr { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f1f3; }
  .app-table.app-cards td { min-width: 0; padding: 0; border-bottom: 0; }
  .app-table.app-cards tbody tr:last-child { border-bottom: 0; }
  .app-table.app-cards td[colspan] { grid-column: 1 / -1; text-align: left; }
  .app-table.app-cards td.span-2 { grid-column: span 2; }
  .app-table.app-cards td.span-3 { grid-column: span 3; }
  .app-table.app-cards td.span-4 { grid-column: span 4; }
  .app-table.app-cards td.span-5 { grid-column: span 5; }
  .app-table.app-cards td.span-6 { grid-column: span 6; }
  .app-table.app-cards td.span-7 { grid-column: span 7; }
  .app-table.app-cards td.span-8 { grid-column: span 8; }
  .app-table.app-cards td.span-full { grid-column: 1 / -1; }
  .app-table.app-cards td.no-label::before { content: none; }
  .app-table.app-cards td.span-2, .app-table.app-cards td.span-3, .app-table.app-cards td.span-4,
  .app-table.app-cards td.span-5, .app-table.app-cards td.span-6, .app-table.app-cards td.span-7,
  .app-table.app-cards td.span-8, .app-table.app-cards td.span-full { text-align: left; }
  .app-table td.actions::before { display: none; }
  .app-table td.actions .btn { flex: 1; min-width: 88px; }
  .app-table td[colspan] { grid-column: 1 / -1; }
  .app-table td[colspan]::before { display: none; }
  .app-table .hide-sm { display: none; }
  .app-pager { flex-wrap: wrap; }

  /* 只有带搜索框的表头才需要换行；纯标题的保持一行 */
  .panel__head:has(input) { flex-wrap: wrap; row-gap: 10px; }
  .panel__head:has(input) h2 { flex: 1 0 100%; }
  .panel__head:has(input) > div { width: 100%; }
  .panel__head:has(input) input { flex: 1; min-width: 0; max-width: none !important; }
}

/* 老浏览器没有 backdrop-filter：退回接近实底的白，保住可读性 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .app-tabbar { background: rgba(255, 255, 255, .97); }
  .app-tabbar::before { display: none; }
}

/* 手机号填错时的输入框状态 */
.app-input.is-error,
.login-field input.is-error,
.login-field input.is-error:focus { border-color: var(--app-danger); box-shadow: 0 0 0 3px var(--app-danger-soft); }
.app-field .field__err { margin-top: 6px; }
.app .field__err { font-size: 14px; font-weight: 500; color: var(--app-danger-text); }

/* 仅用于当前操作的重要影响或异常；常规规则不占表单空间。 */
.app-notice, .business-empty[role="alert"] { display: block; margin: 16px 0; padding: 12px 14px; border: 1px solid #e8cd95;
  border-left: 4px solid #b77916; border-radius: 10px; background: #fff7e6; color: #784c0c;
  font-size: 15px; font-weight: 500; line-height: 1.6; overflow-wrap: anywhere; }
.app-notice--danger, .business-empty[role="alert"] { border-color: #edbdb7; border-left-color: #b42318; background: #fff1ef; color: #a1281d; text-align: left; }
.app-notice--info { border-color: #bbd6e6; border-left-color: #24648c; background: #eff7fc; color: #245976; }
.app-notice[hidden] { display: none; }
.app-modal__error { margin: 0 24px 16px; }
.form-context { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px;
  padding-bottom: 16px; margin: 0 0 20px; border-bottom: 1px solid var(--app-line); font-size: 15px; }
.form-context strong { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.form-context span { color: var(--app-text-secondary); overflow-wrap: anywhere; }

/* ---------- 手机优先的业务页面 ---------- */
.app-crumb { display: grid; gap: 3px; min-width: 0; }
.app-current-store { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-crumb b { font-size: 15px; }
.network-notice { flex-shrink: 0; padding: 12px 16px; border-bottom: 2px solid var(--app-danger-text); background: var(--app-danger-soft); color: var(--app-danger-text); font-size: 15px; font-weight: 500; }
/* 首页：九个提醒都是同一颗格子，三个复查数字放大、其余六类缩小排两行，各占等宽三列 */
.home-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.home-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0 14px; }
.home-stat { display: grid; gap: 2px; padding: 10px 14px; border: 1px solid var(--app-line); border-radius: 12px; background: var(--app-white); color: var(--app-text); text-align: left; cursor: pointer; }
.home-stat strong { font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.home-stat span { font-size: 12px; color: var(--app-muted); }
.home-stat--minor { padding: 7px 10px; border-radius: 10px; }
.home-stat--minor strong { font-size: 18px; }
.home-stat.is-on { border-color: var(--app-primary); background: var(--app-primary-soft); }
.home-stat.is-on span { color: var(--app-primary-dark); }
.home-stat.is-urgent strong { color: var(--app-danger-text); }
.business-empty { display: grid; justify-items: center; gap: 16px; padding: 32px 20px; color: var(--app-muted); text-align: center; line-height: 1.7; }
.business-empty.is-error { color: var(--app-danger-text); }
.business-count { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 14px; font-size: 13px; color: var(--app-muted); }
.business-pager { padding: 18px; text-align: center; }
.business-pager .btn { min-width: 150px; }
.member-search { display: grid; grid-template-columns: minmax(0, 1fr) auto 140px; gap: 10px; margin-bottom: 16px; }
.member-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.member-card { min-width: 0; border: 1px solid var(--app-line); border-radius: var(--app-card-radius); background: var(--app-white); overflow: hidden; }
.member-card__main { display: block; text-align: left; padding: 18px; width: 100%; border: 0; color: var(--app-text); background: transparent; cursor: pointer; }
.member-card__title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.member-card__title strong { font-size: 18px; }
.member-card p { font-size: 13px; color: var(--app-muted); margin-top: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.member-card__money { display: flex; align-items: baseline; gap: 10px; margin-top: 16px; font-size: 12px; color: var(--app-muted); flex-wrap: wrap; }
.member-card__money b { font-size: 18px; color: var(--app-primary-dark); font-variant-numeric: tabular-nums; }
.member-card__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 18px; border-top: 1px solid var(--app-line); font-size: 12px; color: var(--app-muted); }
.phone-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--app-primary-dark); text-decoration: none; font-size: 14px; overflow-wrap: anywhere; }
.task-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: 8px 16px; padding: 10px 20px; border-bottom: 1px solid #f0f1f3; }
.task-row:last-child { border-bottom: 0; }
.task-main { grid-column: 1; grid-row: 1; min-width: 0; min-height: 44px; display: grid; align-items: center;
  padding: 0; border: 0; background: none; color: var(--app-text); text-align: left; cursor: pointer; }
.task-main::after { content: ''; position: absolute; inset: 0; }
.task-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; }
.task-name strong { overflow-wrap: anywhere; font-weight: 600; }
.task-subject { display: block; min-width: 0; color: var(--app-text-secondary); font-size: 15px; overflow-wrap: anywhere; }
.task-phone { position: relative; z-index: 1; grid-column: 3; grid-row: 1; min-width: 0; max-width: 180px;
  justify-self: end; text-align: right; overflow-wrap: anywhere; }
.task-phone .field__hint { font-size: 14px; }
.task-details { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 12px; min-width: 0; }
.task-meta { color: var(--app-muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.panel-count { color: var(--app-muted); font-size: 13px; }
.member-facts dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.card-stack { display: grid; gap: 12px; }
.wallet-card { border: 1px solid var(--app-line); padding: 18px; border-radius: var(--app-radius); background: var(--app-surface); }
.wallet-balance { display: block; margin: 14px 0 5px; font-size: 28px; color: var(--app-primary-dark); }
.wallet-card p, .history-row p { font-size: 13px; color: var(--app-muted); line-height: 1.8; }
.history-row { padding: 12px 0; border-bottom: 1px solid var(--app-line); overflow-wrap: anywhere; }
.app-tabbar__item:disabled { opacity: .4; }
.app :focus-visible { outline: 2px solid var(--app-primary); outline-offset: 3px; }
/* 弹窗随可见视口定位，外壳不滚动。默认只滚正文；手机录入窗由 forms.css 让操作栏随正文滚动。 */
.app-modal { position: fixed; top: calc(var(--app-viewport-top, 0px) + var(--app-viewport-height, 100dvh) / 2);
  bottom: auto; margin: 0 auto; transform: translateY(-50%);
  max-height: calc(var(--app-viewport-height, 100dvh) - 24px); }
/* 弹窗主体只负责上下滚，宽表在自己的容器内横滚，不能把整张弹窗带偏。 */
.app-modal form { min-width: 0; }
.app-modal__body { min-width: 0; overflow-x: hidden; overflow-y: auto; }
.app-modal__body, .app-drawer__body { scroll-behavior: auto; }
/* 表单按容器收缩，原生日期框不能用自身的内容宽度撑开网格。 */
.app-modal__form { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.app-modal .app-field { min-width: 0; max-width: 100%; }
.app .app-input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]) {
  box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%;
  inline-size: 100%; min-inline-size: 0; max-inline-size: 100%;
  -webkit-appearance: none; appearance: none;
}
/* ---------- 一行两栏的名单模板：库存、寄存、操作日志共用一套排布 ----------
   左边"是什么"（名称 + 摘要），右边"关键数"（主数 + 说明），整行点开详情。 */
.list-table tbody tr { position: relative; }
.list-open { display: block; min-width: 0; padding: 0; border: 0; background: none; color: var(--app-text);
  font: inherit; text-align: left; cursor: pointer; }
.list-open::after { content: ''; position: absolute; inset: 0; }
.list-open strong { display: block; font-size: 15px; font-weight: 600; }
.list-meta { display: block; margin-top: 2px; font-size: 12px; color: var(--app-text-secondary); overflow-wrap: anywhere; }
.list-side { display: grid; gap: 2px; justify-items: end; text-align: right; min-width: 0; }
.list-side b { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-side b.is-quiet { color: var(--app-text-secondary); font-weight: 500; }
/* 说明那行允许换行：nowrap 会把"剩 12 / 共 30 件"顶出右列，压到左边的名称上（手机上最显乱的一处）。
   大数还是不许断行，断了就看不出是数还是字。 */
.list-side span { font-size: 12px; color: var(--app-text-secondary); overflow-wrap: anywhere; }
/* 动态提醒和分类状态共用 status.css；这里只保留行内间距。 */
.list-flag { margin-left: 6px; }
.list-table td { padding: 9px 12px; }
.list-table th { padding: 10px 12px; }

/* 一行两个入口：姓名那颗按钮点开这个档案/这张单，电话单独能拨。
   <a> 套在 <button> 里是无效 HTML——读屏念不全、拨号也不稳，所以两者并排：
   按钮的 ::after 铺满整行当点击区，电话浮在它上面。会员、验光、复查三张名单共用这一个形状，
   行（tbody tr）自己要有 position: relative，::after 才知道铺到哪一行。 */
.list-identity { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.list-person { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 44px;
  padding: 0; border: 0; background: none; color: var(--app-text); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.list-person::after { content: ''; position: absolute; inset: 0; }
.list-person strong { font-size: 15px; font-weight: 600; }
.list-phone { position: relative; z-index: 1; flex: 0 0 auto; color: var(--app-muted);
  font-size: 13px; font-variant-numeric: tabular-nums; }
.list-phone .phone-link { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; color: var(--app-muted); }
.list-phone .field__hint { font-size: inherit; color: var(--app-muted); }

/* 档案弹窗里的字段清单：标签靠左、值占剩下的宽度，一条记录不用滚半屏才看完。
   库存、寄存、操作日志的详情窗共用这一份，不再各写一套 dt/dd。 */
.facts { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px 14px; align-items: baseline; margin: 0; }
.facts dt { color: var(--app-muted); font-size: 13px; }
.facts dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
/* 弹窗或抽屉开着时，背后那一页不许跟着手指滚。
   showModal 只把背景设成不可交互，挡不住文档滚动（手机上整页滚的就是文档）。
   用 :has 声明式锁：多层弹窗叠着也不用管谁先关，位置也不会跳回顶部。 */
html:has(.app-modal[open], .app-drawer[open]),
html:has(.app-modal[open], .app-drawer[open]) body { overflow: hidden; }
html:has(.app-modal[open], .app-drawer[open]) .app-scroll { overflow: hidden; }
.app-modal, .app-drawer { overscroll-behavior: contain; }
.app-page-locked { position: fixed; top: var(--app-page-scroll-top, 0px); left: 0; right: 0; width: 100%; overflow: hidden; }
.app-modal__footer { position: static; flex-shrink: 0; height: auto; background: var(--app-white);
  padding: 12px 24px max(12px, env(safe-area-inset-bottom)); }
.keyboard-open .app-modal__footer { padding-bottom: 12px; }

/* 会员名单：桌面表格，手机保持紧凑的可点击档案卡片。 */
@media (min-width: 900px) {
  /* 对齐演示版 1480px 内容容器扣除左右各 32px 内边距后的名单宽度。 */
  .app-wrap:has(> .member-page) { max-width: 1416px; }
}
.member-page .member-search { grid-template-columns: minmax(0, 400px) auto; justify-content: start; padding: 20px 20px 0; }
.member-quick-filters { display: grid; gap: 8px; padding: 0 20px 16px; }
.member-quick-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.member-filter-people { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.member-filter-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; gap: 8px; }
.member-filter-label { color: var(--app-muted); font-size: 13px; line-height: 44px; }
.member-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.member-page .member-quick-button { min-height: 44px; padding: 0 6px; border-radius: 9px; white-space: nowrap; }
.member-filter-tools { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.member-filter-tools .member-quick-more { padding-left: 0; }
.member-filter-tools .member-quick-clear { margin-left: auto; }
.member-filter-current { color: var(--app-primary-dark); font-size: 13px; }
@media (min-width: 900px) {
  .member-quick-filters { max-width: 640px; }
  .member-filter-grid[aria-label="卡类型"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.member-quick-spacer { flex: 1; }
.member-quick-button { min-height: 36px; padding: 0 14px; border: 1px solid var(--app-line); border-radius: 18px; color: var(--app-text-secondary); background: var(--app-white); font-size: 13px; cursor: pointer; }
.member-quick-button b { margin-left: 4px; color: var(--app-text); font-variant-numeric: tabular-nums; }
.member-quick-button.is-on { border-color: var(--app-primary-soft); color: var(--app-primary-dark); background: var(--app-primary-soft); font-weight: 600; }
/* 横着滑的胶囊条：手机上不用露那条滚动条，滑得动就够了 */
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
/* 次要动作不做灰底胶囊，跟筛选挤在一起分不清 */
.member-quick-more, .member-quick-clear { min-height: 36px; padding: 0 10px; border: 0; border-radius: 18px; background: none; color: var(--app-primary-dark); font-size: 13px; cursor: pointer; }
.member-table-wrap { overflow-x: auto; }
.member-list-table th { white-space: nowrap; }
.member-list-table th, .member-list-table td { padding-left: 12px; padding-right: 12px; }
.member-list-card-count { display: block; margin-top: 4px; color: var(--app-muted); font-size: 12px; }
/* 桌面字段列宽集中在 desktop-lists.css，手机仍由下方卡片网格定位。 */
.member-list-table .member-list-card-number { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; text-align: left; }
.member-list-table .member-list-card-type { color: var(--app-muted); font-size: 13px; }
.member-card-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.member-card-summary time { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 行形状走公共层的 .list-identity / .list-person / .list-phone，这里只留名单自己的定位 */
.member-list-table tbody tr { position: relative; }
.member-alert-list { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.member-list-no-card .member-list-card-number, .member-list-no-card .member-list-card-type { color: var(--app-muted); }
.member-list-pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--app-line); color: var(--app-muted); font-size: 13px; }
.member-pager-info { display: inline-flex; align-items: center; gap: 10px; }
.member-page-buttons { display: flex; gap: 4px; }
.member-page-button { min-width: 44px; min-height: 44px; border: 1px solid var(--app-line); border-radius: 8px; background: var(--app-white); color: var(--app-text); cursor: pointer; font-size: 14px; }
.member-page-button.is-current { border-color: var(--app-primary); background: var(--app-primary-soft); color: var(--app-primary-dark); font-weight: 600; }
.member-page-button:disabled { opacity: .4; cursor: default; }
/* 触屏一律 16px 起：iOS 一聚焦小于 16px 的输入框就强制放大并停在放大态，
   之后整页都能被手指拖着走——"能手动放大并且拖动"就是这么来的。
   按 pointer 判断而不是只按宽度：iPad 竖屏 1024、横屏 1366 也是触屏，
   只写 ≤899 的话平板照样会被放大。桌面用精确指针，保持 14px 不动版式。 */
@media (pointer: coarse) {
  .app input, .app select, .app textarea, .pw-form .app-input, .login-field input { font-size: 16px; }
  .app .btn, .app .store-chip { min-height: 44px; }
  /* 关闭那颗是圆的：只抬最小高度不抬宽度会被拉成蛋形 */
  .app-modal__close { width: 44px; height: 44px; min-height: 0; top: 14px; right: 10px; }
}
@media (max-width: 899px) {
  .app input, .app select, .app textarea, .pw-form .app-input { font-size: 16px; }
  .app .btn, .app .store-chip, .app-modal__close { min-height: 44px; }
  .app-table .actions button { margin-left: 0; }
  .home-page > .page-head { flex-direction: row; align-items: center; gap: 12px; margin-bottom: 12px; }
  .home-page > .page-head .btn { width: auto; flex-shrink: 0; }
  .home-stat { padding: 8px 10px; border-radius: 10px; }
  .home-stat strong { font-size: 20px; }
  .home-stat span { font-size: 12px; }
  /* 小格子那一档跟着缩，不然媒体查询写在后面会把 18px 顶回 20px */
  .home-stat--minor { padding: 6px 9px; }
  .home-stat--minor strong { font-size: 17px; }
  .home-stat--minor span { font-size: 12px; }
  .member-grid { grid-template-columns: minmax(0, 1fr); }
  .member-search { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .member-search select { grid-column: 1 / -1; }
  .member-search .btn { padding-left: 18px; padding-right: 18px; }
  .member-page > .page-head { flex-direction: row; align-items: center; }
  .member-page > .page-head .btn { width: auto; }
  /* 手机上姓名独占标题区，动作两行两列。 */
  .member-detail-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
  .member-detail-title { flex: 1 1 0; min-width: 0; order: 0; }
  .member-detail-title h1 { font-size: 24px; line-height: 1.35; }
  .member-detail-title p { margin-top: 4px; }
  .member-detail-actions { flex: 1 1 100%; order: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .member-detail-actions .btn { width: auto; }
  .member-page .member-search { grid-template-columns: minmax(0, 1fr) auto; padding: 16px 16px 0; }
  .member-quick-filters { padding: 0 16px 8px; }
  /* 手机上不把"更多条件"推到右端：那会留出半行空白，紧跟在最后一个筛选后面就好 */
  .member-quick-spacer { display: none; }
  .member-quick-button { min-height: 44px; padding: 0 12px; border-radius: 22px; font-size: 14px; }
  .app-segment-tab { padding: 0 12px; }
  .member-quick-more, .member-quick-clear { min-height: 44px; }
  /* 首行姓名在左、电话在右；卡号与卡况在下方，提醒独立右对齐。 */
  .member-table-wrap { padding: 0 16px; }
  .member-page .member-list-table tbody tr { grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 8px 0 12px; }
  .member-page .member-list-table td.member-list-person { grid-column: 1 / -1; grid-row: 1; }
  .member-page .list-phone { max-width: 46%; text-align: right; }
  .member-page .list-phone .field__hint { display: block; overflow-wrap: anywhere; line-height: 1.5; }
  .member-page .member-list-table td.member-list-card-number { grid-column: 1; grid-row: 2; }
  .member-page .member-list-table td.member-list-card-type { grid-column: 1; grid-row: 3; }
  .member-page .member-list-table td.member-list-alerts { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
  .member-page .member-list-no-card td.member-list-card-number { display: none; }
  .member-page .member-list-no-card td.member-list-card-type { grid-row: 2; }
  .member-page .member-list-no-card td.member-list-alerts { grid-row: 2; }
  .member-list-table td { max-width: none; }
  .member-list-table td::before { display: none; }
  .member-list-table td.member-list-card-number, .member-list-table td.member-list-card-type { color: var(--app-muted); font-size: 12px; }
  .member-list-card-value { min-width: 0; overflow-wrap: anywhere; color: var(--app-text); }
  .member-list-card-count { display: inline; margin-left: 6px; }
  .member-alert-list { justify-content: flex-end; }
  /* 整行本来就是点击区（.list-person 的 ::after 铺满一行），字号在这张名单上比别处大一档 */
  .member-list-table td { line-height: 1.3; }
  .member-list-table tbody tr { min-height: 52px; }
  .member-page .list-person strong { font-size: 16px; line-height: 1.4; }
  /* 320 这类窄屏：姓名和电话各收一档字号，保证一个人还是一件两行 */
  @media (max-width: 360px) {
    .member-page .member-list-table td.member-list-card-number,
    .member-page .member-list-table td.member-list-card-type { grid-column: 1 / -1; }
    .member-page .member-list-table td.member-list-alerts { grid-column: 1 / -1; grid-row: 4; justify-self: start; }
    .member-page .member-list-table td.member-list-alerts:has(> .member-alert-list:empty) { display: none; }
    .member-page .member-alert-list { justify-content: flex-start; }
    .member-page .list-person { gap: 8px; }
    .member-page .list-person strong { font-size: 14px; }
    .member-page .list-identity { gap: 12px; }
    .member-filter-people { gap: 4px; }
    .member-page .member-filter-people .member-quick-button { padding: 0 2px; font-size: 12px; }
    .member-filter-people .member-quick-button b { margin-left: 2px; }
  }
  .member-list-pager { padding: 14px 16px; }
  .task-row { padding: 10px 16px; }
  /* 底边直接跟随可见视口，不再重复扣减键盘高度；Safari 的视口平移也要计入。 */
  .app-modal { width: 100%; margin: 0;
    top: calc(var(--app-viewport-top, 0px) + var(--app-viewport-height, 100dvh)); transform: translateY(-100%);
    max-height: calc(var(--app-viewport-height, 100dvh) - max(12px, env(safe-area-inset-top, 0px)));
    border: 0; border-top: 1px solid var(--app-line); border-radius: var(--app-modal-radius) var(--app-modal-radius) 0 0; }
  .app-modal .app-form-grid { grid-template-columns: minmax(0, 1fr); }
  .app-modal__header { position: sticky; top: 0; z-index: 1; background: var(--app-white); }
  .app-drawer { top: calc(var(--app-viewport-top, 0px) + var(--app-viewport-height, 100dvh) - var(--drawer-bottom-gap, 0px));
    bottom: auto; transform: translateY(-100%);
    max-height: min(var(--drawer-max-height, 100dvh), calc(var(--app-viewport-height, 100dvh) - max(12px, env(safe-area-inset-top, 0px)) - var(--drawer-bottom-gap, 0px))); }
  /* 键盘弹出只收拾背景那一页；弹窗或抽屉开着时不动它，
     否则背后整页重排会把已经贴好的弹窗再顶一下（第二跳）。 */
  .app.keyboard-open:not(:has(.app-modal[open], .app-drawer[open])) .app-tabbar { display: none; }
  .app.keyboard-open:not(:has(.app-modal[open], .app-drawer[open])) .app-scroll { padding-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .app *, .app *::before, .app *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ===== v23 阶段3：移动端原生感与三端细节升级（保留全部业务字段与布局契约） ===== */
.app-back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 36px; padding: 0 12px 0 8px;
  border: none; border-radius: 999px;
  background: rgba(15, 23, 42, 0.06); color: var(--app-text);
  font-size: 14px; font-weight: 600; cursor: pointer; flex-shrink: 0;
  transition: transform .1s, background .15s;
}
.app-back-btn:active { transform: scale(0.94); background: rgba(15, 23, 42, 0.12); }
.app-modal__confirm-text { margin: 4px 0 8px; color: var(--app-text-secondary); line-height: 1.6; }
.task-main, .home-stat, .member-quick-button, .app-drawer__item, .list-table tbody tr {
  transition: transform .1s ease, background-color .14s ease;
}
.task-main:active, .home-stat:active, .member-quick-button:active, .app-drawer__item:active {
  transform: scale(0.98); background-color: var(--app-hover);
}
body.keyboard-open .app-fab-host { display: none !important; }
@media (min-width: 900px) {
  body.app.has-fab .app-scroll { padding-bottom: 96px; }
}
@media (max-width: 899px) {
  body.app { background: #f3f5f8; }
  .app-page-bar {
    background: rgba(255, 255, 255, 0.82) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 0.5px solid rgba(15, 23, 42, 0.08);
    display: flex; align-items: center; gap: 10px;
  }
  .panel {
    border-radius: 16px;
    border: 0.5px solid rgba(15, 23, 42, 0.07);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.03);
  }
  .app-modal__close { width: 44px; min-width: 44px; }
  .app-wrap > * { animation: appPageIn .18s ease-out; }
}
@keyframes appPageIn {
  from { opacity: 0.65; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .app-wrap > * { animation: none !important; }
}

/* ===== v23 正式落盘：首页 KPI + 横滑芯片 + 独立任务卡片 + 工作台 + 会员筛选折叠 ===== */
.app-tabbar__item { position: relative; }
.app-tabbar__badge {
  position: absolute; top: 4px; right: calc(50% - 20px);
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 999px; background: #dc2626; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

.home-brand-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.home-brand-dot {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #22c55e, #15803d); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  box-shadow: 0 3px 10px rgba(22, 163, 74, 0.24);
}
.home-brand-text { display: flex; flex-direction: column; min-width: 0; }
.home-brand-text h1 { margin: 0; font-size: 17px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-brand-sub { font-size: 12px; color: var(--app-muted); font-weight: 500; }
.home-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.home-quick-sale {
  border: none; height: 34px; padding: 0 13px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.06); color: var(--app-text);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: transform .1s, background .15s;
}
.home-quick-sale:active { transform: scale(0.95); background: rgba(15, 23, 42, 0.12); }

/* 首页 1 行 3 格核心 KPI */
.home-stats { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px !important; margin-bottom: 10px; }
.home-kpi {
  background: #fff !important; border-radius: 16px !important; padding: 13px 12px 11px !important;
  border: 1.5px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.03) !important;
  display: flex; flex-direction: column; align-items: flex-start !important; text-align: left !important;
  gap: 4px;
}
.home-kpi.is-on { border-color: #16a34a !important; background: #f4fdf6 !important; }
.home-kpi__num { font-size: 24px !important; font-weight: 700 !important; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--app-text); }
.home-kpi--danger .home-kpi__num { color: #dc2626 !important; }
.home-kpi--warn .home-kpi__num { color: #d97706 !important; }
.home-kpi__label { font-size: 12px; color: var(--app-muted); font-weight: 500; }

/* 其余 6 项单行横滑芯片条 */
.home-more {
  display: flex !important; flex-wrap: nowrap !important; gap: 8px !important;
  overflow-x: auto; padding: 2px 0 14px !important; scrollbar-width: none;
  background: transparent !important; border: none !important;
}
.home-more::-webkit-scrollbar { display: none; }
.home-chip {
  flex: 0 0 auto !important; width: auto !important; min-height: 36px !important;
  padding: 0 13px !important; border-radius: 999px !important;
  background: #fff !important; border: 1px solid rgba(15, 23, 42, 0.08) !important;
  display: inline-flex !important; flex-direction: row !important; align-items: center !important; gap: 6px !important;
  font-size: 13px !important; color: var(--app-text-secondary) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.home-chip strong { font-size: 13px !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.home-chip.is-on { background: #0f172a !important; color: #fff !important; border-color: #0f172a !important; }
.home-chip.is-on strong { color: #fff !important; }

.home-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 2px 10px;
}
.home-section-head h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--app-text); }

/* 独立圆角白底待办卡片 + 左侧色条 + 首字头像 + 右侧处理胶囊 */
.home-tasks-section .task-list { display: flex; flex-direction: column; gap: 10px; }
.task-card {
  position: relative; overflow: hidden;
  background: #fff !important; border-radius: 16px !important;
  padding: 13px 14px !important; border: 0.5px solid rgba(15, 23, 42, 0.07) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.03);
  display: flex !important; align-items: center !important; justify-content: space-between; gap: 10px;
}
.task-card::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3.5px;
  border-radius: 0 4px 4px 0; background: #16a34a;
}
.task-card--danger::before { background: #dc2626; }
.task-card--warn::before { background: #d97706; }
.task-card--info::before { background: #0284c7; }
.task-card .task-main {
  flex: 1; min-width: 0; display: flex !important; align-items: center; gap: 12px;
  background: transparent; border: none; padding: 0; text-align: left; cursor: pointer;
}
.task-avatar {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 16px; font-weight: 700;
  background: rgba(22, 163, 74, 0.10); color: #15803d;
}
.task-avatar--danger { background: #fee2e2; color: #dc2626; }
.task-avatar--warn { background: #fef3c7; color: #d97706; }
.task-avatar--info { background: #e0f2fe; color: #0284c7; }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.task-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-name-row .task-name { font-size: 15.5px; font-weight: 700; color: var(--app-text); }
.task-sub-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--app-muted); }
.task-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.task-action-pill {
  border: none; min-height: 34px; padding: 0 13px; border-radius: 10px;
  background: rgba(22, 163, 74, 0.10); color: #15803d;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: transform .1s, background .15s;
}
.task-action-pill:active { transform: scale(0.94); background: rgba(22, 163, 74, 0.18); }

/* 会员列表手机端：折叠筛选按钮 + 卡片化头像 + 刷新不塌陷 */
.member-filter-toggle { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
.member-filter-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #16a34a; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.member-table-wrap.is-refreshing { opacity: 0.55; pointer-events: none; transition: opacity .15s; }
.member-avatar {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  background: rgba(22, 163, 74, 0.10); color: #15803d;
  display: inline-grid; place-items: center; font-size: 14px; font-weight: 700; margin-right: 8px;
}

@media (max-width: 899px) {
  .member-quick-filters:not(.is-mobile-open) { display: none !important; }
  .member-list-panel { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 !important; }
  .member-list-table tbody { display: flex; flex-direction: column; gap: 10px; }
  .member-list-table tbody tr {
    background: #fff !important; border-radius: 16px !important;
    border: 0.5px solid rgba(15, 23, 42, 0.07) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.03) !important;
    padding: 12px 14px !important;
  }
}

/* 工作台页面 */
.workspace-page { display: flex; flex-direction: column; gap: 14px; padding-bottom: 16px; }
.workspace-profile-card { padding: 16px !important; }
.workspace-profile-row { display: flex; align-items: center; gap: 12px; }
.workspace-profile-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.workspace-profile-info strong { font-size: 17px; font-weight: 700; color: var(--app-text); }
.workspace-profile-info span { font-size: 13.5px; color: var(--app-muted); }
.workspace-group { padding: 16px !important; }
.workspace-group__title { margin: 0 0 14px; font-size: 15.5px; font-weight: 700; color: var(--app-text); }
.workspace-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
.workspace-tile {
  border: none; background: transparent; padding: 10px 6px; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 9px; cursor: pointer;
  transition: transform .1s, background .15s;
}
.workspace-tile:hover { background: var(--app-hover); }
.workspace-tile:active { transform: scale(0.94); background: var(--app-hover); }
.workspace-tile__ico {
  width: 52px; height: 52px; border-radius: 16px;
  background: rgba(22, 163, 74, 0.10); color: #15803d;
  display: grid; place-items: center;
}
.workspace-tile__ico svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.workspace-tile__name { font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--app-text); text-align: center; }
@media (min-width: 640px) {
  .workspace-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 12px; }
}
@media (min-width: 1024px) {
  .workspace-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
