#phone-nav, .phone-brand, .phone-profit { display: none; }

@media (max-width: 640px) {
  :root {
    --phone-nav-height: calc(56px + env(safe-area-inset-bottom));
    --phone-bottom: var(--phone-nav-height);
  }
  body[data-page="order"] { --phone-bottom: calc(var(--phone-nav-height) + 72px); }
  #bar {
    padding: env(safe-area-inset-top) 16px 0;
    height: calc(54px + env(safe-area-inset-top));
    flex-wrap: wrap;
    gap: 0 8px;
    position: relative;
  }
  #bar .crumb > :not(.phone-brand), #sidebar { display: none; }
  .phone-brand { display: block; width: 85px; height: auto; }
  .bar-end { gap: 8px; }
  .bar-end .book, button.account-button { min-height: 42px; }
  .bar-end .book { background: transparent; border: 0; color: var(--ink); }
  #sync-note:not(:empty) {
    position: absolute; top: 100%; right: 12px; padding: 2px 7px;
    background: #fff2df; border-radius: 4px; z-index: 2;
  }
  #main { padding: 16px 12px calc(var(--phone-bottom) + 20px); }
  .page-head { align-items: center; margin-bottom: 14px; }
  .page-head h1 { font-size: 26px; }
  .page-head p, [data-page="order"] .page-head button, [data-page="ledger"] .page-head button { display: none; }
  #phone-nav {
    position: fixed; inset: auto 0 0; z-index: 9; display: grid;
    grid-template-columns: repeat(4, 1fr); height: var(--phone-nav-height);
    padding-bottom: env(safe-area-inset-bottom); background: white; border-top: 1px solid var(--line);
  }
  #phone-nav button {
    background: transparent; border: 0; flex-direction: column;
    gap: 2px; font-size: 11px; font-weight: 550; color: #62696d;
  }
  #phone-nav button.current { color: #ab400e; }
  #phone-nav button.current svg { stroke-width: 2.2; }
  .phone-more .nav-item { color: var(--ink); min-height: 48px; }
  .phone-more .nav-item.active { color: #973d10; background: #fff1e7; }
  .phone-more .nav-item:hover { background: #f5f5f5; }
  .panel { padding: 14px; }
  .list-panel { padding: 0; }
  .panel-title { margin-bottom: 12px; }
  .panel-title h2 { font-size: 17px; gap: 8px; }
  .product { min-height: 140px; }
  .prod-photo img { height: 135px; }
  .prod-content { padding: 12px 0 12px 12px; }
  .model { font-size: 28px; overflow-wrap: anywhere; }
  .qty { margin-top: 6px; }
  .color-change { min-height: 36px; }
  .battery-row { margin-top: 12px; }
  .field input, .field select, .search input { font-size: 16px; min-height: 44px; }
  .field input[type="date"] { padding-inline: 6px; }
  .price-input input { height: 42px; min-height: 42px; }
  .segments, .auto-fee { height: 44px; }
  .segments { padding: 0; }
  .segments button { padding: 0 4px; gap: 3px; }
  .segments svg { display: none; }
  .platform-choices button, .catalog-colors button, .primary, .small-btn, .outline, .tabs button, .icon-btn { min-height: 44px; }
  .icon-btn { width: 44px; }
  .platform-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .platform-choices button { padding: 5px 3px; }
  .order-layout { gap: 0; }
  #summary { position: static; border: 0; overflow: visible; }
  #summary > .profit-top, #summary > .sum-detail, #summary .sum-footer p { display: none; }
  #summary .sum-footer {
    position: fixed; inset: auto 0 var(--phone-nav-height); z-index: 8;
    height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 16px; background: white; border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px #1e232708;
  }
  .sum-footer .wide { width: auto; height: 46px; flex: none; }
  .phone-profit { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 0; border: 0; background: transparent; min-height: 44px; }
  .phone-profit span { display: flex; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; }
  .phone-profit strong { color: var(--ink); font-size: clamp(17px,5.4vw,24px); line-height: 1.25; font-variant-numeric: tabular-nums; }
  #toast { bottom: calc(var(--phone-bottom) + 8px); width: max-content; max-width: calc(100% - 24px); text-align: center; }
  .metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 12px 2px; margin-bottom: 12px; }
  .metrics > div { min-width: 0; padding: 0 6px; }
  .metrics strong { font-size: clamp(14px,4vw,19px); overflow-wrap: anywhere; }
  .toolbar { gap: 8px; }
  .list-panel .table-wrap { overflow: visible; }
  .list-panel table, .list-panel tbody { display: block; white-space: normal; }
  .list-panel thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .list-panel tbody tr {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px 14px; border-top: 1px solid var(--line); padding: 15px;
  }
  .list-panel td { display: block; border: 0; padding: 0; min-width: 0; overflow-wrap: anywhere; }
  .list-panel td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; margin-bottom: 1px; }
  .list-panel td:is([data-label="车型"],[data-label="名称"],[data-label="平台名称"],[data-label="备份时间"],[data-label="摘要"]) { grid-column: 1 / -1; }
  .list-panel td:is([data-label="车型"],[data-label="名称"],[data-label="平台名称"],[data-label="备份时间"]) { order: -1; font-weight: 650; font-size: 16px; }
  .list-panel td:is([data-label="车型"],[data-label="名称"],[data-label="平台名称"],[data-label="操作"])::before { display: none; }
  .list-panel td[data-label="操作"] { grid-column: 1/-1; display: flex; justify-content: flex-end; border-top: 1px solid #f0f1f2; }
  .list-panel td[data-label="预计毛利"] { font-weight: 650; }
  .list-panel td .text-btn { min-width: 44px; min-height: 44px; }
  dialog {
    position: fixed; inset: auto 0 0; margin: 0 auto; width: 100%; max-width: 100%;
    max-height: calc(94dvh - env(safe-area-inset-top)); padding-bottom: env(safe-area-inset-bottom);
    border: 0; border-radius: 18px 18px 0 0; overscroll-behavior: contain;
  }
  .dialog-head { position: sticky; top: 0; z-index: 2; background: white; padding: 8px 14px; }
  .dialog-body { padding: 12px 16px 20px; }
  .dialog-body .profit-top { border-radius: 10px; }
  .dialog-body .sum-detail { padding: 14px 2px 0; }
  .login-card { padding: 22px; }
}
@media (max-width: 359px) {
  .platform-choices button { gap: 4px; }
  .platform-icon { width: 20px; height: 20px; }
  .battery-row { grid-template-columns: minmax(0,1fr); }
  .cost-info { display: flex; gap: 6px; align-items: baseline; }
}
