
  :root {
    --brand1: #4f46e5;
    --brand2: #6366f1;
    --green: #16a34a;
    --green2: #22c55e;
    --green-dark: #15803d;
    --red: #dc2626;
    --red2: #ef4444;
    --bg: #f8fafc;
    --card: #ffffff;
    --line: #e2e8f0;
    --line2: #cbd5e1;
    --txt: #0f172a;
    --txt2: #64748b;
    --txt3: #94a3b8;
    --sh-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --sh-md: 0 4px 14px rgba(15, 23, 42, .07);
    --sh-card: 0 8px 20px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .04);
    --sh-lg: 0 16px 40px rgba(15, 23, 42, .16);
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }
  html, body { height: 100%; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
    background: var(--bg); color: var(--txt); font-size: 16px; user-select: none;
    -webkit-font-smoothing: antialiased;
  }
  button {
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
  }
  .hidden { display: none !important; }
  :focus-visible { outline: 3px solid rgba(79, 70, 229, .35); outline-offset: 2px; border-radius: 8px; }

  /* ===== 通用按钮/元素 ===== */
  .btn-big {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 56px; border: none; border-radius: 16px;
    font-size: 20px; font-weight: 800; color: #fff; cursor: pointer;
    background: linear-gradient(135deg, var(--brand1), var(--brand2));
    box-shadow: 0 6px 16px rgba(79, 70, 229, .25);
    transition: transform .08s ease, box-shadow .15s ease, filter .15s ease;
  }
  .btn-big:active { transform: translateY(1px) scale(.99); box-shadow: 0 3px 8px rgba(79, 70, 229, .18); filter: brightness(.97); }
  .btn-big[disabled] { background: #c7d2fe; color: #eef2ff; box-shadow: none; }

  /* ===== 登录页 ===== */
  #view-login { min-height: 100%; padding: 40px 22px 28px; display: flex; flex-direction: column; animation: fadeIn .25s ease; }
  .login-brand {
    width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 26px;
    background: linear-gradient(135deg, var(--brand1), var(--brand2));
    display: flex; align-items: center; justify-content: center; color: #fff;
    box-shadow: 0 12px 28px rgba(79, 70, 229, .28);
  }
  .login-brand svg { width: 44px; height: 44px; }
  .login-title { font-size: 30px; font-weight: 900; text-align: center; letter-spacing: 1px; margin-bottom: 8px; }
  .login-sub { font-size: 15px; color: var(--txt2); text-align: center; margin-bottom: 6px; }
  .login-label { font-size: 16px; font-weight: 800; margin: 20px 0 9px; }
  /* 门店下拉选择 */
  .store-dropdown { position: relative; }
  .store-trigger {
    width: 100%; min-height: 56px; border: 1.5px solid var(--line2); border-radius: 16px;
    background: var(--card); box-shadow: var(--sh-sm); display: flex; align-items: center;
    justify-content: space-between; gap: 10px; padding: 0 16px; cursor: pointer;
    font-size: 17px; font-weight: 700; color: var(--txt);
    transition: border-color .15s ease, box-shadow .15s ease;
  }
  .store-trigger:active { background: #f7f7f9; }
  .store-trigger.open { border-color: var(--brand1); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
  .store-trigger-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .store-trigger-label.empty { color: var(--txt3); font-weight: 600; }
  .store-arrow { color: var(--txt3); font-size: 16px; transition: transform .2s ease; }
  .store-trigger.open .store-arrow { transform: rotate(180deg); }
  .store-panel {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
    background: var(--card); border: 1.5px solid var(--line2); border-radius: 16px;
    box-shadow: var(--sh-lg); overflow: hidden;
    animation: panelIn .22s cubic-bezier(.25, .8, .3, 1);
  }
  .store-search {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    border-bottom: 1px solid var(--line); color: var(--txt3);
  }
  .store-search svg { width: 18px; height: 18px; flex: 0 0 auto; }
  .store-search input {
    flex: 1; border: none; outline: none; font-size: 16px; font-weight: 600; color: var(--txt);
    background: transparent; min-width: 0;
  }
  .picker-list { max-height: 260px; overflow-y: auto; }
  .picker-item {
    padding: 13px 14px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; cursor: pointer;
    transition: background .12s ease;
  }
  .picker-item:last-child { border-bottom: none; }
  .picker-item .store-num {
    flex: 0 0 auto; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 8px;
    background: #eef1f8; color: var(--brand1); font-size: 13px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; margin-right: 10px;
  }
  .picker-item .store-name-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .picker-item .check {
    color: var(--green); width: 24px; height: 24px; border-radius: 50%;
    background: #f0fdf4; display: flex; align-items: center; justify-content: center; font-size: 14px;
  }
  .picker-item.picked { background: #f4f3f9; color: var(--brand1); font-weight: 800; }
  .login-input {
    width: 100%; border: 1.5px solid var(--line2); border-radius: 16px; padding: 15px;
    font-size: 22px; font-weight: 700; letter-spacing: 6px; outline: none; background: var(--card);
    color: var(--txt); text-align: center; box-shadow: var(--sh-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
  }
  .login-input:focus { border-color: var(--brand1); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
  .login-err { color: var(--red); font-size: 15px; font-weight: 600; margin: 12px 2px; min-height: 22px; }
  .login-btn { margin-top: auto; min-height: 60px; font-size: 22px; border-radius: 18px; }
  .login-hint { margin-top: 14px; text-align: center; font-size: 13px; color: var(--txt3); }
  /* 手机号修正申请 */
  .phone-req { margin-top: 16px; text-align: center; font-size: 15px; color: var(--txt2); cursor: pointer; }
  .phone-req u { color: var(--brand1); font-weight: 700; }
  .phone-req-panel {
    margin-top: 14px; background: #fffbeb; border: 2px solid #f59e0b; border-radius: 16px;
    padding: 16px 16px 18px; box-shadow: 0 4px 14px rgba(245, 158, 11, .18);
  }
  .phone-req-panel .req-store { font-size: 15px; font-weight: 800; color: #92400e; margin-bottom: 10px; }
  .phone-req-panel .login-input { border-color: #fcd34d; background: #fff; }
  .phone-req-panel .login-input:focus { border-color: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .15); }
  .phone-req-panel .btn-big {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #7c2d12;
    box-shadow: 0 6px 16px rgba(245, 158, 11, .3);
  }
  .phone-req-panel .btn-big:active { filter: brightness(.94); }
  .req-msg { margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--green-dark); min-height: 20px; }
  .req-msg.err { color: var(--red); }

  /* ===== App 主框架 ===== */
  #view-app { display: flex; flex-direction: column; height: 100dvh; animation: fadeIn .25s ease; }
  .app-header {
    background: #ffffff; color: var(--txt); padding: 10px 12px;
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    border-bottom: 1px solid var(--line); box-shadow: 0 1px 4px rgba(15, 23, 42, .05);
  }
  .header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .header-avatar {
    width: 36px; height: 36px; border-radius: 11px;
    background: linear-gradient(135deg, var(--brand1), var(--brand2));
    display: flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto;
    box-shadow: 0 4px 10px rgba(79, 70, 229, .28);
  }
  .header-avatar svg { width: 20px; height: 20px; }
  .app-header .store { font-size: 15px; font-weight: 800; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-header .store small { display: block; font-size: 11px; font-weight: 500; color: var(--txt2); }
  .save-status {
    font-size: 11.5px; font-weight: 700; background: #eef2ff; color: var(--brand1); padding: 5px 9px;
    border-radius: 999px; white-space: nowrap;
    display: flex; align-items: center; gap: 5px;
  }
  .save-status::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .28);
  }

  .tab-panel { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 78px; }

  /* 搜索区 */
  .search-wrap { padding: 8px 10px 4px; background: var(--bg); position: sticky; top: 0; z-index: 5; }
  .search-box {
    display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px;
    background: var(--card); border: 1.5px solid var(--line2); border-radius: 14px;
    box-shadow: var(--sh-md);
    transition: transform .22s ease, box-shadow .35s ease, border-color .35s ease;
  }
  .search-box:focus-within {
    transform: scale(1.02);
    border-color: var(--brand2);
    box-shadow:
      0 0 0 4px rgba(99, 102, 241, .14),
      0 0 20px rgba(99, 102, 241, .22),
      0 0 44px rgba(139, 92, 246, .16),
      0 8px 22px rgba(79, 70, 229, .2);
  }
  .search-box .icon { color: var(--brand1); display: flex; }
  .search-box .icon svg { width: 22px; height: 22px; }
  .search-box input {
    flex: 1; border: none; outline: none; font-size: 16px; font-weight: 600;
    color: var(--txt); background: transparent; min-width: 0;
  }
  .search-box input::placeholder { color: var(--txt3); }
  .search-box .clear {
    width: 28px; height: 28px; border-radius: 50%; background: #f1f5f9; color: var(--txt3);
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .12s ease;
    border: none; padding: 0;
  }
  .search-box .clear:active { background: #e2e8f0; }
  .search-box .clear svg { width: 14px; height: 14px; }
  .chips-wrap { position: relative; padding: 8px 0 0; }
  .chips { display: flex; gap: 6px; padding: 0 10px; overflow-x: auto; scrollbar-width: none; cursor: grab; }
  .chips::-webkit-scrollbar { display: none; }
  .chips.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
  .chip-fade {
    position: absolute; top: 8px; bottom: 0; width: 24px; pointer-events: none;
    opacity: 0; transition: opacity .25s ease; z-index: 2;
  }
  .chip-fade.left { left: 0; background: linear-gradient(90deg, var(--bg) 10%, rgba(248, 250, 252, 0)); }
  .chip-fade.right { right: 0; background: linear-gradient(270deg, var(--bg) 10%, rgba(248, 250, 252, 0)); }
  .chip-fade.show { opacity: 1; }
  .chip {
    flex: 0 0 auto; padding: 7px 12px; border-radius: 999px; background: var(--card);
    border: 1.5px solid var(--line2); font-size: 13px; font-weight: 700; color: var(--txt2);
    cursor: pointer; white-space: nowrap; box-shadow: var(--sh-sm); transition: transform .12s ease;
  }
  .chip:active { transform: scale(.96); }
  .chip.on {
    background: linear-gradient(135deg, var(--brand1), var(--brand2)); border-color: transparent;
    color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, .25);
  }
  .search-hint { padding: 8px 18px 10px; font-size: 13px; color: var(--txt3); font-weight: 500; }
  /* 固定头部内的提示/状态条（search-wrap 已是 sticky） */
  .search-wrap .search-hint { padding: 8px 2px 2px; }
  .search-wrap .syncbar { margin: 4px 0 2px; }
  /* 已盘清单固定头部：汇总 + 同步状态 + 已提交横幅固定，仅列表滚动 */
  .list-head { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 0 0 8px; }
  /* 多人同步校对状态条（盘点页 + 已盘清单页） */
  .syncbar {
    margin: 2px 10px 4px; padding: 6px 10px; border-radius: 10px;
    font-size: 12px; font-weight: 700; color: var(--txt2);
    background: var(--card); border: 1px solid var(--line);
    display: flex; align-items: center; gap: 8px;
  }
  .syncbar .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
  .syncbar.ok .dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
  .syncbar.syncing .dot { background: #f59e0b; animation: pulseDot 1s ease infinite; }
  .syncbar.offline .dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
  .syncbar .info { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .syncbar .info b { color: var(--txt); }
  @keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

  /* 结果行 —— 手机端更紧凑 */
  .row {
    background: var(--card); margin: 6px 10px; border-radius: 12px;
    padding: 10px 8px 10px 12px; display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--line); box-shadow: var(--sh-card);
  }
  .row-info { flex: 1; min-width: 0; }
  .row-name { font-size: 15px; font-weight: 800; line-height: 1.3; word-break: break-all; }
  /* 规格信息：编码 / 颜色 / 尺寸 / 厘米分色标签 */
  .row-spec {
    display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; align-items: center;
  }
  .meta-chip {
    display: inline-flex; align-items: center; max-width: 100%;
    padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700;
    line-height: 1.35; word-break: break-all; letter-spacing: .01em;
  }
  .meta-code { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; }
  .meta-spec1 { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
  .meta-spec2 { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
  .meta-cm { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; font-variant-numeric: tabular-nums; }
  .meta-unit { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
  .row-head { display: flex; align-items: flex-start; gap: 5px; }
  .row-head .row-name { flex: 1; min-width: 0; }
  .tag {
    flex: 0 0 auto; display: inline-flex; align-items: center; margin-top: 1px;
    padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 800; line-height: 1.4;
  }
  .tag-done { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
  .tag-raw { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
  /* 多人同店协作盘点：淡红 = 已盘过（本次+最近提交+同事在盘）；红色 = 争议暂存 */
  .row-hot { background: #fef2f2; border-color: #fecaca; }
  .row-disputed { background: #fee2e2; border-color: #f87171; }
  .row-flash { animation: hotFlash 1.4s ease; }
  .tag-disputed { background: #dc2626; color: #fff; border: none; }
  .dialog-top { z-index: 150; }
  @keyframes hotFlash {
    0% { background: #fee2e2; box-shadow: 0 0 0 4px rgba(254, 202, 202, .45); }
    100% { background: #fef2f2; box-shadow: none; }
  }
  .stepper { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
  .step {
    width: 40px; height: 40px; border-radius: 11px; border: none;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; line-height: 1;
    transition: transform .08s ease, filter .15s ease, background .15s ease;
    -webkit-appearance: none; appearance: none; padding: 0; flex-shrink: 0;
  }
  .step svg { width: 18px; height: 18px; display: block; pointer-events: none; }
  /* 点击反馈动效：按钮弹性 + 数字跳动 + 加号光晕 */
  .step.pop { animation: stepPop .22s cubic-bezier(.2, .9, .3, 1.4); }
  @keyframes stepPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); }
    100% { transform: scale(1); }
  }
  .step-num.bump { animation: numBump .32s cubic-bezier(.2, .9, .3, 1.3); }
  @keyframes numBump {
    0% { transform: scale(1); }
    35% { transform: scale(1.3); }
    70% { transform: scale(.94); }
    100% { transform: scale(1); }
  }
  .step.plus.flash {
    animation: plusFlash .32s ease;
    box-shadow: 0 3px 8px rgba(22, 163, 74, .28);
  }
  @keyframes plusFlash {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .45), 0 3px 8px rgba(22, 163, 74, .28); }
    100% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0), 0 3px 8px rgba(22, 163, 74, .28); }
  }
  .step.minus.flash { box-shadow: 0 0 0 7px rgba(100, 116, 139, 0); }
  .step.minus.flash { animation: minusFlash .32s ease; }
  @keyframes minusFlash {
    0% { box-shadow: 0 0 0 0 rgba(100, 116, 139, .35), 0 2px 6px rgba(15, 23, 42, .12); }
    100% { box-shadow: 0 0 0 8px rgba(100, 116, 139, 0), 0 2px 6px rgba(15, 23, 42, .12); }
  }
  .step.minus { background: #f1f5f9; color: #374151; border: 1.5px solid var(--line2); }
  .step.minus:active { background: #e2e8f0; transform: scale(.94); }
  .step.plus {
    background: linear-gradient(135deg, var(--green2), var(--green)); color: #fff;
    box-shadow: 0 3px 8px rgba(22, 163, 74, .28);
  }
  .step.plus:active { filter: brightness(.94); transform: scale(.94); }
  .step-num {
    min-width: 44px; height: 40px; border-radius: 11px; border: 1.5px solid var(--line2);
    background: #f8fafc; font-size: 20px; font-weight: 900; display: inline-flex;
    align-items: center; justify-content: center; cursor: pointer; color: var(--txt);
    padding: 0 3px; font-variant-numeric: tabular-nums; transition: transform .1s ease;
    -webkit-appearance: none; appearance: none; flex-shrink: 0;
  }
  .step-num.done { background: #f0fdf4; border-color: #86efac; color: var(--green-dark); }
  .step-num.zero { color: var(--txt2); }
  .step-num.empty { color: var(--txt3); border-style: dashed; background: var(--card); font-size: 12px; font-weight: 700; }
  .step-num:active { transform: scale(.94); }

  .empty-state { text-align: center; padding: 44px 24px; color: var(--txt2); }
  .empty-state .big {
    width: 116px; height: 116px; margin: 0 auto 18px; border-radius: 34px;
    background: #eef2ff; display: flex; align-items: center; justify-content: center; color: #a5b4fc;
  }
  .empty-state .big svg { width: 60px; height: 60px; }
  .empty-state p { font-size: 16px; font-weight: 700; line-height: 1.7; color: var(--txt2); }
  .empty-state small { display: block; margin-top: 6px; font-size: 13px; color: var(--txt3); }

  /* 底部 Tab */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    display: flex; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px); padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 18px rgba(15, 23, 42, .05);
  }
  .tabitem {
    flex: 1; padding: 7px 0 9px; text-align: center; font-size: 12px; font-weight: 800;
    color: var(--txt3); cursor: pointer; position: relative; transition: color .15s ease;
    background: transparent; border: none;
  }
  .tabitem .ico { width: 22px; height: 22px; margin: 0 auto 2px; display: block; }
  .tabitem .ico svg { width: 22px; height: 22px; }
  .tabitem.on { color: var(--brand1); }
  .tabitem.logout { color: #dc2626; }
  .tabitem.logout:active { color: #b91c1c; }
  .badge {
    position: absolute; top: 0; left: calc(50% + 8px); min-width: 18px; height: 18px;
    border-radius: 999px; background: linear-gradient(135deg, var(--red2), var(--red)); color: #fff;
    font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center;
    padding: 0 5px; box-shadow: 0 3px 8px rgba(220, 38, 38, .35); line-height: 1;
  }
  .badge.hidden { display: none; }

  /* 已盘清单 */
  .summary-bar {
    margin: 10px 10px 8px; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 800;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff); border: 1.5px solid #c7d2fe; color: var(--txt);
    display: flex; justify-content: space-between; align-items: center; box-shadow: var(--sh-md);
  }
  .summary-bar b { color: var(--brand1); font-size: 16px; }
  .submitted-banner {
    margin: 0 10px 8px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 700;
    background: #fffbeb; border: 1.5px solid #fcd34d; color: #92400e; line-height: 1.5;
    box-shadow: var(--sh-sm);
  }
  .del-btn {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; border: none;
    background: #fef2f2; color: var(--red); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: all .12s ease;
    -webkit-appearance: none; appearance: none; padding: 0;
  }
  .del-btn svg { width: 18px; height: 18px; display: block; pointer-events: none; }
  .del-btn:active { background: #fee2e2; transform: scale(.94); }
  .submit-area { padding: 8px 10px calc(76px + env(safe-area-inset-bottom)); background: var(--bg); }
  .submit-btn {
    min-height: 48px; font-size: 17px; border-radius: 14px;
    background: linear-gradient(135deg, var(--green2), var(--green));
    box-shadow: 0 6px 16px rgba(22, 163, 74, .3);
  }
  .submit-btn:active { filter: brightness(.94); }
  .submit-btn[disabled] { background: #c7d2fe; color: #eef2ff; box-shadow: none; }
  .submit-note { text-align: center; font-size: 12px; color: var(--txt3); margin-top: 9px; }

  /* 数字大键盘 */
  .mask {
    position: fixed; inset: 0; z-index: 100; background: rgba(2, 6, 23, .55);
    display: flex; align-items: flex-end; justify-content: center;
    animation: fadeIn .18s ease; backdrop-filter: blur(3px);
  }
  .numpad-sheet {
    width: 100%; max-width: 640px; background: var(--card); border-radius: 26px 26px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 40px rgba(2, 6, 23, .25);
    animation: slideUp .26s cubic-bezier(.2, .8, .25, 1);
  }
  .numpad-title { font-size: 16px; font-weight: 800; text-align: center; line-height: 1.4; margin-bottom: 2px; }
  .numpad-title small { display: block; font-size: 12.5px; color: var(--txt2); font-weight: 600; }
  .numpad-cur {
    text-align: center; font-size: 44px; font-weight: 900; color: var(--brand1);
    min-height: 52px; line-height: 1.15; margin: 4px 0 10px; font-variant-numeric: tabular-nums;
  }
  .numpad-cur.empty { color: var(--txt3); font-size: 24px; font-weight: 700; padding-top: 18px; }
  .numpad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .nkey {
    height: 52px; width: 100%; border-radius: 14px; border: 0; background: #f1f5f9;
    font-size: 24px; font-weight: 800; color: var(--txt); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    box-shadow: var(--sh-sm); transition: transform .07s ease, background .12s ease, filter .12s ease;
    -webkit-appearance: none; appearance: none; margin: 0; padding: 0; line-height: 1;
  }
  .nkey:active { background: #e2e8f0; transform: translateY(1.5px) scale(.98); }
  .nkey svg { width: 22px; height: 22px; display: block; flex-shrink: 0; pointer-events: none; }
  .nkey[data-k="clear"] { font-size: 16px; color: var(--txt2); }
  .numpad-actions {
    display: flex; gap: 8px; margin-top: 10px;
  }
  .numpad-actions .nkey {
    flex: 1; min-width: 0; height: 50px; font-size: 17px; font-weight: 800;
  }
  .nkey.cancel {
    background: #fff !important;
    border: 1.5px solid var(--line2) !important;
    color: var(--txt2) !important;
    box-shadow: none;
  }
  .nkey.cancel:active { background: #f7f7f9 !important; }
  .nkey.ok {
    background: linear-gradient(135deg, var(--green2), var(--green)) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: 0 5px 14px rgba(22, 163, 74, .32);
  }
  .nkey.ok:active { filter: brightness(.94); transform: translateY(1.5px) scale(.98); }
  .numpad-help { text-align: center; font-size: 12px; color: var(--txt3); margin-top: 10px; line-height: 1.45; }

  /* 弹窗 */
  .dialog {
    width: calc(100% - 52px); max-width: 420px; margin: auto; background: var(--card);
    border-radius: 22px; padding: 26px 22px 20px; text-align: center; box-shadow: var(--sh-lg);
    animation: pop .22s cubic-bezier(.2, .9, .3, 1.2);
  }
  .dialog-title { font-size: 20px; font-weight: 900; margin-bottom: 8px; }
  .dialog-body { font-size: 15.5px; color: var(--txt2); line-height: 1.75; margin-bottom: 20px; }
  .dialog-body b { color: var(--txt); }
  .dialog-btns { display: flex; gap: 10px; }
  .dbtn {
    flex: 1; min-height: 52px; border-radius: 15px; border: none; font-size: 17px;
    font-weight: 800; cursor: pointer; transition: transform .08s ease, filter .15s ease;
  }
  .dbtn:active { transform: scale(.97); }
  .dbtn.ghost { background: #f1f5f9; color: var(--txt); }
  .dbtn.ghost:active { background: #e2e8f0; }
  .dbtn.danger { background: linear-gradient(135deg, var(--red2), var(--red)); color: #fff; box-shadow: 0 5px 14px rgba(220, 38, 38, .28); }
  .dbtn.ok { background: linear-gradient(135deg, var(--green2), var(--green)); color: #fff; box-shadow: 0 5px 14px rgba(22, 163, 74, .28); }
  /* 改为0弹窗：盘错=白底红字（带过渡），暂存=红底白字 */
  .dbtn.plain {
    background: #ffffff;
    color: #b91c1c;
    border: 1.5px solid #fecaca;
    box-shadow: var(--sh-sm);
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .08s ease;
  }
  .dbtn.plain:active { background: #fef2f2; border-color: #fca5a5; }
  .dbtn.red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 5px 14px rgba(220, 38, 38, .3);
  }
  .dbtn.red:active { filter: brightness(.94); }

  /* 提交成功页 */
  #view-success {
    min-height: 100%; display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 30px; text-align: center; animation: fadeIn .25s ease;
  }
  .ok-icon {
    width: 104px; height: 104px; border-radius: 50%;
    background: linear-gradient(135deg, var(--green2), var(--green)); color: #fff;
    display: flex; align-items: center; justify-content: center; margin-bottom: 24px;
    box-shadow: 0 16px 36px rgba(22, 163, 74, .35);
    animation: pop .35s cubic-bezier(.2, .9, .3, 1.25);
  }
  .ok-icon svg { width: 56px; height: 56px; }
  #view-success h2 { font-size: 27px; font-weight: 900; margin-bottom: 10px; }
  #view-success p { font-size: 16px; color: var(--txt2); line-height: 1.85; margin-bottom: 30px; }
  #view-success .btn-big { max-width: 320px; margin-bottom: 10px; }
  #view-success .btn-ghost { background: #f1f5f9; color: var(--txt); box-shadow: none; }
  #view-success .btn-ghost:active { background: #e2e8f0; }

  .toast {
    position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
    background: rgba(15, 23, 42, .92); color: #fff; font-size: 14px; font-weight: 700;
    padding: 11px 18px; border-radius: 999px; z-index: 300; max-width: 86%;
    text-align: center; box-shadow: var(--sh-lg); backdrop-filter: blur(6px);
    animation: fadeIn .18s ease;
  }

  /* ===== 动效 ===== */
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  @keyframes pop { 0% { transform: scale(.55); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

  /* ===== 柔和过渡 ===== */
  .tab-panel { scroll-behavior: smooth; }
  .search-wrap { box-shadow: 0 10px 18px -14px rgba(15, 23, 42, .3); }
  .chips { scroll-snap-type: x proximity; }
  .chips .chip { scroll-snap-align: start; }
  .panel-in { animation: panelIn .3s cubic-bezier(.25, .8, .3, 1) both; }
  .panel-out { animation: panelOut .18s ease both; }
  .list-fade { opacity: 0; transition: opacity .12s ease; }
  .row-in { animation: rowIn .26s cubic-bezier(.2, .8, .3, 1) both; }
  .mask.out { animation: fadeOut .18s ease both; }
  .numpad-sheet.out { animation: slideDown .18s ease both; }
  .dialog.out { animation: popOut .16s ease both; }
  @keyframes panelIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes panelOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-8px); } }
  @keyframes rowIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes fadeOut { to { opacity: 0; } }
  @keyframes slideDown { to { transform: translateY(100%); } }
  @keyframes popOut { to { opacity: 0; transform: scale(.9); } }

  /* ===== 主题切换按钮（顶部右侧，自动保存左侧） ===== */
  .theme-toggle {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; border: none; cursor: pointer;
    background: #eef2ff; color: #4f46e5; display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s ease, color .2s ease, transform .1s ease;
    -webkit-appearance: none; appearance: none; padding: 0;
  }
  .theme-toggle:active { transform: scale(.9); }
  .theme-toggle svg { width: 18px; height: 18px; display: block; pointer-events: none; }
  .theme-toggle .ico-moon { display: none; }

  /* ===== 奶白 + 暗金 暗色主题 ===== */
  body.dark {
    --brand1: #d4af37;
    --brand2: #b8860b;
    --green: #d4af37; --green2: #e6c158; --green-dark: #c9a227;
    --bg: #1d1913;
    --card: #272119;
    --line: #3a3224;
    --line2: #4a4030;
    --txt: #f5eeda;
    --txt2: #c6bba1;
    --txt3: #8d8268;
    --sh-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --sh-md: 0 4px 14px rgba(0, 0, 0, .35);
    --sh-card: 0 8px 20px rgba(0, 0, 0, .4), 0 2px 6px rgba(0, 0, 0, .25);
    --sh-lg: 0 16px 40px rgba(0, 0, 0, .5);
  }
  body.dark .theme-toggle { background: #3a3224; color: #d4af37; }
  body.dark .theme-toggle .ico-moon { display: block; }
  body.dark .theme-toggle .ico-sun { display: none; }
  /* 白底/浅色面硬编码 → 暖暗面（奶白字 + 暗金） */
  body.dark .app-header { background: #201b14; box-shadow: none; }
  body.dark .header-avatar { box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
  body.dark .save-status { background: #2f2a1e; color: #d4af37; }
  body.dark .save-status::before { background: #d4af37; box-shadow: 0 0 0 3px rgba(212, 175, 55, .25); }
  body.dark .store-trigger:active { background: #2b251c; }
  body.dark .store-trigger.open { border-color: var(--brand1); box-shadow: 0 0 0 4px rgba(212, 175, 55, .15); }
  body.dark .picker-item .store-num { background: #3a3324; color: #e6c158; }
  body.dark .picker-item.picked { background: #38301f; color: #d4af37; }
  body.dark .picker-item .check { background: #2f2a1e; }
  body.dark .search-box:focus-within {
    border-color: var(--brand2);
    box-shadow:
      0 0 0 4px rgba(212, 175, 55, .16),
      0 0 20px rgba(212, 175, 55, .2),
      0 0 44px rgba(184, 134, 11, .14),
      0 8px 22px rgba(0, 0, 0, .35);
  }
  body.dark .search-box .clear { background: #332c20; }
  body.dark .search-box .clear:active { background: #3a3224; }
  body.dark .chip-fade.left { background: linear-gradient(90deg, var(--bg) 10%, rgba(29, 25, 19, 0)); }
  body.dark .chip-fade.right { background: linear-gradient(270deg, var(--bg) 10%, rgba(29, 25, 19, 0)); }
  body.dark .meta-code { background: #3a3324; color: #e6c158; border-color: #5a4f33; }
  body.dark .meta-spec1 { background: #22302a; color: #8fd9b0; border-color: #3a4a3f; }
  body.dark .meta-spec2 { background: #33281c; color: #f2b072; border-color: #5a4530; }
  body.dark .meta-cm { background: #322d26; color: #d4af37; border-color: #4a4030; }
  body.dark .meta-unit { background: #332c20; color: #b8ad94; border-color: #4a4030; }
  body.dark .tag-done { background: #2f2a1e; color: #e6c158; border-color: #5a4f33; }
  body.dark .tag-raw { background: #3a2f16; color: #e6c158; border-color: #6b5a2e; }
  body.dark .tag-disputed { background: #8a2420; }
  body.dark .row-hot { background: rgba(239, 68, 68, .18); border-color: #f87171; }
  body.dark .row-disputed { background: #3a2420; border-color: #8a4a42; }
  body.dark .step.minus { background: #332c20; color: #d8cfb8; }
  body.dark .step.minus:active { background: #3a3224; }
  body.dark .step-num { background: #2b251c; }
  body.dark .step-num.done { background: #38301f; border-color: #6b5a2e; color: #e6c158; }
  body.dark .step.plus.flash { animation: plusFlashGold .32s ease; }
  @keyframes plusFlashGold {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, .5), 0 3px 8px rgba(0, 0, 0, .3); }
    100% { box-shadow: 0 0 0 9px rgba(212, 175, 55, 0), 0 3px 8px rgba(0, 0, 0, .3); }
  }
  body.dark .summary-bar { background: linear-gradient(135deg, #2f2a1e, #3a3324); border-color: #5a4f33; }
  body.dark .submitted-banner { background: #3a2f16; border-color: #6b5a2e; color: #e6c158; }
  body.dark .syncbar.ok .dot { background: #d4af37; box-shadow: 0 0 0 3px rgba(212, 175, 55, .2); }
  body.dark .syncbar.offline .dot { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .18); }
  body.dark .tabbar { background: rgba(32, 27, 20, .95); }
  body.dark .tabitem.logout { color: #f87171; }
  body.dark .tabitem.logout:active { color: #fca5a5; }
  body.dark .badge { box-shadow: 0 3px 8px rgba(0, 0, 0, .4); }
  body.dark .empty-state .big { background: #2f2a1e; color: #d4af37; }
  body.dark .nkey { background: #332c20; }
  body.dark .nkey:active { background: #3a3224; }
  body.dark .nkey.cancel { background: #272119 !important; color: var(--txt2) !important; border-color: var(--line2) !important; }
  body.dark .nkey.cancel:active { background: #2b251c !important; }
  body.dark .dbtn.ghost { background: #332c20; color: var(--txt); }
  body.dark .dbtn.ghost:active { background: #3a3224; }
  body.dark .dbtn.plain { background: #2b251c; color: #f0a8a8; border-color: #6b3a34; }
  body.dark .dbtn.plain:active { background: #33241f; border-color: #8a4a42; }
  body.dark .del-btn { background: #33241f; }
  body.dark .del-btn:active { background: #3a2420; }
  body.dark .toast { background: rgba(0, 0, 0, .85); }
  body.dark .phone-req-panel { background: #3a2f16; border-color: #8a7430; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
  body.dark .phone-req-panel .req-store { color: #e6c158; }
  body.dark .phone-req-panel .login-input { border-color: #6b5a2e; }
  body.dark #view-success .btn-ghost { background: #332c20; color: var(--txt); }
  body.dark .login-input:focus { border-color: var(--brand1); box-shadow: 0 0 0 4px rgba(212, 175, 55, .12); }
  body.dark :focus-visible { outline-color: rgba(212, 175, 55, .4); }
  body.dark .btn-big[disabled], body.dark .submit-btn[disabled] { background: #3a3324; color: #6b5f3e; }
  body.dark .mask { background: rgba(0, 0, 0, .62); }
  body.dark .search-wrap { box-shadow: 0 10px 18px -14px rgba(0, 0, 0, .5); }
