:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --border: #dce3ec;
  --primary: #1262d6;
  --primary-dark: #0e4fb1;
  --ok: #0f8a4b;
  --error: #c62828;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI", sans-serif;
  letter-spacing: 0;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px calc(124px + env(safe-area-inset-bottom));
}

.topbar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 10px;
  margin-bottom: 16px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.icon-btn {
  min-width: 38px;
  min-height: 34px;
  padding: 0 9px;
  border-color: #bcd3ff;
  background: #edf4ff;
  color: var(--primary);
  font-size: 13px;
}

.refresh-btn {
  min-width: 48px;
  border-color: #b7e2c9;
  background: #eaf8ef;
  color: var(--ok);
}

.refresh-btn.refreshing {
  border-color: #bcd3ff;
  background: #edf4ff;
  color: var(--primary);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
  word-break: keep-all;
}

.photo-mode .topbar {
  margin-bottom: 8px;
}

.photo-mode .eyebrow {
  margin-bottom: 2px;
}

.photo-mode h1 {
  font-size: 24px;
  line-height: 1.1;
}

.photo-mode .section-head {
  margin-bottom: 10px;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid #f1c9c9;
  border-radius: 999px;
  background: #fff1f1;
  color: var(--error);
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 800;
}

.status-pill.ok {
  border-color: #b7e2c9;
  background: #eaf8ef;
  color: var(--ok);
}

.status-pill.warn {
  border-color: #f0c979;
  background: #fff8e6;
  color: #9a6500;
}

button {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
}

button:active { transform: translateY(1px); }
button:disabled {
  border-color: #d7deea;
  background: #e7edf5;
  color: #8794a7;
  opacity: 1;
}

.ghost-btn {
  width: 100%;
  margin-top: 8px;
  background: #eef2f7;
}

.feature-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.primary-entry { margin-bottom: 16px; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(6px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  width: min(calc(100% - 32px), 390px);
  transform: translateX(-50%);
  border: 1px solid rgba(214, 224, 237, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  overflow: hidden;
  --nav-x: 6px;
  --nav-w: calc((100% - 16px) / 3);
}

.nav-indicator {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 0;
  width: var(--nav-w);
  height: 52px;
  border-radius: 17px;
  background: rgba(18, 98, 214, 0.1);
  transform: translateX(var(--nav-x)) translateY(-50%);
  transition:
    transform 320ms cubic-bezier(0.2, 0.9, 0.2, 1),
    width 320ms cubic-bezier(0.2, 0.9, 0.2, 1),
    height 220ms ease,
    background-color 220ms ease,
    border-radius 220ms ease;
  box-shadow: inset 0 0 0 1px rgba(18, 98, 214, 0.06);
}

.bottom-nav-btn {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 52px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  box-shadow: none;
  transition:
    color 220ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.bottom-nav-btn::before {
  content: "";
  display: block;
  width: 22px;
  height: 18px;
  color: currentColor;
  opacity: 0.92;
}

#navOrders::before {
  border: 2px solid currentColor;
  border-radius: 5px;
  box-shadow: inset 0 5px 0 rgba(100, 116, 139, 0.16);
}

#navRecords::before {
  border: 2px solid currentColor;
  border-radius: 999px;
  box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 7px currentColor;
}

.bottom-nav-btn strong {
  font-size: 12px;
  line-height: 1;
}

.nav-dot {
  display: none;
}

.bottom-nav-btn.active {
  color: var(--primary);
  transform: none;
}

.bottom-nav-btn.active .nav-dot {
  background: var(--primary);
}

.bottom-camera-btn {
  position: relative;
  z-index: 1;
  justify-self: center;
  align-self: center;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  width: 100%;
  height: 52px;
  min-height: 52px;
  margin-top: 0;
  margin-bottom: 0;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #2f7bff, #1464d2);
  color: #fff;
  font-size: 10px;
  box-shadow: 0 4px 12px rgba(20, 100, 210, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition:
    color 220ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.bottom-camera-btn strong {
  font-size: 12px;
  line-height: 1;
}

.bottom-camera-btn.active {
  background: linear-gradient(180deg, #2f7bff, #1464d2);
  color: #fff;
  transform: none;
}

.bottom-nav.nav-state-photo .nav-indicator {
  border-radius: 16px;
  background: rgba(20, 100, 210, 0.12);
  height: 52px;
}

.camera-glyph {
  position: relative;
  width: 22px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 6px;
}

.camera-glyph::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -7px;
  width: 9px;
  height: 5px;
  border-radius: 4px 4px 0 0;
  background: currentColor;
}

.camera-glyph::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  border: 2px solid currentColor;
  border-radius: 999px;
}

.search-input,
.sort-select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 750;
}

.search-input {
  margin-bottom: 10px;
  padding: 0 12px;
}

.sort-select {
  margin-bottom: 12px;
  padding: 0 10px;
}

.date-strip {
  display: flex;
  gap: 7px;
  margin: 0 0 12px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.date-chip {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 84px;
  min-height: 44px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.date-chip b,
.date-chip span {
  display: block;
  line-height: 1.15;
}

.date-chip span {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.82;
}

.date-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.filter-chip {
  min-width: 0;
  min-height: 40px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 13px;
}

.filter-chip.active {
  border-color: var(--primary);
  background: #e9f1ff;
  color: var(--primary);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.small-btn {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.feature-tab.active,
.size-btn.active,
.confirm-btn {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.view { display: none; }
.view.active { display: block; animation: viewFadeIn 220ms ease; }

@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.watermark-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  margin: -4px 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  padding: 9px 10px;
  color: #35506f;
  font-size: 12px;
  font-weight: 760;
}

.watermark-note strong {
  border-radius: 22px;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 950;
}

.watermark-note span {
  min-width: 0;
  line-height: 1.35;
}

.empty-panel,
.photo-picker {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

.order-list {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.order-list.grid-mode {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.order-skeleton { display: grid; gap: 10px; }
.skeleton-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.skeleton-thumb,
.skeleton-lines i {
  background: linear-gradient(100deg, #eef2f7 40%, #f8fafc 50%, #eef2f7 60%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.2s ease-in-out infinite;
}
.skeleton-thumb {
  width: 92px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
}
.skeleton-lines { display: grid; align-content: center; gap: 10px; }
.skeleton-lines i { display: block; height: 14px; border-radius: 6px; }
.skeleton-lines i:nth-child(1) { width: 55%; }
.skeleton-lines i:nth-child(2) { width: 80%; }
.skeleton-lines i:nth-child(3) { width: 40%; }

@keyframes skeletonShimmer {
  from { background-position: 180% 0; }
  to { background-position: -40% 0; }
}

.order-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  padding: 11px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.order-card.uploaded-card {
  border-color: #b7e2c9;
  background: linear-gradient(180deg, #f7fff9, #ffffff);
}

.list-mode .order-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.list-mode .order-card .order-main,
.list-mode .order-card .order-badges {
  grid-column: 2;
}

.list-mode .order-card .order-sections {
  grid-column: 1 / -1;
}

.list-mode .order-card .preview-box {
  grid-row: 1 / span 3;
}

.grid-mode .order-card {
  padding: 9px;
}

.grid-mode .order-sections section,
.grid-mode .detail-block {
  display: none;
}

.grid-mode .order-main strong {
  font-size: 18px;
}

.grid-mode .order-main span {
  font-size: 12px;
}

.preview-box {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: zoom-in;
  position: relative;
}

.preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 160ms ease;
}

.preview-box img.loaded {
  opacity: 1;
}

.preview-loading {
  background:
    linear-gradient(90deg, rgba(226, 232, 240, 0.45), rgba(248, 250, 252, 0.92), rgba(226, 232, 240, 0.45)),
    #f8fafc;
  background-size: 220% 100%;
  animation: previewShimmer 1.15s linear infinite;
}

.preview-empty {
  padding: 8px;
  background: linear-gradient(135deg, #eef4fb, #ffffff);
  text-align: center;
  word-break: break-word;
}

.preview-error {
  border-color: #f1c9c9;
  background: #fff8f8;
  color: var(--error);
}

.preview-box span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  white-space: nowrap;
}

.preview-mark {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(100, 116, 139, 0.18);
  border-top-color: rgba(18, 98, 214, 0.58);
  border-radius: 999px;
  background: transparent !important;
  padding: 0 !important;
  animation: previewSpin 900ms linear infinite;
}

.preview-box img.loaded + span {
  display: none;
}

.upload-search-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.upload-search-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.upload-search-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

@media (min-width: 900px) {
  .upload-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  body {
    background:
      linear-gradient(180deg, #f8fafc 0, #eef3f8 280px, #f4f6f8 100%);
  }

  .app-shell {
    width: min(100% - 48px, 1180px);
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(360px, 620px);
    grid-template-areas:
      "top nav"
      "content content";
    align-items: start;
    gap: 18px;
    padding: 28px 0 42px;
  }

  .topbar {
    grid-area: top;
    display: flex;
    position: sticky;
    top: 0;
    z-index: 12;
    margin: 0;
    border: 1px solid rgba(220, 227, 236, 0.82);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    padding: 14px 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(16px);
  }

  h1 {
    font-size: 30px;
  }

  .view.active {
    display: block;
    grid-area: content;
  }

  #ordersView.view.active {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    align-items: start;
    column-gap: 18px;
  }

  #ordersView .section-head {
    grid-column: 1 / -1;
  }

  #ordersView .search-input,
  #ordersView .filter-row,
  #ordersView .sort-select,
  #ordersView .date-strip,
  #ordersView .uncoded-block {
    grid-column: 1;
  }

  #ordersView .order-list {
    grid-column: 2;
    grid-row: 2 / span 12;
    margin-bottom: 0;
  }

  .search-input,
  .sort-select,
  .filter-row,
  .date-strip {
    position: sticky;
    z-index: 5;
  }

  #ordersView .search-input { top: 98px; }
  #ordersView .filter-row { top: 154px; }
  #ordersView .sort-select { top: 210px; }
  #ordersView .date-strip {
    top: 268px;
    display: grid;
    overflow: visible;
  }

  .filter-row {
    grid-template-columns: 1fr 1fr;
  }

  .date-chip {
    width: 100%;
    justify-content: start;
    place-items: center start;
    border-radius: 10px;
  }

  .order-list.list-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .order-list.grid-mode {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .list-mode .order-card {
    grid-template-columns: 110px minmax(0, 1fr);
    min-height: 190px;
  }

  .preview-box {
    border-radius: 10px;
  }

  #photoView.view.active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 16px;
  }

  #photoView .section-head,
  #photoView .watermark-note,
  #photoView .trade-pair,
  #photoView .confirm-btn,
  #photoView .status-line {
    grid-column: 1;
  }

  #photoView .queue-panel {
    grid-column: 2;
    grid-row: 1 / span 5;
    position: sticky;
    top: 98px;
    margin: 0;
  }

  .trade-pair {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .photo-picker {
    min-height: 340px;
  }

  #recordsView.view.active {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
  }

  #uploadRecords.queue-list {
    display: block;
  }

  #uploadRecords .record-day {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
    margin-bottom: 16px;
  }

  #uploadRecords .record-day-title {
    grid-column: 1 / -1;
    margin-top: 2px;
  }

  #uploadRecords .record-item {
    min-width: 0;
  }

  #uploadRecords .record-thumbs img,
  #uploadRecords .record-thumbs div > span {
    height: 112px;
  }

  #uploadRecords .record-thumbs div {
    min-height: 112px;
  }

  .bottom-nav {
    grid-area: nav;
    position: sticky;
    top: 28px;
    z-index: 11;
    left: auto;
    transform: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    margin: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    padding: 7px;
  }

  .bottom-camera-btn {
    width: auto;
    height: 46px;
    min-height: 46px;
    border-radius: 999px;
  }

  .bottom-camera-btn .camera-glyph {
    width: 18px;
    height: 18px;
  }

  .bottom-nav-btn {
    min-height: 46px;
    grid-auto-flow: column;
    grid-template-columns: auto auto;
    gap: 7px;
  }

  .bottom-nav-btn strong,
  .bottom-camera-btn strong {
    font-size: 13px;
  }
}

@keyframes previewShimmer {
  from { background-position: 180% 0; }
  to { background-position: -40% 0; }
}

@keyframes previewSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.uncoded-card {
  border-color: #f1c9c9;
  background: #fffafa;
}

.order-main strong,
.order-main span {
  display: block;
  min-width: 0;
}

.order-main strong {
  margin-bottom: 5px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
}

.order-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.photo-chip {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: #eaf8ef;
  color: var(--ok);
  font-size: 12px;
}

.photo-chip:hover { background: #d8f1e2; }

.uploaded-card .photo-chip {
  border-color: #b7e2c9;
  background: #0f8a4b;
  color: #fff;
}

.order-main span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.order-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.age-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 8px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}

.age-pill::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.age-fresh {
  border-color: #b7e2c9;
  background: #eaf8ef;
  color: var(--ok);
}

.age-warm {
  border-color: #ffdca8;
  background: #fff7e8;
  color: #b35c00;
}

.age-hot {
  border-color: #f3cdb0;
  background: #fdf3e8;
  color: #c2670a;
}

.age-unknown {
  border-color: #d7deea;
  background: #eef2f7;
  color: var(--muted);
}

.age-work {
  border-color: #bcd3ff;
  background: #edf4ff;
  color: var(--primary);
}

.age-done {
  border-color: #b7e2c9;
  background: #eaf8ef;
  color: var(--ok);
}

.order-sections {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.list-mode .order-sections {
  display: none;
}

.order-sections section {
  min-width: 0;
}

.order-sections h3 {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: #f5f8fb;
  padding: 5px 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  word-break: break-word;
}

.list-mode .info-chip {
  min-height: 27px;
  padding: 4px 7px;
  font-size: 12px;
}

.list-mode .info-chip b {
  font-size: 10px;
}

.info-chip b {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.detail-block {
  border: 0;
  border-radius: 8px;
  background: #f5f8fb;
  padding: 9px 10px;
}

.detail-block b,
.detail-block span {
  display: block;
}

.detail-block b {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.detail-block span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  word-break: break-word;
}

.order-fields {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.order-field {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  align-items: start;
}

.order-field b {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.order-field span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  word-break: break-word;
}

.uncoded-block {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.hidden { display: none !important; }


.trade-picker {
  aspect-ratio: 4 / 4.55;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(18, 98, 214, 0.08), rgba(15, 138, 75, 0.04)),
    #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.trade-picker:active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 98, 214, 0.12);
}

.trade-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.empty-panel {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
}

.empty-panel strong {
  color: var(--text);
  font-size: 22px;
}

.photo-picker {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: 12px;
}

.photo-picker::before {
  content: "";
  position: absolute;
  inset: 11px;
  z-index: 1;
  border: 2px dashed rgba(18, 98, 214, 0.28);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.photo-picker::after {
  content: "\70b9\8fd9\91cc\62cd\7167";
  position: absolute;
  left: 50%;
  top: 16px;
  z-index: 1;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  pointer-events: none;
}

.photo-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.photo-picker img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #101827;
}

.photo-picker img.ready { display: block; }

.photo-picker:has(img.ready)::after {
  content: "\70b9\56fe\5ba1\6838 / \91cd\62cd";
  color: var(--ok);
}

.photo-picker span {
  position: absolute;
  z-index: 2;
  inset: auto auto 18px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  padding: 9px 14px;
  font-size: 17px;
  font-weight: 900;
}

.trade-photo-state {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  border: 1px solid #d7e0ec;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.trade-photo-state.ready {
  border-color: #b7e2c9;
  background: #eaf8ef;
  color: var(--ok);
}

#photoView .confirm-btn {
  min-height: 58px;
  margin-top: 4px;
  font-size: 20px;
  border: 1px solid #dce6f2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  padding: 10px;
}

@keyframes trackPulse {
  0%, 100% {
    transform: perspective(560px) rotateX(0deg) scale(1);
    opacity: 0.72;
  }
  50% {
    transform: perspective(560px) rotateX(7deg) scale(0.965);
    opacity: 1;
  }
}

@keyframes scanLine {
  0%, 100% { transform: translateY(0); opacity: 0.28; }
  50% { transform: translateY(calc(100% + 180px)); opacity: 1; }
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.size-btn {
  min-width: 0;
  min-height: 56px;
  font-size: 18px;
}

.confirm-btn {
  width: 100%;
  min-height: 56px;
  font-size: 18px;
}

#tradeUpload:disabled {
  background: #dfe7f1;
  color: #718096;
}

.confirm-btn:not(:disabled):active { background: var(--primary-dark); }

.status-line {
  min-height: 24px;
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.status-line.ok { color: var(--ok); font-weight: 800; }
.status-line.error { color: var(--error); font-weight: 800; }
.status-line.busy { color: var(--primary); font-weight: 800; }

.live-stats {
  margin: 12px 0 14px;
  border: 1px solid #cfe0f5;
  border-radius: 12px;
  background: #f7fbff;
  padding: 10px;
}

.live-stats-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
}

.live-stats-head span {
  color: var(--muted);
  font-size: 11px;
}

.live-stats-grid {
  display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.cloud-attention {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(220, 38, 38, 0.28);
  border-radius: 12px;
  color: #991b1b;
  background: rgba(254, 226, 226, 0.72);
  font-weight: 800;
}

.live-stats-grid span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid #dbe7f4;
  border-radius: 8px;
  background: #fff;
  padding: 7px 5px;
  text-align: center;
  color: var(--primary);
  font-size: 16px;
  font-weight: 900;
}

.live-stats-grid b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.cloud-storage-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid #d8e4ef;
  border-radius: 10px;
  background: #fff;
  padding: 11px 12px;
}

.cloud-storage-copy,
.cloud-storage-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cloud-storage-copy strong {
  color: var(--navy);
  font-size: 12px;
}

.cloud-storage-copy span,
.cloud-storage-meta {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.cloud-storage-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf5;
  box-shadow: inset 0 1px 2px rgba(16, 36, 63, 0.08);
}

.cloud-storage-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f73e8, #32a6ee);
  transition: width 240ms ease;
}

.cloud-storage-card.warning .cloud-storage-track i {
  background: linear-gradient(90deg, #e59a19, #dc2626);
}

.record-recovered {
  border: 1px solid rgba(18, 146, 88, 0.22);
  border-radius: 8px;
  background: rgba(226, 248, 238, 0.78);
  padding: 7px 9px;
  color: #087443;
  font-size: 11px;
  font-weight: 850;
}

.queue-panel {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  padding: 12px;
}

.queue-title {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 900;
}

.queue-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-action-btn {
  min-height: 30px;
  border: 1px solid #c8d7eb;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  padding: 0 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.mini-action-btn:disabled {
  opacity: 0.45;
}

.queue-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.queue-empty {
  color: var(--muted);
  font-size: 14px;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(64px, auto);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.queue-main { min-width: 0; overflow: hidden; }

.queue-main strong,
.queue-main span {
  display: block;
  min-width: 0;
}

.queue-main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-state {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 0;
  max-width: 96px;
}

.queue-state em {
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.queue-state button {
  min-height: 30px;
  border-color: #f1c9c9;
  background: #fff1f1;
  color: var(--error);
  padding: 0 10px;
  font-size: 12px;
}

.queue-item.uploading {
  border-color: #bcd3ff;
  background: #edf4ff;
}

.queue-item.error {
  border-color: #f1c9c9;
  background: #fff8f8;
}

.local-pending-records {
  border: 1px dashed #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  padding: 9px;
}

.local-pending-item {
  background: #ffffff;
}

.local-pending-item.error {
  border-color: #fecaca;
  background: #fff7f7;
}

.queue-item.uploading em { color: var(--primary); }
.queue-item.done em { color: var(--ok); }
.queue-item.error em { color: var(--error); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: end center;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.38);
}

.modal.hidden { display: none; }

.notification-permission-reminder {
  position: fixed;
  z-index: 1400;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(104px + env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #f0cf75;
  border-radius: 18px;
  background: rgba(255, 251, 235, 0.98);
  box-shadow: 0 18px 45px rgba(15, 35, 55, 0.22);
  color: #17283b;
}

.notification-permission-reminder strong,
.notification-permission-reminder span { display: block; }
.notification-permission-reminder strong { margin-bottom: 4px; font-size: 17px; }
.notification-permission-reminder span { color: #596a7a; font-size: 14px; line-height: 1.45; }
.notification-reminder-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.notification-reminder-actions button { min-height: 42px; border-radius: 12px; font-weight: 900; }
.notification-reminder-actions button:first-child { border-color: #d5a928; background: #ffefb0; color: #624700; }

@media (min-width: 900px) {
  .notification-permission-reminder {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: min(430px, calc(100vw - 48px));
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
  }

  .notification-permission-reminder strong {
    font-size: 15px;
  }

  .notification-permission-reminder span {
    font-size: 12px;
  }

  .notification-reminder-actions button {
    min-height: 38px;
  }
}

.modal-panel {
  width: min(100%, 520px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  padding: 14px;
}

.detail-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  max-height: min(calc(100dvh - 28px - env(safe-area-inset-bottom)), 760px);
  overflow: hidden;
  border-radius: 14px 14px 8px 8px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

#orderDetailBody {
  min-height: 0;
  overflow: auto;
  padding: 0 1px 8px;
}

.sheet-handle {
  width: 46px;
  height: 5px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: #cbd5e1;
}

.detail-preview .preview-box {
  max-height: 300px;
  aspect-ratio: 4 / 3;
  margin-bottom: 12px;
  background: #f8fafc;
}

.detail-sheet h2 {
  margin: 0;
  font-size: 24px;
}

.detail-sub {
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.detail-sheet > .confirm-btn {
  margin-top: 0;
  min-height: 56px;
  font-size: 20px;
}

.detail-sheet > .ghost-btn {
  margin-top: 0;
  min-height: 48px;
  background: #f2f6fb;
}

.modal-title {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 900;
}

.modal-input {
  width: 100%;
  min-height: 48px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-size: 17px;
}

#voiceCodeBtn {
  margin: 0 0 10px;
  touch-action: none;
  user-select: none;
}

#voiceCodeBtn.recording {
  border-color: var(--error);
  background: #fff1f1;
  color: var(--error);
}

.voice-hint {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.record-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.record-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.recognition-status {
  display: grid;
  gap: 8px;
  margin: -2px 0 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  padding: 10px;
  color: #1e3a8a;
}

.recognition-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 850;
}

.recognition-line span {
  color: #3b5f93;
  text-align: right;
}

.recognition-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(37, 99, 235, 0.14);
}

.recognition-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #10b981);
}

.recognition-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  color: #466386;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.record-stats span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 4px 7px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 900;
  text-align: center;
}

.records-empty {
  min-height: 260px;
  border: 1px dashed #cbd7e6;
  border-radius: 8px;
  background: #f8fafc;
  padding: 18px;
}

.records-empty .confirm-btn {
  width: min(100%, 260px);
  background: var(--primary);
  color: #fff;
}

#refreshOrders {
  display: none;
}

.record-stats b {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.record-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  padding: 12px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.record-day {
  display: grid;
  gap: 8px;
}

.record-day-title {
  margin: 6px 2px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.record-head em {
  flex: 0 0 auto;
  border: 1px solid #b7e2c9;
  border-radius: 999px;
  background: #eaf8ef;
  color: var(--ok);
  padding: 4px 8px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.record-item strong {
  color: var(--text);
  font-size: 18px;
}

.suspect-code-btn {
  justify-self: start;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  max-width: 96px;
  overflow-wrap: anywhere;
  text-align: right;
}

.suspect-code-btn:active {
  transform: scale(0.98);
}

.record-item span,
.record-item small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.record-thumbs div {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  min-height: 0;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fafc, #eef4fb);
}

.record-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.record-thumbs div > span {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-weight: 1000;
}

.record-thumbs small {
  position: absolute;
  left: 6px;
  bottom: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  padding: 2px 7px;
}

.record-files {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.record-files small {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 7px 8px;
  color: var(--text);
}

.record-path {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 7px 8px;
}

.record-path summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.record-path summary::-webkit-details-marker {
  display: none;
}

.record-path small {
  display: block;
  margin-top: 6px;
  white-space: normal;
  word-break: break-all;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.inline-check input {
  width: 18px;
  height: 20px;
}

.modal-sizes { margin-bottom: 12px; }

.image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.9);
}

.image-preview-modal.hidden {
  display: none;
}

.image-preview-body {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
}

.image-preview-body img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  border-radius: 8px;
  object-fit: contain;
  background: #111827;
}

.image-preview-color {
  display: grid;
  place-items: center;
  width: min(88vw, 520px);
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.image-preview-color span {
  max-width: 80%;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px 14px;
}

.image-preview-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 14px;
  width: 44px;
  min-height: 44px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.trade-review-modal {
  grid-template-rows: 1fr auto;
  align-items: stretch;
}

.trade-review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(100%, 520px);
  justify-self: center;
  padding-top: 12px;
}

@media (max-width: 360px) {
  .live-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell { padding-inline: 10px; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  h1 { font-size: 22px; }
  .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-list.grid-mode { grid-template-columns: 1fr; }
  .size-grid { grid-template-columns: 1fr; }
}

/* MIFAN Studio refresh: a calm operations surface on desktop, compact on mobile. */
:root {
  --bg: #edf2f6;
  --card: #ffffff;
  --text: #12233a;
  --muted: #66788c;
  --border: #d8e1ea;
  --primary: #1464d2;
  --primary-dark: #0d4fae;
  --navy: #10243f;
  --navy-soft: #1b3557;
  --accent: #d6a34a;
  --ok: #15865a;
  --error: #c74b52;
}

body {
  background-color: var(--bg);
  background-image: linear-gradient(rgba(16, 36, 63, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(16, 36, 63, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

.app-shell {
  position: relative;
  width: min(100%, 620px);
  padding: max(18px, env(safe-area-inset-top)) 16px calc(132px + env(safe-area-inset-bottom));
}

.topbar {
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(216, 225, 234, 0.92);
  padding-bottom: 16px;
}

.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(214, 163, 74, 0.52);
  border-radius: 12px;
  background: var(--navy);
  color: #f8e4b4;
  font-size: 19px;
  font-weight: 950;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 18px rgba(16, 36, 63, 0.14);
}
.brand-copy { min-width: 0; }
.eyebrow { margin-bottom: 2px; color: #718399; letter-spacing: 0.08em; text-transform: uppercase; }
h1 { font-size: 28px; letter-spacing: -0.03em; }
.top-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 11px; font-weight: 750; }
.top-actions { flex-wrap: wrap; }
.workspace-label { display: none; }

button, .search-input, .sort-select { transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, transform 160ms ease; }
button:hover { border-color: #a8bfd9; box-shadow: 0 5px 14px rgba(16, 36, 63, 0.08); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(20, 100, 210, 0.2); outline-offset: 2px; }
.status-pill { padding: 7px 10px; }
.section-head { margin: 0 0 14px; }
.section-head h2 { color: var(--navy); font-size: 25px; letter-spacing: -0.025em; }
.section-head p { font-weight: 650; }
.section-actions { display: flex; align-items: center; gap: 10px; }
.section-kicker { color: var(--accent); font-size: 10px; font-weight: 950; letter-spacing: 0.12em; }

.search-input, .sort-select { box-shadow: 0 4px 15px rgba(16, 36, 63, 0.035); }
.filter-chip.active { background: #e7f0ff; box-shadow: inset 0 0 0 1px rgba(20, 100, 210, 0.08); }
.date-chip.active { box-shadow: 0 7px 16px rgba(20, 100, 210, 0.18); }
.order-card, .photo-picker, .queue-panel, .empty-panel, .modal-panel {
  border-color: rgba(201, 214, 227, 0.95);
  box-shadow: 0 6px 20px rgba(16, 36, 63, 0.045);
}
.order-card { padding: 13px; }
.order-card:hover { border-color: #a8bfd9; box-shadow: 0 12px 26px rgba(16, 36, 63, 0.08); transform: translateY(-1px); }
.order-main strong { color: var(--navy); }
.info-chip { background: #f5f8fb; }
.photo-chip, .age-pill { font-weight: 850; }
.watermark-note { border-color: #c9dbee; background: #f4f8fc; }
.trade-picker { background: #f8fbfd; box-shadow: 0 8px 22px rgba(16, 36, 63, 0.05); }
.trade-picker:active { box-shadow: 0 0 0 4px rgba(20, 100, 210, 0.14); }
#photoView .confirm-btn { box-shadow: 0 9px 18px rgba(20, 100, 210, 0.16); }
.queue-panel { padding: 14px; background: rgba(255, 255, 255, 0.82); }
.queue-title { color: var(--navy); letter-spacing: 0.01em; }
.live-stats { border-color: #c9dbee; background: #f4f8fc; box-shadow: 0 6px 18px rgba(16, 36, 63, 0.04); }
.live-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.live-stats-grid span { border-color: #d8e4ef; background: #fff; }
.live-stats-grid span:nth-child(3) b { color: var(--accent); }

@media (min-width: 900px) {
  body { background-color: #e9eff4; }
  .app-shell {
    width: min(100% - 56px, 1480px);
    min-height: 100vh;
    display: grid;
    grid-template-columns: 218px minmax(0, 1fr);
    grid-template-areas: "top top" "nav content";
    column-gap: 24px;
    row-gap: 24px;
    padding: 26px 0 44px;
  }
  .topbar {
    grid-area: top;
    display: flex;
    justify-content: space-between;
    min-height: 78px;
    margin: 0;
    border: 1px solid rgba(199, 213, 227, 0.96);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    padding: 14px 18px;
    box-shadow: 0 12px 30px rgba(16, 36, 63, 0.07);
    backdrop-filter: blur(18px);
  }
  .brand-mark { width: 48px; height: 48px; }
  h1 { font-size: 31px; }
  .top-subtitle { font-size: 12px; }
  .top-actions { flex-wrap: nowrap; gap: 9px; }
  .workspace-label { display: grid; gap: 2px; margin-right: 8px; padding-right: 16px; border-right: 1px solid var(--border); text-align: right; }
  .workspace-label span { color: var(--muted); font-size: 10px; font-weight: 800; }
  .workspace-label strong { color: var(--navy); font-size: 11px; letter-spacing: 0.08em; }
  .bottom-nav {
    grid-area: nav;
    position: sticky;
    top: 26px;
    align-self: start;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
    margin: 0;
    border: 1px solid #193657;
    border-radius: 8px;
    background: var(--navy);
    padding: 10px;
    box-shadow: 0 15px 30px rgba(16, 36, 63, 0.16);
    overflow: hidden;
  }
  .bottom-nav::before { content: "MIFAN OPERATIONS"; display: block; margin: 4px 8px 12px; color: #d9b66a; font-size: 10px; font-weight: 950; letter-spacing: 0.14em; }
  .nav-indicator { left: 10px; top: 0; width: calc(100% - 20px); height: 52px; background: #1e4772; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07); transform: translateY(var(--nav-y, 0)); }
  .bottom-nav-btn, .bottom-camera-btn { width: 100%; min-height: 52px; grid-auto-flow: column; grid-template-columns: 28px 1fr; justify-content: start; gap: 9px; padding: 0 13px; border-radius: 6px; color: #b8c9db; text-align: left; }
  .bottom-nav-btn::before { justify-self: center; }
  .bottom-nav-btn strong, .bottom-camera-btn strong { font-size: 13px; }
  .bottom-nav-btn.active, .bottom-camera-btn.active { color: #fff; }
  .bottom-camera-btn { margin: 0; background: transparent; }
  .bottom-camera-btn .camera-glyph { justify-self: center; }
  .bottom-nav.nav-state-photo .nav-indicator { height: 52px; border-radius: 6px; }
  .view.active { grid-area: content; min-width: 0; }
  #ordersView.view.active { display: grid; grid-template-columns: 280px minmax(0, 1fr); column-gap: 22px; }
  #ordersView .section-head { grid-column: 1 / -1; }
  #ordersView .search-input, #ordersView .filter-row, #ordersView .sort-select, #ordersView .date-strip, #ordersView .uncoded-block { grid-column: 1; }
  #ordersView .order-list { grid-column: 2; grid-row: 2 / span 12; }
  #ordersView .search-input { top: 0; }
  #ordersView .filter-row { top: 0; }
  #ordersView .sort-select { top: 0; }
  #ordersView .date-strip { top: 0; }
  .order-list.list-mode { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-list.grid-mode { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #photoView.view.active { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; }
  #recordsView.view.active { max-width: none; }
  .live-stats-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .live-stats-grid span { padding-inline: 4px; }
}

@media (max-width: 520px) {
  .app-shell {
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }
  .brand-lockup { gap: 8px; }
  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 15px;
  }
  .eyebrow { margin-bottom: 1px; font-size: 9px; line-height: 1; }
  h1 { font-size: 21px; line-height: 1.05; }
  .top-subtitle { display: none; }
  .top-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 5px;
  }
  .top-actions .icon-btn {
    min-width: 35px;
    min-height: 32px;
    padding: 0 7px;
    font-size: 12px;
  }
  .status-pill {
    max-width: 70px;
    overflow: hidden;
    padding: 5px 7px;
    font-size: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .workspace-label { display: none; }
  .section-head-hero { align-items: flex-end; }
  .section-kicker { display: none; }
  .live-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .app-shell { padding-inline: 10px; }
  .eyebrow { display: none; }
  h1 { font-size: 19px; }
  .top-actions .refresh-btn { display: none; }
  .status-pill { max-width: 62px; }
}

@media (max-width: 899px) {
  .order-card,
  .record-item {
    content-visibility: auto;
    contain-intrinsic-size: 190px;
  }
  .bottom-nav,
  .bottom-nav-btn,
  .bottom-camera-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav {
    pointer-events: auto;
    z-index: 9999;
    isolation: isolate;
  }
}

@media (max-width: 520px) {
  .queue-item { grid-template-columns: minmax(0, 1fr) 76px; gap: 8px; }
  .queue-main span { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .queue-state, .queue-state em { width: 76px; max-width: 76px; }
  .queue-state button { width: 100%; padding-inline: 4px; }
}

@media (orientation: landscape) and (max-height: 540px) {
  .app-shell {
    width: min(100%, 760px);
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
  .topbar { margin-bottom: 10px; }
  .trade-picker { aspect-ratio: 4 / 2.6; }
  .detail-sheet { max-height: calc(100dvh - 18px - env(safe-area-inset-bottom)); }
  .detail-preview .preview-box { max-height: 210px; }
}

/* Keep the three primary actions visually consistent on touch screens. */
.bottom-nav-btn::before {
  width: 23px;
  height: 23px;
  border-width: 1.8px;
  opacity: 1;
}

#navOrders::before {
  border-radius: 5px;
  background: linear-gradient(currentColor, currentColor) 5px 7px / 11px 1.8px no-repeat,
    linear-gradient(currentColor, currentColor) 5px 12px / 8px 1.8px no-repeat;
  box-shadow: none;
}

#navRecords::before {
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, currentColor 0 2px, transparent 2.2px),
    linear-gradient(currentColor, currentColor) 50% 50% / 1.8px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 50% 50% / 6px 1.8px no-repeat;
  box-shadow: none;
}

.camera-glyph {
  width: 24px;
  height: 18px;
  border-width: 1.8px;
  border-radius: 5px;
}

.camera-glyph::before {
  left: 4px;
  top: -6px;
  width: 10px;
  height: 5px;
  border: 1.8px solid currentColor;
  border-bottom: 0;
  background: transparent;
}

.camera-glyph::after {
  width: 8px;
  height: 8px;
  border-width: 1.8px;
}

.load-more-btn {
  display: block;
  grid-column: 1 / -1;
  width: min(100%, 420px);
  min-height: 48px;
  margin: 14px auto 6px;
  padding: 10px 18px;
  border: 1px solid #bfd3ee;
  border-radius: 8px;
  background: #f7fbff;
  color: #1261b8;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.load-more-btn:hover,
.load-more-btn:focus-visible {
  border-color: #3182ce;
  background: #edf6ff;
}

/* v14.48 responsive grid refresh
   Desktop: 12 columns. Tablet: 8 columns. Phone: 4 columns. */
:root {
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 24px;
  --ui-control: 42px;
  --ui-control-touch: 44px;
  --ui-radius-sm: 10px;
  --ui-radius-md: 14px;
  --ui-radius-lg: 16px;
  --ui-shadow: 0 8px 24px rgba(16, 36, 63, 0.06);
}

.view,
.view * {
  min-width: 0;
}

.section-head-hero {
  min-height: 54px;
  align-items: flex-end;
}

.section-head-hero h2 {
  line-height: 1.12;
}

.search-input,
.sort-select,
.filter-chip,
.date-chip,
.small-btn,
.icon-btn {
  min-height: var(--ui-control);
  border-radius: var(--ui-radius-sm);
}

.order-card,
.queue-panel,
.record-item,
.live-stats,
.cloud-storage-card,
.watermark-note,
.recognition-status {
  border-radius: var(--ui-radius-md);
}

.photo-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--ui-space-2);
  margin: 0 0 var(--ui-space-3);
}

.photo-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: var(--ui-space-2);
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--ui-radius-sm);
  background: rgba(255, 255, 255, 0.82);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.photo-step b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 11px;
}

.photo-step.active {
  border-color: #b9d5fb;
  background: #f2f7ff;
  color: var(--primary);
}

.photo-step.active b {
  background: #dceaff;
  color: var(--primary);
}

.record-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.record-stats span,
.live-stats-grid span {
  min-height: 62px;
  align-content: center;
  border-radius: var(--ui-radius-sm);
}

.queue-item,
.local-pending-item {
  overflow: hidden;
  border-radius: var(--ui-radius-sm);
}

@media (min-width: 900px) {
  .app-shell {
    width: min(calc(100% - 48px), 1500px);
    grid-template-columns: 204px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "nav top" "nav content";
    column-gap: var(--ui-space-5);
    row-gap: var(--ui-space-4);
    padding: 24px 0 36px;
  }

  .topbar {
    grid-area: top;
    min-height: 68px;
    border-radius: var(--ui-radius-lg);
    padding: 10px 16px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  h1 {
    font-size: 25px;
  }

  .bottom-nav {
    grid-area: nav;
    top: 24px;
    min-height: calc(100vh - 48px);
    align-content: start;
    border-radius: var(--ui-radius-lg);
    padding: 14px 10px;
  }

  .bottom-nav::before {
    margin: 7px 10px 18px;
  }

  .bottom-nav-btn,
  .bottom-camera-btn {
    min-height: 48px;
    border-radius: var(--ui-radius-sm);
  }

  .nav-indicator {
    border-radius: var(--ui-radius-sm);
  }

  .view.active {
    width: 100%;
    min-width: 0;
  }

  #ordersView.view.active {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
  }

  #ordersView .section-head {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  #ordersView .search-input {
    grid-column: span 5;
    position: static;
    margin: 0;
  }

  #ordersView .filter-row {
    grid-column: span 5;
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--ui-space-2);
    margin: 0;
  }

  #ordersView .sort-select {
    grid-column: span 2;
    position: static;
    margin: 0;
  }

  #ordersView .date-strip {
    grid-column: 1 / -1;
    position: static;
    display: flex;
    gap: var(--ui-space-2);
    overflow-x: auto;
    margin: 0;
    padding: 0 0 2px;
  }

  #ordersView .date-chip {
    width: auto;
    min-width: 92px;
    place-items: center;
    justify-content: center;
    border-radius: 999px;
  }

  #ordersView .order-list {
    grid-column: 1 / -1;
    grid-row: auto;
    margin: 0;
  }

  #ordersView .uncoded-block {
    grid-column: 1 / -1;
  }

  .order-list.list-mode {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .order-list.grid-mode {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .list-mode .order-card {
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: 184px;
    gap: var(--ui-space-3);
    padding: var(--ui-space-3);
  }

  .order-card {
    border-radius: var(--ui-radius-md);
  }

  #photoView.view.active {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
  }

  #photoView .section-head,
  #photoView .photo-steps {
    grid-column: 1 / -1;
  }

  #photoView .watermark-note,
  #photoView .trade-pair,
  #photoView > .confirm-btn,
  #photoView > .status-line {
    grid-column: span 8;
  }

  #photoView .queue-panel {
    grid-column: 9 / -1;
    grid-row: 3 / span 4;
    top: 24px;
  }

  .trade-pair {
    gap: 14px;
    margin: 0;
  }

  .photo-picker {
    min-height: 300px;
    margin: 0;
    border-radius: var(--ui-radius-md);
  }

  #photoView > .confirm-btn {
    min-height: 50px;
    margin: 0;
    border-radius: var(--ui-radius-sm);
    font-size: 17px;
  }

  #photoView > .status-line {
    margin: 0;
  }

  #recordsView.view.active {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
  }

  #recordsView > .section-head,
  #recordsView > .recognition-status,
  #recordsView > #uploadRecords,
  #recordsView > #packageReviewBlock {
    grid-column: 1 / -1;
  }

  #recordsView > .record-stats {
    grid-column: span 5;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--ui-space-2);
    margin: 0;
  }

  #recordsView > .live-stats {
    grid-column: span 7;
    margin: 0;
    padding: var(--ui-space-3);
  }

  #recordsView .live-stats-head {
    margin-bottom: var(--ui-space-2);
  }

  #recordsView .live-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #recordsView .live-stats-grid span {
    min-height: 50px;
    padding: 5px;
    font-size: 14px;
  }

  #recordsView .cloud-storage-card {
    gap: 6px;
    margin-top: var(--ui-space-2);
    padding: 9px 10px;
  }

  #uploadRecords .record-day {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  #uploadRecords .record-day-title {
    grid-column: 1 / -1;
  }

  .modal {
    place-items: center;
  }

  .modal-panel {
    border-radius: var(--ui-radius-lg);
  }
}

@media (min-width: 1240px) {
  #uploadRecords .record-day {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 600px) and (max-width: 899px) {
  .app-shell {
    width: min(calc(100% - 32px), 860px);
  }

  .order-list.list-mode,
  #uploadRecords .record-day {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 599px) {
  .app-shell {
    width: 100%;
    padding: max(10px, env(safe-area-inset-top)) 12px calc(112px + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 58px;
    margin-bottom: var(--ui-space-3);
  }

  .section-head-hero {
    min-height: 46px;
    align-items: center;
  }

  .section-head-hero h2 {
    font-size: 23px;
  }

  .search-input,
  .sort-select,
  .filter-chip,
  .date-chip,
  .small-btn {
    min-height: var(--ui-control-touch);
  }

  .filter-row {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex: 0 0 auto;
    min-width: 74px;
    padding-inline: 12px;
    border-radius: 999px;
  }

  .date-strip {
    scrollbar-width: none;
  }

  .date-strip::-webkit-scrollbar {
    display: none;
  }

  .date-chip {
    min-width: 82px;
  }

  .order-list.list-mode,
  .order-list.grid-mode {
    grid-template-columns: minmax(0, 1fr);
  }

  .list-mode .order-card {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
  }

  .order-main strong {
    font-size: 21px;
  }

  .order-main span {
    font-size: 12px;
  }

  .photo-steps {
    gap: 6px;
  }

  .photo-step {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    min-height: 56px;
    padding: 6px 3px;
    text-align: center;
    font-size: 10px;
  }

  .photo-step b {
    width: 22px;
    height: 22px;
  }

  .watermark-note {
    grid-template-columns: 1fr;
    padding: 10px 11px;
  }

  .watermark-note strong {
    justify-self: start;
  }

  .trade-pair {
    gap: 8px;
  }

  .trade-picker {
    min-height: 174px;
    aspect-ratio: 4 / 4.7;
  }

  .photo-picker::before {
    inset: 8px;
  }

  .photo-picker::after {
    top: 12px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .photo-picker span {
    bottom: 16px;
    padding: 8px 11px;
    font-size: 15px;
  }

  .trade-photo-state {
    right: 10px;
    bottom: 10px;
    font-size: 10px;
  }

  #photoView .confirm-btn {
    min-height: 50px;
    border-radius: 12px;
    font-size: 17px;
  }

  .record-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .record-stats span {
    min-height: 58px;
    font-size: 15px;
  }

  .live-stats {
    margin: 10px 0 12px;
    padding: 10px;
  }

  .live-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .live-stats-grid span {
    min-height: 54px;
    font-size: 15px;
  }

  .cloud-storage-copy,
  .cloud-storage-meta {
    align-items: flex-start;
  }

  .cloud-storage-copy {
    display: grid;
    gap: 3px;
  }

  .record-actions {
    max-width: 52%;
  }

  .record-actions .small-btn {
    flex: 1 1 auto;
    padding-inline: 9px;
    font-size: 12px;
  }

  .record-item {
    padding: 12px;
  }

  .record-thumbs div,
  .record-thumbs img,
  .record-thumbs div > span {
    min-height: 82px;
    height: 82px;
  }

  .bottom-nav {
    width: min(calc(100% - 24px), 390px);
    bottom: max(8px, env(safe-area-inset-bottom));
    border-radius: 22px;
  }

  .modal {
    padding-inline: 10px;
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding-inline: 10px;
  }

  .top-actions .refresh-btn {
    display: none;
  }

  .record-actions {
    max-width: 48%;
  }

  .record-actions .small-btn:first-child {
    display: none;
  }

  .live-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trade-pair {
    grid-template-columns: 1fr;
  }

  .trade-picker {
    min-height: 210px;
    aspect-ratio: 4 / 3;
  }
}

/* ===== 拍摄模式切换 ===== */
.capture-mode-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  background: #e9eef5;
  border-radius: 12px;
}

.capture-mode-btn {
  flex: 1;
  min-height: 36px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.capture-mode-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(16, 42, 67, 0.12);
}

/* ===== 包装图拍摄 ===== */
.package-capture {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.package-picker {
  min-height: 240px;
}

.package-actions {
  display: flex;
  gap: 8px;
}

.package-actions .ghost-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  margin-top: 0;
  min-height: 52px;
  padding: 0 14px;
  font-size: 15px;
  white-space: nowrap;
}

.package-actions .confirm-btn {
  flex: 1;
  width: auto;
  min-width: 0;
}

/* 拍摄框右上角「相册」小入口 */
.album-mini-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  border: 1px solid rgba(18, 98, 214, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.album-mini-btn:active {
  background: #dbe7f8;
}

/* ===== 编号输入框 + 清除按钮 ===== */
.code-input-wrap {
  position: relative;
}

.code-input-wrap .modal-input {
  padding-right: 44px;
}

.code-clear-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #eef2f7;
  color: #5b6b81;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.code-clear-btn.hidden {
  display: none;
}

/* ===== 记录页双 Tab ===== */
.records-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  background: #e9eef5;
  border-radius: 12px;
}

.records-tab {
  flex: 1;
  min-height: 38px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.records-tab.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(16, 42, 67, 0.12);
}

/* ===== 发货编码待审核 ===== */
.package-review-block {
  margin-top: 16px;
}

.package-record {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.package-record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.package-record-head strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.package-record-head span {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.package-code-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.package-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fafbfd;
}

.package-crop {
  flex: 0 0 auto;
  width: 52px;
  height: 40px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #eef2f7;
}

.package-crop.crop-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.package-code-edit {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  padding: 6px 9px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.package-code-edit:disabled {
  border-color: transparent;
  background: transparent;
  color: var(--ok);
}

.package-code-row span {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.package-code-row em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.package-code-row.confirmed {
  background: #eaf8ef;
  border-color: #b7e2c9;
}

.package-code-row.confirmed span {
  color: var(--ok);
}

.package-record-actions {
  display: flex;
  gap: 8px;
}

.package-no-code {
  margin: 2px 0 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #fdf6ec;
  border: 1px solid #f2d9b4;
  color: #8a6a34;
  font-size: 13px;
  line-height: 1.6;
}
