/* 移动端覆盖层 - 2026 现代企业 CRM 移动体验
 *
 * 设计理念：参考 Salesforce Mobile、HubSpot、Pipedrive 等顶级 CRM 的移动端
 *
 * 核心原则：
 * 1. 卡片式信息流 - 每条客户独立卡片，清晰的视觉边界
 * 2. 触控优先 - 所有可点击元素 ≥44px（Apple HIG 标准）
 * 3. 快捷操作 - 高频动作（打电话、记跟进）一击直达
 * 4. 流畅交互 - 硬件加速动画、即时反馈
 * 5. 信息密度适中 - 适合销售快速扫描客户的信息流
 *
 * 加载顺序：tokens.css → components.css → pages.css → mobile.css（本文件必须最后）
 * 媒体查询不增加特异度，同特异度下后加载的规则生效。
 *
 * 手机端（<768px）规则的唯一归属就是本文件。pages.css 里原先有 10 个
 * max-width: 767px 块与本文件互相覆盖，已在 2026-10-15 逐条搬入这里；
 * 只有 .lc-name-main / .lc-clue 的 7 条声明留在 pages.css，因为 pages.css
 * 更后面还有桌面块重定义同属性，搬走会翻转胜负。新增手机规则请写在本文件，
 * 不要再回到 pages.css / components.css 开 media 块。
 *
 * 参考资料：
 * - Card UI 设计: https://www.stan.vision/journal/ui-card-design-examples-best-practices-and-common-patterns
 * - Bottom Sheet 交互: https://www.plotline.so/blog/mobile-app-bottom-sheets
 * - 左滑操作: https://horizon.servicenow.com/native-mobile/components/mobile-component-swipe-actions
 */

@media (max-width: 767px) {
  /* ---- 从 pages.css 迁入：手机端规则只写在这里 ---- */
  .app-sidebar { display: none; }
  .app-main { margin-left: 0; }
  .app-topbar { padding: 0 var(--sp-4); gap: var(--sp-2); }
  .app-topbar__search { display: none; }
  .app-topbar__toggle { display: inline-flex; }
  .app-content { padding: var(--sp-4); }
  .app-topbar__uname { display: none; }
  /* ---- 从 pages.css 迁入：手机端规则只写在这里 ---- */
  .auth-split { grid-template-columns: 1fr; max-width: 100%; margin: 0; border-radius: 0; box-shadow: none; min-height: 100vh; display: flex; flex-direction: column; }
  .auth-brand { flex: none; padding: var(--sp-8) var(--sp-5) var(--sp-6); background: linear-gradient(155deg, var(--brand-800) 0%, var(--brand-700) 50%, var(--brand-600) 100%); border-bottom: 1px solid rgba(255, 255, 255, 0.15); }
  .auth-brand__glow { width: 280px; height: 280px; right: -70px; top: -70px; background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%); }
  .auth-brand__foot { display: none; }
  .auth-brand__points li:nth-child(n+3) { display: none; }
  .auth-brand__logo { font-size: var(--fs-2xl); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25); }
  .auth-brand__slogan { margin: var(--sp-3) 0 var(--sp-5); font-size: var(--fs-base); opacity: 0.95; }
  .auth-brand__points li { background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.18); backdrop-filter: blur(8px); }
  .auth-form { flex: 1; padding: var(--sp-6) var(--sp-5); background: var(--n-0); display: flex; flex-direction: column; justify-content: center; }
  .auth-form__title { font-size: var(--fs-xl); }
  .auth-form__body { margin-top: var(--sp-5); }
  /* ---- 从 pages.css 迁入：手机端规则只写在这里 ---- */
  .dash-triptych { grid-template-columns: minmax(0, 1fr); }
  .dist-row { grid-template-columns: 84px minmax(0, 1fr) 36px; gap: var(--sp-2); }
  .command-center { padding: var(--sp-4); }
  .command-center__intro { flex-direction: column; }
  .command-center__intro .btn { margin-left: 0; }
  .command-center__title { font-size: var(--fs-lg); line-height: 1.35; }
  .command-center__grid { grid-template-columns: minmax(0, 1fr); }
  .command-center__body { grid-template-columns: minmax(0, 1fr); }
  .cc-rescue-item__time { display: none; }
  /* ---- 从 pages.css 迁入：手机端规则只写在这里 ---- */
  .table--cards thead { display: none; }
  .table--cards tbody tr { display: block; margin: var(--sp-3); padding: var(--sp-4); background: var(--n-0); border: 1px solid var(--n-200); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
  .table--cards tbody td { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-2) var(--sp-4); padding: var(--sp-1) 0; border: 0; text-align: left; }
  .table--cards tbody td::before { content: attr(data-label); flex: none; color: var(--n-500); font-size: var(--fs-xs); }
  .table--cards .table__num, .table--cards .table__actions { text-align: left; }
  .filter-grid { grid-template-columns: minmax(0, 1fr); }
  .leads-table tbody td.lc-pick { justify-content: flex-start; }
  .leads-table tbody td.lc-pick::before { content: none; }
  .leads-table tbody td.lc-id { font-size: var(--fs-lg); }
  .leads-table tbody td.lc-id::before { content: none; }
  .leads-table .lc-name { font-size: var(--fs-sm); color: var(--n-500); font-weight: 400; }
  .lc-name-main { font-size: var(--fs-lg); }
  .lc-clue { font-weight: 400; }
  .leads-table tbody td.lc-time::before, .leads-table tbody td.lc-region::before, .leads-table tbody td.lc-source::before, .leads-table tbody td.lc-origin::before { content: none; }
  .leads-table tbody td.lc-time, .leads-table tbody td.lc-region, .leads-table tbody td.lc-origin { display: inline-flex; width: auto; padding-right: var(--sp-3); color: var(--n-500); font-size: var(--fs-xs); }
  .leads-table tbody td.lc-source { display: block; padding: var(--sp-1) 0; }
  .leads-table tbody td.lc-source .cell-stack__main { font-size: var(--fs-sm); }
  .leads-table tbody td.lc-contact { font-size: var(--fs-lg); font-weight: 500; }
  .leads-table tbody td.lc-stage::before { content: none; }
  .leads-table tbody td.lc-follow { justify-content: flex-start; gap: var(--sp-3); }
  .leads-table tbody td.lc-follow::before { content: none; }
  .leads-table .lc-warn { color: var(--warning-fg); font-weight: 500; }
  .leads-table tbody td.lc-callback::before { content: none; }
  /* ---- 从 pages.css 迁入：手机端规则只写在这里 ---- */
  .app--auth .app-content { width:100%; padding:0; }
  .auth-split { width:100%; }
  .chat-import, .advisor-ask { padding: var(--sp-4); }
  .ai-warn, .advisor-warn, .ai-progress { margin-left: var(--sp-4); margin-right: var(--sp-4); }
  /* ---- 从 pages.css 迁入：手机端规则只写在这里 ---- */
  .lead-card-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px dashed var(--n-200); }
  .lead-card-actions .btn { flex: 1; height: 44px; }
  .table--cards tbody td.lead-card-actions-cell { display: block; padding: 0; border: 0; }
  .stage-quick { height: 40px; min-width: 120px; width: 100%; }
  /* ---- 从 pages.css 迁入：手机端规则只写在这里 ---- */
  .detail { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .detail-grid { display: flex; flex-direction: column; align-items: stretch; }
  .detail-main { order: 1; min-width: 0; }
  .detail-aside { order: 2; min-width: 0; }
  .detail-aside > .card { box-shadow: none; }
  .detail-hero { padding: var(--sp-4); }
  .detail-hero__name { font-size: var(--fs-xl); }
  /* ---- 从 pages.css 迁入：手机端规则只写在这里 ---- */
  .segmented { display: flex; max-width: 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .segmented::-webkit-scrollbar { display: none; }
  .segmented__item { flex: none; white-space: nowrap; }
  .segmented.is-overflowing { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  /* ---- 从 pages.css 迁入：手机端规则只写在这里 ---- */
  .board-col { flex: 0 0 78vw; max-height: none; }
  .leads-toolbar { flex-wrap: wrap; }
  .screen-kpi__value { font-size: 28px; }
  .screen { padding: var(--sp-4); }
  /* ---- 从 pages.css 迁入：手机端规则只写在这里 ---- */
  .cal-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-followup__header { align-items:flex-start; flex-wrap:wrap; row-gap:var(--sp-2); }
  /* 320–390px：标题 + 小宠物 + 语音按钮挤一行时，「记录跟进」会被拆成两行竖排。
     标题独占一行，工具条落到下一行整行摆开。 */
  .detail-followup__header .card__title { flex: 1 0 100%; }
  .detail-followup__tools { width:100%; margin-left:0; justify-content:space-between; }
  .detail-followup__header .btn { min-height:44px; }
  .voice-followup { width:100%; max-width:100vw; max-height:92dvh; margin:0; bottom:0; top:auto;
    border-radius:var(--r-xl) var(--r-xl) 0 0; }
  .voice-followup__header { padding:var(--sp-4); }
  .voice-followup__body { width:100%; padding:var(--sp-4); padding-bottom:calc(var(--sp-5) + env(safe-area-inset-bottom)); }
  .voice-followup__input-row { align-items:flex-start; flex-direction:column; }
  .voice-followup__input-row .btn { width:100%; min-height:48px; }
  .voice-followup__update { grid-template-columns:20px 92px minmax(0,1fr); }
  .voice-followup__body { scrollbar-width:none; }
  .voice-followup__body::-webkit-scrollbar { display:none; }
  .voice-followup__footer { padding:12px 16px calc(12px + env(safe-area-inset-bottom)); }
  /* ==================== 全局基础 ==================== */

  body {
    background: var(--n-50);
    -webkit-tap-highlight-color: rgba(255, 177, 51, 0.1);
    -webkit-touch-callout: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* 优化滚动性能 */
  .app-main,
  .drawer__body,
  .card__body,
  .profile-dialog__body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  /* ==================== 顶栏 - iOS 风格毛玻璃 ==================== */

  .app-topbar {
    height: 56px;
    padding: 0 var(--sp-4);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: none;
  }

  .app-topbar__title {
    font-size: 17px;
    font-weight: var(--fw-semibold);
    color: var(--n-900);
    letter-spacing: -0.3px;
  }

  .app-topbar__user {
    font-size: var(--fs-sm);
  }

  /* ==================== 内容区 ==================== */

  .app-content {
    padding: 0;
    background: var(--n-50);
    min-height: 100vh;
  }

  /* ==================== 线索列表 - 现代卡片流 ==================== */

  /* 工具栏 */
  .leads-toolbar {
    background: var(--n-0);
    padding: var(--sp-3) var(--sp-4);
    margin-bottom: var(--sp-2);
    border-bottom: 0.5px solid var(--n-200);
    position: sticky;
    top: 56px;
    z-index: var(--z-sticky);
  }

  .leads-toolbar__count {
    font-size: var(--fs-sm);
    color: var(--n-600);
    white-space: nowrap;
  }

  .leads-toolbar__right {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    align-items: center;
  }

  /* 视图切换 */
  .segmented {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .segmented::-webkit-scrollbar {
    display: none;
  }

  /* 批量操作栏 */
  .bulk-bar {
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-2);
    flex-wrap: wrap;
  }

  .bulk-bar__hint {
    width: 100%;
    font-size: var(--fs-xs);
    margin-top: var(--sp-2);
  }

  /* 列表容器 - 去掉卡片外框 */
  .card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }

  .state-ready {
    background: transparent;
  }

  /* 手机上「最近线索」「对账」这类表还是横表形态，右侧列必须能滑到。
     原先这里写成 overflow-x: visible（为了让竖排化的 .leads-table 不产生多余滚动条），
     结果把**所有**表都变成「右边看不见也滑不到」——概览页的「阶段」「创建时间」
     两列在手机上直接不可达。所以只给已经竖排化的 .leads-table 开这个洞。 */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .table-wrap:has(> .leads-table) {
    overflow-x: visible;
  }

  /* 表格重置 */
  .leads-table,
  .leads-table thead,
  .leads-table tbody {
    display: block;
    background: transparent;
  }

  .leads-table thead {
    display: none;
  }

  /* ==================== 线索卡片 - 2026 现代设计 ==================== */

  .leads-table tbody tr {
    display: block;
    position: relative;
    background: var(--n-0);
    margin: 0 var(--sp-3) var(--sp-3);
    padding: var(--sp-4);
    border-radius: var(--r-xl);
    border: 1px solid var(--n-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all var(--transition-fast);
    overflow: hidden;
  }

  /* 点击反馈 - 轻微缩放 + 更明显的阴影变化 */
  .leads-table tbody tr:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }

  /* 左侧阶段色条 */
  .leads-table tbody tr::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--brand-500);
    opacity: 0;
    transition: opacity var(--transition-fast);
  }

  .leads-table tbody tr.is-selected::before {
    opacity: 1;
  }

  /* td 重置为块级布局 */
  .leads-table tbody td {
    display: block;
    padding: 0;
    border: none;
    background: transparent;
    margin-bottom: var(--sp-3);
  }

  .leads-table tbody td:last-child {
    margin-bottom: 0;
  }

  /* 隐藏表格的 data-label */
  .leads-table tbody td::before {
    display: none !important;
  }

  /* ==================== 客户信息区 ==================== */

  /* 客户名称块 */
  .lc-name-block {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .lc-name-main {
    display: block;
    font-size: 17px;
    font-weight: var(--fw-semibold);
    color: var(--n-900);
    line-height: 1.4;
    letter-spacing: -0.3px;
    text-decoration: none;
  }

  .lc-name-main:hover {
    color: var(--brand-ink);
  }

  .lc-name-main--todo {
    color: var(--n-500);
    font-style: italic;
  }

  /* 就地命名按钮 */
  .lc-name-cta {
    align-self: flex-start;
    height: auto;
    min-height: 44px;
    padding: 0 var(--sp-4);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    background: var(--brand-50);
    color: var(--brand-700);
    border: 1px solid var(--brand-200);
    border-radius: var(--r-md);
    transition: all var(--transition-fast);
  }

  .lc-name-cta:hover {
    background: var(--brand-100);
    border-color: var(--brand-300);
  }

  .lc-name-input {
    max-width: none;
    width: 100%;
  }

  /* 客户 ID 区域 */
  .leads-table tbody td.lc-id {
    order: -1;
    margin-bottom: var(--sp-3);
  }

  .leads-table tbody td.lc-id .lc-name-block {
    flex: 1 1 100%;
  }

  .lc-clue {
    font-size: var(--fs-xs);
    color: var(--n-500);
    font-weight: var(--fw-normal);
  }

  /* 意向分数徽章 */
  .lc-score {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 2px var(--sp-2);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    border-radius: var(--r-sm);
    letter-spacing: 0.3px;
  }

  .lc-score--high {
    background: var(--success-bg);
    color: var(--success-fg);
  }

  .lc-score--med {
    background: var(--warning-bg);
    color: var(--warning-fg);
  }

  /* ==================== 联系方式区 ==================== */

  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-3);
  }

  .contact__line {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
    font-size: var(--fs-base);
    color: var(--n-700);
  }

  .contact__actions {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
  }

  .contact__actions .icon-btn {
    background: var(--brand-50);
    color: var(--brand-700);
    border: 1px solid var(--brand-200);
  }

  .contact__actions .icon-btn:active {
    background: var(--brand-100);
    transform: scale(0.95);
  }

  /* ==================== 阶段徽章 ==================== */

  .badge {
    padding: 4px var(--sp-2);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    border-radius: var(--r-sm);
    letter-spacing: 0.3px;
  }

  /* 阶段快捷选择 */
  .stage-quick {
    height: 44px;
    padding: 0 var(--sp-3);
    font-size: var(--fs-base);
    background: var(--n-100);
    border: 1px solid var(--n-200);
    border-radius: var(--r-md);
  }

  /* ==================== 卡片操作区 ==================== */

  .lead-card-actions {
    display: flex !important;
    gap: var(--sp-2);
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 0.5px solid var(--n-200);
  }

  .lead-card-actions .btn {
    flex: 1;
    height: 44px;
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    border-radius: var(--r-md);
  }

  /* ==================== 选择框增强 ==================== */

  .rowck { width: 20px; height: 20px; accent-color: var(--brand-500); }

  .lc-pick__hit { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; }

  .leads-table tbody td.lc-pick {
    min-height: 44px;
    display: flex;
    align-items: center;
    margin-bottom: var(--sp-2);
  }

  /* ==================== 详情页 ==================== */

  .detail {
    padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
  }

  .detail-hero {
    background: var(--n-0);
    padding: var(--sp-5) var(--sp-4);
    margin-bottom: var(--sp-2);
    border-bottom: 0.5px solid var(--n-200);
  }

  .detail-hero__name-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--sp-3);
  }

  .detail-hero__name {
    /* flex-shrink 必须是 0：名字这一行多了四五个徽章，允许收缩的话名字会被
       挤成一列单字（截图里就是「林先生01」竖着排），宁可让徽章换到下一行。 */
    flex: 1 0 auto;
    max-width: 100%;
    min-width: 0;
    font-size: 24px;
    font-weight: var(--fw-bold);
    color: var(--n-900);
    line-height: 1.2;
    letter-spacing: -0.5px;
  }

  .detail-grid {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .detail-main {
    order: 1;
  }

  .detail-aside {
    order: 2;
  }

  .detail-aside > .card {
    box-shadow: none;
    border-radius: var(--r-lg);
  }

  /* 联系方式卡片 - 强化视觉层次 */
  .detail-focus__history {
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  }





  /* 窄屏：上一条/下一条整行下移，客户名才有地方放（否则名字被裁一半） */
  .detail-hero__nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .contact-nav__button {
    min-height: 48px;
    min-width: 48px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
  }

  .contact-nav__button:hover {
    background: rgba(255, 255, 255, 0.35);
  }

  .contact-nav__button.is-disabled {
    opacity: 0.4;
  }

  /* 窄屏放不下「三列网格 + 上下条贴右端」：三列的最小宽度加起来比屏幕还宽。
     改成两列 + 整块居中：号码一行、动作一行、上下条一行，每一行都居中。 */
  .contact-line--phone {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    column-gap: var(--sp-2);
    row-gap: var(--sp-2);
  }

  .contact-line--phone .contact__label {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
  }

  .contact-line--phone .contact__value[data-contact-value="phone"] {
    grid-column: 2;
    grid-row: 1;
  }

  .contact-line--phone .contact__actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }

  .contact-line--phone .detail-hero__nav {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
    width: auto;
    margin: 0;
  }

  /* 客户分析浮球：手机抬到底部 tab 上方，小一档，别挡住跟进入口 */
  .ai-fab {
    width: 56px;
    height: 56px;
    right: var(--sp-4);
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .ai-fab__icon { width: 22px; height: 22px; }

  /* 联系方式内容区 */
  .detail-focus__history .card__body {
    padding: var(--sp-5);
    background: var(--n-0);
  }

  .contact__value {
    font-size: 21px;
    font-weight: var(--fw-semibold);
    color: var(--n-900);
  }

  .contact__actions .btn {
    min-height: 44px;
    font-weight: var(--fw-semibold);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  }

  .contact__actions .btn--primary {
    box-shadow: 0 4px 12px rgba(255, 177, 51, 0.35), 0 2px 6px rgba(255, 177, 51, 0.2);
  }

  /* 快速跟进标签 */
  .quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
  }

  .quick-tag {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--sp-3);
    min-height: 36px;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--brand-700);
    background: var(--brand-50);
    border: 1px solid var(--brand-200);
    border-radius: var(--r-md);
    transition: all var(--transition-fast);
  }

  .quick-tag:active {
    transform: scale(0.96);
    background: var(--brand-100);
  }

  /* ==================== 客户作战台（今日工作台）- 移动端增强 ==================== */

  /* 她的原话：「可以直接 6 个放在同一行」。电话/微信/备注 + A/B/C 一行排完，
     两个小标题在这一屏收掉——胶囊上的字已经说明自己是什么，标题只是把一行挤成两行。
     可点区靠 chip 自己的 min-height 撑到 44px，不是靠标题占位。 */
  .detail-followup__picks {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--sp-1);
  }

  .detail-followup__picks .field__label {
    display: none;
  }

  .detail-followup__picks .field {
    min-width: 0;
  }

  .detail-followup__picks .chips--tight {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--sp-1);
  }

  .detail-followup__picks .chip {
    flex: 1 1 0;
    min-width: 0;
  }

  .detail-followup__picks .chip__label {
    display: block;
    min-height: 44px;
    padding: 0 4px;
    font-size: var(--fs-xs);
    text-align: center;
    white-space: nowrap;
  }

  .detail-followup__picks-split {
    display: block;
    flex: 0 0 var(--sp-3);
  }

  /* 宠物在手机上要按得动，面板不能顶出屏幕 */
  .pet {
    min-height: 44px;
  }

  .pet__panel {
    width: min(236px, calc(100vw - 40px));
  }

  .workbench__header {
    background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-100) 100%);
    padding: var(--sp-5);
  }

  .workbench__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-4);
  }

  .workbench__summary {
    padding: var(--sp-5);
    background: var(--n-0);
    border-radius: var(--r-lg);
  }

  .workbench__summary-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--n-800);
    margin-top: var(--sp-3);
  }

  .workbench__next {
    padding: var(--sp-5);
    padding-top: var(--sp-4);
    border-left: 0;
    border-top: 2px solid var(--brand-200);
    background: var(--brand-50);
    border-radius: var(--r-lg);
  }

  .workbench__next-title {
    display: block;
    font-size: 17px;
    font-weight: var(--fw-bold);
    color: var(--brand-800);
    margin: var(--sp-3) 0;
    line-height: 1.4;
  }

  .workbench__actions {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
  }

  .workbench__actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  }

  .workbench__actions .btn--primary {
    box-shadow: 0 4px 12px rgba(255, 177, 51, 0.4), 0 2px 6px rgba(255, 177, 51, 0.25);
  }

  .workbench__score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-1);
    padding: var(--sp-3) var(--sp-4);
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--r-lg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    margin-left: auto;
  }

  .workbench__score-label {
    font-size: var(--fs-xs);
    color: var(--n-600);
    font-weight: var(--fw-medium);
  }

  .workbench__score strong {
    font-size: 24px;
    font-weight: var(--fw-bold);
    color: var(--brand-ink);
  }

  .workbench__script {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--sp-3);
    padding: var(--sp-4);
    background: var(--n-50);
    border-radius: var(--r-lg);
    border: 1px solid var(--n-200);
  }

  .workbench__script-title {
    grid-column: 1 / -1;
    font-weight: var(--fw-semibold);
    color: var(--n-800);
  }

  .workbench__script-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
    color: var(--n-700);
  }

  /* 工作台卡片的就地命名 */
  .today-card__head .lc-name-input {
    flex: 1 0 100%;
    max-width: none;
  }

  .today-card__head .lc-name-cta {
    flex: 1 0 100%;
    width: auto;
  }

  /* ==================== 客户档案弹窗 - 底部抽屉 ==================== */

  .profile-dialog {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    max-height: 85vh;
    margin: 0;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    background: var(--n-0);
  }

  .profile-dialog::before {
    content: "";
    position: absolute;
    top: var(--sp-2);
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--n-300);
    border-radius: var(--r-full);
  }

  .profile-dialog__header {
    padding: var(--sp-5) var(--sp-4) var(--sp-3);
    border-bottom: 0.5px solid var(--n-200);
  }

  .profile-dialog__title {
    font-size: 17px;
    font-weight: var(--fw-semibold);
    color: var(--n-900);
  }

  .profile-dialog__body {
    max-height: 75vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .profile-summary {
    grid-template-columns: 1fr;
  }

  .follow-status {
    gap: var(--sp-3);
  }

  .follow-status > div {
    min-width: 0;
    flex: 1 1 130px;
  }

  /* ==================== 话术工具栏 ==================== */

  .call-script__toolbar .segmented {
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .call-script__toolbar .segmented__item {
    white-space: nowrap;
    flex: none;
  }

  .call-script__list .icon-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
  }

  /* ==================== 触控目标统一 ≥44px ==================== */

  /* 按钮 */
  .btn { height: 44px; padding: 0 var(--sp-4); }
  .btn--sm { height: 44px; padding: 0 var(--sp-3); }
  .btn--lg { height: 48px; }
  .icon-btn { width: 44px; height: 44px; }
  .reminder__badge { top: 4px; right: 4px; }

  /* 按钮样式优化 */
  .btn--primary {
    background: linear-gradient(180deg, var(--brand-500) 0%, var(--brand-600) 100%);
    border: none;
    color: var(--n-0);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3), 0 2px 4px rgba(245, 158, 11, 0.2);
    font-weight: var(--fw-semibold);
  }

  .btn--primary:active {
    transform: scale(0.96);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
  }

  .btn--secondary {
    background: var(--n-100);
    border: 1px solid var(--n-200);
    color: var(--n-800);
  }

  .btn--secondary:active {
    background: var(--n-200);
  }

  .btn--ghost {
    background: transparent;
    color: var(--brand-700);
  }

  .btn--ghost:active {
    background: var(--brand-50);
  }

  /* 输入控件 */
  .input, .select, .input--sm, .select--sm { min-height: 44px; }

  .input, .select {
    background: var(--n-100);
    border: 1px solid var(--n-200);
    border-radius: var(--r-md);
    font-size: var(--fs-base);
    padding: 0 var(--sp-3);
  }

  .input:focus,
  .select:focus {
    background: var(--n-0);
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px rgba(255, 177, 51, 0.1);
  }

  .textarea {
    min-height: 88px;
    background: var(--n-100);
    border: 1px solid var(--n-200);
    border-radius: var(--r-md);
    padding: var(--sp-3);
    font-size: var(--fs-base);
  }

  .textarea:focus {
    background: var(--n-0);
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px rgba(255, 177, 51, 0.1);
  }

  /* 她主要在手机上手打跟进，这个框只给两行等于不让人写 */
  .followup-content {
    min-height: 148px;
  }

  .check,
  .radio {
    min-height: 44px;
  }

  .check input,
  .radio input {
    width: 18px;
    height: 18px;
  }

  .switch {
    min-height: 44px;
  }

  /* 导航 */
  .app-nav-item { height: 44px; }
  .tabs__item {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: var(--fs-base);
  }

  .segmented__item {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
    font-size: var(--fs-base);
  }

  .dropdown__item { display: flex; align-items: center; min-height: 44px; }

  .crumbs a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .spec-note > summary {
    min-height: 44px;
  }

  .profile-edit > summary {
    min-height: 44px;
  }

  /* 标签和胶囊 */
  .quick-tag { min-height: 44px; padding: 0 var(--sp-4); background: var(--n-100); border: 1px solid var(--n-200); border-radius: var(--r-md); color: var(--n-800); font-weight: var(--fw-medium); }
  .quick-tags--text .quick-tag { min-height: 44px; }
  .chip { min-height: 44px; padding: 0 var(--sp-3); background: var(--n-100); border: 1px solid var(--n-200); border-radius: var(--r-md); }
  .chip__x { display: inline-flex; align-items: center; align-self: stretch; padding: 0 var(--sp-2); margin-right: calc(-1 * var(--sp-2)); }
  .chip__label { height: 44px; }
  /* 单选胶囊在手机上要 44 高才点得准；横向内边距还按桌面的 8px 算，
     两个字（26+16=42）跟高度差不多，圆角一压就成了个圆球。
     多给横向内边距，选中的那颗看起来仍是胶囊。 */
  .chip.chip-radio .chip__label { padding: 0 var(--sp-4); }

  /* 分页 */
  .pager__item { min-width: 44px; height: 44px; }

  /* 列表页就地打标 */
  .stage-quick { height: 44px; }

  /* 工具提示 */
  .tooltip { width: 20px; height: 20px; margin: -3px 0 -3px var(--sp-1); font-size: 12px; }
  .tooltip::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }

  /* 其他可点击元素 */
  .cal-item {
    min-height: 44px;
  }

  .toast__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  /* ==================== 无限滚动 ==================== */

  .leads-more { display: block; margin: var(--sp-3); }
  .leads-more .btn { width: 100%; }
  .leads-more__done {
    display: block;
    padding: var(--sp-4) 0;
    text-align: center;
    color: var(--n-500);
    font-size: var(--fs-sm);
  }

  /* 分页条让位给无限滚动 */
  .pager { display: none; }

  /* ==================== Toast 通知 ==================== */

  .toast-stack {
    top: auto;
    left: var(--sp-4);
    right: var(--sp-4);
    bottom: var(--sp-4);
    max-width: none;
  }

  .toast {
    border-radius: var(--r-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  /* ==================== 空状态 ==================== */

  .empty-state {
    padding: var(--sp-10) var(--sp-6);
    text-align: center;
  }

  .empty-state__title {
    font-size: var(--fs-xl);
    font-weight: var(--fw-semibold);
    color: var(--n-900);
    margin-bottom: var(--sp-2);
  }

  .empty-state__desc {
    font-size: var(--fs-base);
    color: var(--n-600);
    line-height: 1.6;
    margin-bottom: var(--sp-6);
  }

  /* ==================== 骨架屏 ==================== */

  .skeleton {
    background: linear-gradient(
      90deg,
      var(--n-100) 0%,
      var(--n-200) 50%,
      var(--n-100) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--r-md);
  }

  @keyframes skeleton-loading {
    0% {
      background-position: 200% 0;
    }
    100% {
      background-position: -200% 0;
    }
  }

  .skeleton--row {
    height: 80px;
    margin: 0 var(--sp-3) var(--sp-2);
    border-radius: var(--r-lg);
  }

  /* ==================== 页面特定优化 ==================== */

  /* 概览页 */
  /* minmax(0,1fr) 而不是 1fr：1fr 的最小宽度是 auto，卡片里「已发出 0 条，成功 0 条」
     这类不短的句子会把列顶到超过视口，整页变成左右滑。桌面那条规则写的就是
     minmax(0,1fr)，覆盖时不能退回去。 */
  .dash-stats__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-3);
    padding: var(--sp-3);
  }

  .stat-card {
    padding: var(--sp-4);
    border-radius: var(--r-lg);
  }

  /* 指挥中心 */
  .command-center__intro {
    flex-direction: column;
    gap: var(--sp-4);
  }

  .command-center__intro .btn {
    width: 100%;
  }

  .command-center__actions {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .command-center__actions .btn {
    flex: 1 1 140px;
  }

  .cc-panel__header .btn {
    min-width: 100px;
  }

  /* 客户回捞 */
  .recovery-head {
    flex-direction: column;
    gap: var(--sp-4);
  }

  .recovery-summary {
    grid-template-columns: 1fr;
  }

  .recovery-summary > div + div {
    border-left: 0;
    border-top: 1px solid var(--n-200);
    padding-left: 0;
    padding-top: var(--sp-3);
  }

  .recovery-item__actions {
    display: flex;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
  }

  .recovery-item__actions .btn {
    flex: 1 1 130px;
  }

  /* 投放质量 */
  .quality-head {
    flex-direction: column;
    gap: var(--sp-4);
  }

  .quality-head .segmented {
    width: 100%;
  }

  .quality-head .segmented__item {
    flex: 1;
    justify-content: center;
  }

  /* 质量表格卡片化 */
  .quality-table,
  .quality-table tbody,
  .quality-table tr,
  .quality-table td {
    display: block;
  }

  .quality-table thead {
    display: none;
  }

  .quality-table tr {
    margin: 0 var(--sp-3) var(--sp-3) var(--sp-3);
    padding: var(--sp-4);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    background: var(--n-0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  .quality-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-3);
    min-width: 0;
    padding: var(--sp-3) 0;
    white-space: normal;
    text-align: right;
    border-bottom: 1px solid var(--n-100);
    font-size: var(--fs-base);
  }

  .quality-table td:last-child {
    border-bottom: 0;
  }

  .quality-table td::before {
    content: attr(data-label);
    flex: none;
    color: var(--n-500);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
  }

  .quality-table td.quality-table__plan {
    display: block;
    text-align: left;
    padding: var(--sp-3) 0 var(--sp-4);
  }

  .quality-table td.quality-table__plan::before {
    display: none;
  }

  .quality-table td small {
    display: inline;
    margin-left: var(--sp-1);
  }

  .quality-table td.quality-table__plan small {
    display: block;
    margin-left: 0;
    margin-top: var(--sp-1);
  }

  /* 演示环境横幅 */
  .demo-environment-banner {
    position: sticky;
  }

  .demo-profile-summary__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* ==================== 今日工作台 ==================== */
  /* 手机端新规则一律写在这里，不要再回到 pages.css 的 max-width 块，
     否则同一个选择器会在两个文件里各有一份、靠加载顺序决胜。 */

  .today-hero {
    padding: var(--sp-4) var(--sp-5) var(--sp-5);
    margin-bottom: var(--sp-4);
    border-radius: var(--r-md);
  }
  .today-card {
    padding: var(--sp-4);
    gap: var(--sp-3);
    border-radius: var(--r-md);
  }
  .today-card__when { width: 54px; font-size: var(--fs-sm); }
  .today-card__meta { gap: var(--sp-2) var(--sp-4); }
  .card__hint { font-size: var(--fs-xs); }
}

/* 客户分析浮球：手机向下滚动时收起，避免压住「保存跟进」等主按钮 */
@media (max-width: 767px) {
  .ai-fab { transition: opacity .18s ease, transform .18s ease; }
  .ai-fab.is-tucked { opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; }
  /* 跟进卡在视口里：贴到右边只留一条，别压住胶囊和输入框 */
  .ai-fab.is-yielding { transform: translateX(calc(100% - 18px)); opacity: .94; }
  .ai-fab.is-yielding .ai-fab__label,
  .ai-fab.is-yielding .ai-fab__score { opacity: 0; }
}
