:root {
  --bg: #f0f2f5;
  --panel: #ffffff;
  --ink: #303133;
  --muted: #909399;
  --label: #606266;
  --line: #ebeef5;
  --header: #f5f7fa;
  --primary: #13c2c2;
  --primary-dark: #08979c;
  --link: #1890ff;
  --danger: #ff4d4f;
  --warn: #fa8c16;
  --tag-blue: #1890ff;
  --radius: 2px;
  --nav-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* 全部商品页锁定整页滚动，仅表格区域可滑 */
body:has(#view-items:not(.hidden)) {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

.hidden { display: none !important; }

.view {
  min-height: 100vh;
  min-height: 100dvh;
}

.accent-bar {
  display: inline-block;
  width: 3px;
  height: 14px;
  border-radius: 1px;
  background: var(--primary);
  margin-right: 8px;
  flex-shrink: 0;
}

/* Login */
.view-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(180deg, #e6fffb 0%, var(--bg) 42%, var(--bg) 100%);
}

.login-wrap {
  width: min(400px, 100%);
  padding: 36px 32px 28px;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.login-brand {
  display: flex;
  align-items: flex-start;
  margin-bottom: 28px;
}

.login-brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.login-brand .sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-form label {
  display: block;
  margin-bottom: 16px;
}

.login-form label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--label);
  font-size: 13px;
}

.login-form input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.login-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(19, 194, 194, 0.12);
}

.error {
  color: var(--danger);
  min-height: 1.2em;
  margin: 10px 0 0;
  font-size: 13px;
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 4px;
  height: 32px;
  padding: 0 15px;
  font-size: 14px;
  line-height: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  background: #fff;
  color: var(--ink);
  transition: all 0.15s;
}

.btn.block { width: 100%; height: 40px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.soft { background: #e6fffb; border-color: #87e8de; color: var(--primary-dark); }
.btn.ghost { background: #fff; border-color: #d9d9d9; color: var(--label); }
.btn.ghost:hover { color: var(--primary); border-color: var(--primary); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }

/* Top nav */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.enterprise-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 20px;
  background: linear-gradient(90deg, #e6fffb 0%, #f0fffd 45%, #e6fffb 100%);
  border-bottom: 1px solid #b5f5ec;
}

.enterprise-name {
  display: block;
  color: #006d75;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-align: center;
}

.top-nav-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--nav-h);
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.top-nav-left,
.top-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.top-nav h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.user-tag {
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #f5f5f5;
  color: var(--muted);
  font-size: 12px;
}

.main-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 16px;
  padding: 2px;
  background: #f5f5f5;
  border-radius: 6px;
}

.main-tabs .tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--label);
  height: 28px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

.main-tabs .tab.active {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.main-tabs .tab:hover:not(.active) {
  color: var(--primary);
}

.back-btn { margin-right: 4px; }

#items-ship-modified {
  min-width: 120px;
}

.content {
  padding: 16px 20px 28px;
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  color: var(--label);
  white-space: nowrap;
}

.filter-item input,
.filter-item select {
  height: 32px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  outline: none;
}

.filter-item input { width: 150px; }
.filter-item select { width: 120px; }
.filter-item input:focus,
.filter-item select:focus { border-color: var(--primary); }
.sep { color: var(--muted); }

/* Date range picker (Element-like) */
.drp-host { position: relative; }

.drp-trigger {
  min-width: 340px;
  max-width: 100%;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
}

.drp-trigger.is-placeholder {
  color: #c0c4cc;
}

.drp-trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drp-trigger-icon {
  color: #c0c4cc;
  font-size: 12px;
}

.drp-panel {
  position: fixed;
  z-index: 1000;
  display: flex;
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.drp-panel.hidden { display: none !important; }

.drp-shortcuts {
  width: 100px;
  flex-shrink: 0;
  border-right: 1px solid #e4e7ed;
  padding: 8px 0;
  background: #fff;
}

.drp-shortcut {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.drp-shortcut:hover,
.drp-shortcut.active {
  color: var(--primary);
  background: #f5fffd;
}

.drp-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.drp-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 8px;
}

.drp-input-box {
  flex: 1;
  display: flex;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.drp-input-box input {
  border: none;
  height: 32px;
  margin: 0;
  padding: 0 10px;
  width: 50%;
  min-width: 0;
  font-size: 13px;
  background: transparent;
  box-shadow: none;
}

.drp-input-box input:focus {
  border: none;
  box-shadow: none;
}

.drp-to-sep { color: var(--muted); }

.drp-calendars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 8px;
}

.drp-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 0 8px;
}

.drp-cal-title {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
}

.drp-nav {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
}

.drp-nav:hover {
  color: var(--primary);
  background: #f5f5f5;
}

.drp-weekdays,
.drp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.drp-weekdays span {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}

.drp-day {
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
}

.drp-day.is-out { color: #c0c4cc; }
.drp-day.is-today { color: var(--primary); font-weight: 600; }
.drp-day.is-in-range { background: #e6fffb; border-radius: 0; }
.drp-day.is-selected {
  background: #409eff;
  color: #fff;
}
.drp-day:hover:not(.is-selected) { background: #f5f5f5; }

.drp-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 16px 12px;
  border-top: 1px solid #ebeef5;
}

/* Panel / table */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.table-scroll {
  width: 100%;
  overflow: auto;
  max-height: calc(100vh - 220px);
}

.data-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 13px;
}

.data-table th {
  background: var(--header);
  color: var(--ink);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table th .sort {
  display: inline-block;
  margin-left: 4px;
  color: #bfbfbf;
  font-size: 10px;
  transform: scale(0.85);
  vertical-align: 1px;
}

.data-table tbody tr:hover { background: #fafafa; }

.data-table .link {
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

.data-table .check {
  width: 46px;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}

.data-table input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.col-no { width: 64px; }
.col-img { width: 72px; }
.col-unit { width: 64px; }
.col-qty { width: 110px; }
.col-bill { width: 150px; }
.col-status { width: 90px; }
.col-date { width: 110px; }
.col-code { width: 110px; }
.col-name { width: 160px; }
.col-spec { width: 100px; }
.col-order-qty { width: 80px; }
.col-assist-unit { width: 80px; }
.col-assist-qty { width: 80px; }
.col-memo { width: 120px; }
.col-house { width: 150px; }
.col-organ { width: 140px; }

.items-sortable-table {
  table-layout: fixed;
  width: max-content;
  min-width: 1680px;
}

.items-sortable-table th,
.items-sortable-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.items-sortable-table th.col-draggable {
  cursor: grab;
  user-select: none;
  white-space: nowrap;
}

.items-sortable-table th.col-draggable:active {
  cursor: grabbing;
}

.items-sortable-table th.col-dragging {
  opacity: 0.45;
}

.items-sortable-table th.col-drag-over {
  box-shadow: inset 3px 0 0 var(--primary);
  background: #f0f7ff;
}

.items-sortable-table th .col-drag-hint {
  display: inline-block;
  margin-left: 6px;
  color: #c0c4cc;
  font-size: 11px;
  letter-spacing: -2px;
  vertical-align: 1px;
}

.items-sortable-table th.has-filter {
  white-space: normal;
  vertical-align: top;
  padding-top: 8px;
  padding-bottom: 8px;
}

.items-sortable-table th.has-filter .th-filter-wrap {
  width: 100%;
  max-width: none;
}

.items-sortable-table tr.empty-row td.empty-cell {
  overflow: visible;
  text-overflow: clip;
}

.items-sortable-table th .th-label {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  line-height: 1.2;
}

.items-sortable-table th .th-filter-wrap,
.items-sortable-table th .th-ms {
  position: relative;
  margin-top: 6px;
  max-width: none;
}

.th-ms-trigger.th-filter {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  background: #fff;
  color: #606266;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
  text-align: left;
}

.th-ms-trigger .th-ms-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.th-ms-trigger .th-ms-caret {
  flex-shrink: 0;
  color: #c0c4cc;
  font-size: 10px;
}

.th-ms-trigger:hover,
.th-ms-trigger:focus {
  border-color: var(--link);
}

.th-ms-trigger.is-filtered {
  border-color: var(--link);
  color: var(--ink);
  background: #f0f7ff;
}

.th-ms-panel {
  display: none;
  position: fixed;
  z-index: 1200;
  flex-direction: column;
  padding: 8px;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.th-ms.is-open .th-ms-panel {
  display: flex;
}

.th-ms-search {
  width: 100%;
  height: 28px;
  margin-bottom: 6px;
  padding: 0 8px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
}

.th-ms-search:focus {
  border-color: var(--link);
}

.th-ms-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.th-ms-act {
  border: none;
  background: none;
  padding: 0;
  color: var(--link);
  font-size: 12px;
  cursor: pointer;
}

.th-ms-act:hover {
  opacity: 0.8;
}

.th-ms-list {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 240px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid #f0f2f5;
  padding-top: 4px;
}

.th-ms-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 4px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  border-radius: 2px;
}

.th-ms-option:hover {
  background: #f5f7fa;
}

.th-ms-option input {
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--link);
}

.th-ms-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.th-ms-empty {
  padding: 16px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.items-sortable-table td.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  white-space: normal;
}

.items-mobile-filters {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}

.items-mobile-filters .items-m-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.items-mobile-filters .th-filter-wrap,
.items-mobile-filters .th-ms {
  width: 100%;
  max-width: none;
  margin-top: 0;
}

.items-mobile-filters .th-ms-trigger {
  height: 32px;
}

.empty {
  margin: 0;
  padding: 64px 16px;
  text-align: center;
  color: var(--muted);
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.page-text { color: var(--muted); font-size: 13px; }
.pager-btns { display: flex; gap: 8px; }

.items-pager {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 16px;
  min-height: 48px;
}

.items-pager .pager-tip {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.items-pager .pager-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: #606266;
  font-size: 13px;
}

.items-pager .pager-total {
  color: #606266;
  margin-right: 4px;
}

.items-pager .pager-size {
  height: 28px;
  padding: 0 8px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  background: #fff;
  color: #606266;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.items-pager .pager-size:hover,
.items-pager .pager-size:focus {
  border-color: var(--link);
}

.items-pager .pager-btn,
.items-pager .pager-num {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #dcdfe6;
  border-radius: 2px;
  background: #fff;
  color: #303133;
  font-size: 13px;
  line-height: 26px;
  text-align: center;
  cursor: pointer;
}

.items-pager .pager-btn {
  font-size: 16px;
  color: #303133;
}

.items-pager .pager-btn:hover:not(:disabled),
.items-pager .pager-num:hover:not(.is-active) {
  color: var(--link);
}

.items-pager .pager-btn:disabled {
  color: #c0c4cc;
  cursor: not-allowed;
  background: #fff;
}

.items-pager .pager-pages {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.items-pager .pager-num.is-active {
  background: var(--link);
  border-color: var(--link);
  color: #fff;
  cursor: default;
}

.items-pager .pager-ellipsis {
  min-width: 28px;
  text-align: center;
  color: #303133;
  letter-spacing: 2px;
  user-select: none;
}

.items-pager .pager-jumper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  color: #606266;
}

.items-pager .pager-jump-input {
  width: 44px;
  height: 28px;
  padding: 0 4px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  text-align: center;
  color: #606266;
  font-size: 13px;
  outline: none;
  -moz-appearance: textfield;
}

.items-pager .pager-jump-input::-webkit-outer-spin-button,
.items-pager .pager-jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.items-pager .pager-jump-input:focus {
  border-color: var(--link);
}

/* Detail */
.detail-content { padding-bottom: 88px; }

.detail-head {
  padding: 20px 24px 12px;
}

.detail-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.detail-name-row h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tags { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 2px;
  line-height: 20px;
}

.tag.warn {
  color: var(--warn);
  background: #fff7e6;
  border: 1px solid #ffd591;
}

.tag.info {
  color: var(--tag-blue);
  background: #e6f7ff;
  border: 1px solid #91d5ff;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 12px;
}

.info-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 2px;
  min-width: 0;
  line-height: 1.7;
  font-size: 13px;
}

.info-item .k {
  color: var(--muted);
  white-space: nowrap;
}

.info-item .v {
  color: var(--ink);
  word-break: break-all;
}

.attach-row {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.detail-table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px 10px;
  font-weight: 600;
}

.detail-table-head .tip {
  font-weight: 400;
  font-size: 12px;
}

.detail-table { min-width: 1120px; }

.item-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: #fafafa;
  display: block;
}

.item-img.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bfbfbf;
  font-size: 11px;
}

.qty-input {
  width: 88px;
  height: 30px;
  margin: 0;
  padding: 0 8px;
  text-align: center;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fafafa;
  font-size: 13px;
  outline: none;
  /* 去掉 number 输入框右侧上下箭头 */
  -moz-appearance: textfield;
  appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.qty-input.qty-mismatch {
  color: var(--danger);
  font-weight: 600;
  border-color: #ffa39e;
  background: #fff2f0;
}

.qty-input.qty-mismatch:focus {
  border-color: var(--danger);
  background: #fff;
}

.qty-input.qty-readonly,
.qty-input:disabled {
  color: var(--muted);
  background: #f0f0f0;
  cursor: not-allowed;
  opacity: 0.85;
}

/* 只读但仍有改数：比可编辑 mismatch 更醒目 */
.qty-input.qty-readonly.qty-mismatch,
.qty-input:disabled.qty-mismatch {
  color: #cf1322;
  font-weight: 700;
  border-color: #ff7875;
  background: #fff1f0;
  opacity: 1;
  box-shadow: inset 0 0 0 1px #ffa39e;
}

.muted { color: var(--muted); }

.mobile-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.mobile-action-bar .btn.block { width: auto; flex: 1; height: 36px; }

.mobile-only { display: none; }
.desktop-only { display: flex; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 18px;
  border-radius: 4px;
  max-width: 90vw;
  z-index: 50;
  font-size: 13px;
}

/* Mobile cards for list */
.order-cards {
  display: none;
  padding: 8px;
  gap: 8px;
}

.order-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  cursor: pointer;
}

.order-card:active { background: #fafafa; }

.order-card .code {
  color: var(--link);
  text-decoration: underline;
  font-weight: 600;
  margin-bottom: 8px;
}

.order-card .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.order-card .row b {
  color: var(--ink);
  font-weight: 400;
  text-align: right;
}

.order-card .items-qty-input {
  width: 96px;
  text-align: right;
}

.item-card {
  cursor: default;
}

.item-card .code {
  cursor: pointer;
}

/* 全部商品：顶栏/筛选固定，仅列表区域滚动 */
#view-items.view {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#view-items .top-nav {
  position: relative;
  flex-shrink: 0;
  z-index: 30;
}

#view-items .content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 12px;
  padding-bottom: 12px;
}

#view-items .toolbar {
  flex-shrink: 0;
  margin-bottom: 10px;
  position: relative;
  z-index: 25;
}

#view-items .panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#view-items .detail-table-head {
  flex-shrink: 0;
}

#view-items #items-list.table-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

#view-items .items-pager {
  flex-shrink: 0;
}

#view-items .items-sortable-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--header);
}

@media (max-width: 900px) {
  #view-items .content {
    padding-bottom: 72px;
  }

  #view-items .mobile-action-bar {
    flex-shrink: 0;
  }
}

@media (max-width: 900px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex; }

  .top-nav {
    height: auto;
  }

  .enterprise-bar {
    padding: 10px 12px;
  }

  .enterprise-name {
    font-size: 16px;
  }

  .top-nav-main {
    min-height: 52px;
    padding: 8px 12px;
    flex-wrap: wrap;
  }

  .top-nav-left {
    flex-wrap: wrap;
  }

  .main-tabs {
    margin-left: 0;
    width: 100%;
    order: 3;
  }

  #items-ship-modified {
    min-width: 0;
    flex: 1;
  }

  .content {
    padding: 12px;
  }

  .toolbar {
    padding: 12px;
    gap: 10px;
  }

  .filter-item {
    width: 100%;
    flex-wrap: wrap;
  }

  .filter-item input,
  .filter-item select {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .drp-trigger {
    min-width: 0;
    width: 100%;
  }

  .drp-panel {
    flex-direction: column;
    max-height: calc(100vh - 16px);
    overflow: auto;
  }

  .drp-shortcuts {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid #e4e7ed;
    padding: 8px;
    gap: 4px;
  }

  .drp-shortcut {
    width: auto;
    padding: 6px 10px;
    border-radius: 4px;
    background: #f5f5f5;
  }

  .drp-calendars {
    grid-template-columns: 1fr;
  }

  .toolbar .btn.primary {
    width: 100%;
  }

  .table-desktop { display: none !important; }
  .order-cards {
    display: grid;
  }

  .items-mobile-filters.order-cards-only {
    display: flex;
  }

  .table-scroll {
    max-height: none;
  }

  .detail-table {
    min-width: 920px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .detail-head {
    padding: 16px;
  }

  .detail-table-head {
    padding: 8px 16px;
  }

  .pager {
    flex-direction: column;
    align-items: stretch;
  }

  .pager-btns .btn {
    flex: 1;
  }

  .items-pager {
    justify-content: center;
  }

  .items-pager .pager-tip {
    max-width: 100%;
    margin-right: 0;
    text-align: center;
  }

  .items-pager .pager-bar {
    justify-content: center;
    width: 100%;
  }
}
