:root {
  --brand: #0891b2;
  --brand-2: #2563eb;
  --brand-grad: linear-gradient(135deg, #2563eb, #0891b2);
  --brand-soft: #eff6ff;
  --brand-border: #bfdbfe;
  --navy: #070b1c;
}

.app-body {
  min-height: 100vh;
  color: #1f2937;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(56, 189, 248, 0.18), transparent 46%),
    radial-gradient(ellipse at 88% 100%, rgba(165, 243, 252, 0.28), transparent 42%),
    linear-gradient(180deg, #f0f9ff 0%, #eef6ff 48%, #f8fbff 100%);
}

.app-nav {
  background: #fff;
  border-bottom: 1px solid var(--brand-border);
  box-shadow: 0 1px 10px rgba(37, 99, 235, 0.08);
}
.app-nav-sub {
  color: var(--brand);
}
.app-body-xhs {
  background:
    radial-gradient(ellipse at 10% 0%, rgba(251, 113, 133, 0.14), transparent 46%),
    radial-gradient(ellipse at 90% 100%, rgba(254, 205, 211, 0.35), transparent 42%),
    linear-gradient(180deg, #fff5f7 0%, #fff8f9 48%, #fafafa 100%);
}
.app-body-xhs .app-nav {
  border-bottom-color: #fecdd3;
  box-shadow: 0 1px 10px rgba(244, 63, 94, 0.08);
}
.app-body-xhs .app-nav-sub { color: #e11d48; }
.app-body-xhs .nav-link-active,
.app-body-xhs .nav-link-active:hover {
  background: linear-gradient(135deg, #e11d48, #fb7185);
  box-shadow: 0 4px 14px rgba(225, 29, 72, .3);
}
.app-body-xhs .btn-primary {
  background: linear-gradient(135deg, #e11d48, #fb7185);
  box-shadow: 0 4px 14px rgba(225, 29, 72, .25);
}
.app-body-xhs .app-logout {
  color: #e11d48;
  background: #fff1f2;
}
.app-body-xhs .app-logout:hover { background: #ffe4e6; }

.channel-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}
.channel-switch-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  white-space: nowrap;
  transition: all .15s ease;
  line-height: 1.2;
}
.channel-switch-item:hover {
  color: #2563eb;
  background: #eff6ff;
}
.channel-switch-item.is-active,
.channel-switch-item.is-active:hover {
  color: #fff !important;
  background: var(--brand-grad);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .28);
}
.app-body-xhs .channel-switch {
  background: #fff1f2;
  border-color: #fecdd3;
}
.app-body-xhs .channel-switch-item:hover {
  color: #e11d48;
  background: #ffe4e6;
}
.app-body-xhs .channel-switch-item.is-active,
.app-body-xhs .channel-switch-item.is-active:hover {
  background: linear-gradient(135deg, #e11d48, #fb7185);
  box-shadow: 0 4px 14px rgba(225, 29, 72, .28);
}

.app-body-wechat {
  background:
    radial-gradient(ellipse at 10% 0%, rgba(16, 185, 129, 0.14), transparent 46%),
    radial-gradient(ellipse at 90% 100%, rgba(167, 243, 208, 0.35), transparent 42%),
    linear-gradient(180deg, #f0fdf6 0%, #f7fdf9 48%, #fafafa 100%);
}
.app-body-wechat .app-nav {
  border-bottom-color: #a7f3d0;
  box-shadow: 0 1px 10px rgba(16, 185, 129, 0.08);
}
.app-body-wechat .app-nav-sub { color: #059669; }
.app-body-wechat .nav-link-active,
.app-body-wechat .nav-link-active:hover {
  background: linear-gradient(135deg, #059669, #34d399);
  box-shadow: 0 4px 14px rgba(5, 150, 105, .3);
}
.app-body-wechat .btn-primary {
  background: linear-gradient(135deg, #059669, #34d399);
  box-shadow: 0 4px 14px rgba(5, 150, 105, .25);
}
.app-body-wechat .app-logout {
  color: #059669;
  background: #ecfdf5;
}
.app-body-wechat .app-logout:hover { background: #d1fae5; }
.app-body-wechat .channel-switch {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.app-body-wechat .channel-switch-item:hover {
  color: #059669;
  background: #d1fae5;
}
.app-body-wechat .channel-switch-item.is-active,
.app-body-wechat .channel-switch-item.is-active:hover {
  background: linear-gradient(135deg, #059669, #34d399);
  box-shadow: 0 4px 14px rgba(5, 150, 105, .28);
}

@media (max-width: 640px) {
  .channel-switch-item {
    min-width: 52px;
    padding: 6px 10px;
    font-size: 12px;
  }
}

.app-logout {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #2563eb;
  background: #eff6ff;
  border-radius: 8px;
  white-space: nowrap;
  text-decoration: none;
}
.app-logout:hover { background: #dbeafe; }

.identity-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
}
.identity-check svg {
  display: block;
}
.identity-opt.is-current {
  background: #eff6ff;
}
.identity-opt.is-current:hover {
  background: #dbeafe;
}
.identity-opt.is-current .identity-opt-title {
  color: #1d4ed8;
}
.identity-opt.is-current .identity-opt-sub {
  color: rgba(37, 99, 235, 0.75);
}

.nav-link {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  transition: all .15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-link:hover { color: #2563eb; background: #eff6ff; }
.nav-link-active,
.nav-link-active:hover {
  color: #fff !important;
  background: var(--brand-grad);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
}

.brand-logo {
  height: 48px;
  width: auto;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.btn-primary {
  background: var(--brand-grad);
  color: #fff !important;
  border: none;
  cursor: pointer;
  transition: opacity .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .25);
}
.btn-primary:hover { opacity: .92; box-shadow: 0 6px 18px rgba(8, 145, 178, .35); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.rel-tree-root {
  border: 1px solid #e8eef8;
  border-radius: 12px;
  background: #fafcff;
  padding: 12px 14px;
}
.rel-tree-supplier {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}
.rel-tree-supplier:hover .font-semibold {
  color: #1d4ed8;
}
.rel-tree-caret {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #64748b;
  transition: transform .15s ease;
  flex-shrink: 0;
}
.rel-tree-root.is-open .rel-tree-caret {
  transform: rotate(90deg);
}
.rel-tree-children {
  margin: 8px 0 0 10px;
  padding-left: 0;
  border-left: none;
}
.rel-tree-root.is-collapsed .rel-tree-children {
  display: none;
}
.rel-tree-branch {
  position: relative;
  padding: 6px 0 6px 22px;
}
/* 竖线：├ 中间项通到底；└ 末项只到中线 */
.rel-tree-branch::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #c7d7f5;
}
.rel-tree-branch.is-last::before {
  bottom: 50%;
}
/* 横线：接到节点 */
.rel-tree-branch::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 18px;
  height: 2px;
  background: #c7d7f5;
  transform: translateY(-50%);
}
.rel-tree-leaf {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #edf2f9;
}

.user-tree-root {
  border: 1px solid #e8eef8;
  border-radius: 12px;
  background: #fafcff;
  padding: 12px 14px;
}
.user-tree-root.is-nested {
  border-style: dashed;
  background: #fff;
  padding: 10px 12px;
  margin-top: 6px;
}
.user-tree-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}
.user-tree-head:hover .font-semibold {
  color: #1d4ed8;
}
.user-tree-caret {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #64748b;
  transition: transform .15s ease;
  flex-shrink: 0;
}
.user-tree-root.is-open > .user-tree-head .user-tree-caret {
  transform: rotate(90deg);
}
.user-tree-children {
  margin: 8px 0 0 10px;
}
.user-tree-root.is-collapsed > .user-tree-children {
  display: none;
}
.user-tree-branch {
  position: relative;
  padding: 6px 0 6px 22px;
}
.user-tree-branch::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #c7d7f5;
}
.user-tree-branch.is-last::before {
  bottom: 50%;
}
.user-tree-branch::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 18px;
  height: 2px;
  background: #c7d7f5;
  transform: translateY(-50%);
}
.user-tree-leaf {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #edf2f9;
}

.tab-active {
  background: var(--brand-grad) !important;
  color: #fff !important;
  border-color: #bfdbfe !important;
}

.trend-range-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  background: #fff;
  border: 1px solid var(--brand-border);
  cursor: pointer;
}
.trend-range-btn.active,
.trend-range-btn:hover {
  color: #fff;
  background: var(--brand-grad);
  border-color: transparent;
}

.chart-box { overflow: hidden; position: relative; z-index: 0; isolation: isolate; }

.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.stat-card { transition: box-shadow .2s, transform .2s; }
.stat-card:hover { box-shadow: 0 8px 30px rgba(37, 99, 235, .16); transform: translateY(-1px); }

.page-btn.active { background: var(--brand-grad); color: #fff; }
.app-body-xhs .page-btn.active {
  background: linear-gradient(135deg, #e11d48, #fb7185);
}
.app-body-wechat .page-btn.active {
  background: linear-gradient(135deg, #059669, #34d399);
}
.app-body-xhs .date-pop-day.is-today { color: #e11d48; }
.app-body-xhs .date-pop-day.is-selected,
.app-body-xhs .date-pop-day.is-selected:hover { background: #e11d48; color: #fff; }
.app-body-xhs .date-pop-day:not(.is-disabled):hover { background: #fff1f2; }
.app-body-wechat .date-pop-day.is-today { color: #059669; }
.app-body-wechat .date-pop-day.is-selected,
.app-body-wechat .date-pop-day.is-selected:hover { background: #059669; color: #fff; }
.app-body-wechat .date-pop-day:not(.is-disabled):hover { background: #ecfdf5; }

.permission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.permission-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--brand-soft); border: 1px solid var(--brand-border); font-size: 13px; cursor: pointer; }

.scope-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.scope-option {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px;
  background: var(--brand-soft); border: 1px solid var(--brand-border); font-size: 13px; cursor: pointer; transition: all .15s ease;
}
.scope-option:has(input:checked) {
  color: #fff; background: var(--brand-grad); border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .25);
}

.admin-table { border-collapse: collapse; }
.admin-table th,
.admin-table td { padding: 12px 14px; vertical-align: middle; text-align: left; }
.admin-table thead th { font-weight: 600; white-space: nowrap; }
.admin-table tbody tr { border-bottom: 1px solid #f3f4f6; }
.admin-table tbody tr:hover { background: rgba(239, 246, 255, .85); }

/* 订单列表：商品名称列宽 */
.order-product-name {
  display: block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
th.order-product-name-th {
  width: 240px;
  max-width: 240px;
  min-width: 200px;
}
.order-activity-name {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
th.order-activity-name-th {
  width: 180px;
  max-width: 180px;
  min-width: 160px;
}

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(7, 11, 28, .55); z-index: 100;
  align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop:not(.hidden) { display: flex; }
.modal-backdrop.hidden { display: none !important; }
.modal-panel {
  background: #fff; border-radius: 16px; width: 100%; max-width: 760px; max-height: 90vh;
  overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); position: relative; z-index: 101;
}
.modal-header {
  position: sticky; top: 0; z-index: 2; background: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid #f3f4f6;
}
.modal-close-btn {
  width: 32px; height: 32px; border-radius: 8px; border: none; background: #f3f4f6;
  color: #6b7280; font-size: 18px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.modal-close-btn:hover { background: #fee2e2; color: #dc2626; }

.check-count {
  font-size: 12px;
  font-weight: 400;
  color: #9ca3af;
}

.shop-auth-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 180px; overflow: auto; padding: 10px 12px;
  border: 1px solid var(--brand-border); border-radius: 10px; background: var(--brand-soft);
}
.shop-auth-box:empty::before {
  content: '暂无店铺，请先到「店铺管理」添加';
  color: #9ca3af; font-size: 12px;
}
.grant-all-row {
  grid-column: 1 / -1;
  position: sticky;
  top: -10px;
  z-index: 1;
  margin: -10px -12px 0;
  padding: 8px 12px;
  background: var(--brand-soft);
  border-bottom: 1px solid var(--brand-border);
}
.batch-auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.batch-auth-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  background: var(--brand-soft);
}
.shop-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px; margin: 1px 2px; border-radius: 999px;
  background: var(--brand-soft); color: #1d4ed8; font-size: 12px; max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.role-badge {
  display: inline-block;
  font-size: 12px;
  line-height: 1.4;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
}
.role-badge-admin { background: #f5f3ff; color: #6d28d9; }
.role-badge-master { background: #fff7ed; color: #c2410c; }
.role-badge-leader { background: #eff6ff; color: #1d4ed8; }
.role-badge-member { background: #ecfdf5; color: #047857; }

.promo-preview {
  padding: 14px 16px;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  background: #fafafa;
  max-height: 320px;
  overflow: auto;
  word-break: break-word;
}

.card-surface {
  background: #fff;
  border: 1px solid var(--brand-border);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.06);
}
.hover-brand:hover { background: #eff6ff; }
.link-brand { color: #2563eb; }
.link-brand:hover { text-decoration: underline; }
.badge-brand {
  color: #1d4ed8;
  background: #eff6ff;
}
.page-title { color: #0f172a; }
.page-sub { color: #64748b; }

/* 导航短/长文案切换 */
.nav-text-short { display: none; }
.nav-text-full { display: inline; }

.app-nav-links {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.app-nav-links::-webkit-scrollbar { display: none; }

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs .tab { flex-shrink: 0; }

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 店铺可搜索下拉：输入框加宽；面板再放宽以便长店名单行显示 */
.shop-filter-combobox {
  z-index: 1;
  width: 18rem;
  max-width: 100%;
}
.shop-filter-combobox:focus-within {
  z-index: 30;
}
.shop-filter-input-wrap {
  width: 100%;
}
.shop-filter-clear {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: #9ca3af;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-filter-clear:hover {
  color: #4b5563;
  background: #f3f4f6;
}
.shop-filter-clear.hidden {
  display: none;
}
.shop-filter-panel {
  left: 0;
  right: auto;
  min-width: 100%;
  width: max(100%, 22rem);
  max-width: min(28rem, 92vw);
}
.shop-filter-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25;
  color: #374151;
  background: transparent;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-filter-panel button:hover,
.shop-filter-panel button.is-active {
  background: #eff6ff;
  color: #1d4ed8;
}
.shop-filter-panel .shop-filter-empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* 筛选项不压缩：宽度不够时换行，避免搜索框被挤没/标签重叠 */
.orders-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}
.orders-filters > * {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
}
.orders-filters > .orders-filter-search {
  flex: 1 1 220px;
  min-width: min(220px, 100%);
}
.orders-filters > .orders-filter-actions {
  flex: 0 0 auto;
}
.orders-filters label {
  display: block;
  white-space: nowrap;
}

/* 筛选控件统一高度：原生 select 与 button/input 在各浏览器表现不一致 */
.orders-filters select,
.orders-filters input,
.orders-filters > div > button {
  box-sizing: border-box;
  height: 38px;
  min-height: 38px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 36px;
  vertical-align: middle;
}
.orders-filters > div > button {
  display: flex;
  align-items: center;
}
.orders-filters > div > button > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

/* 自绘日期选择（数据大屏 / 订单管理共用） */
.date-pop {
  position: fixed;
  z-index: 80;
  width: 252px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #bfdbfe;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .16);
  user-select: none;
}
.date-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.date-pop-nav {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  cursor: pointer;
}
.date-pop-week,
.date-pop-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.date-pop-week { color: #94a3b8; font-size: 11px; margin-bottom: 4px; }
.date-pop-day {
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font-size: 12px;
  cursor: pointer;
}
.date-pop-day.is-today { color: #2563eb; font-weight: 700; }
.date-pop-day.is-selected { background: #2563eb; color: #fff; }
.date-pop-day.is-disabled { color: #cbd5e1; cursor: not-allowed; }
.date-pop-day:not(.is-disabled):hover { background: #eff6ff; }
.date-pop-day.is-selected:hover { background: #2563eb; }

/* 原生 select：避免 grid/overflow 导致移动端弹层错位 */
.form-select {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background-color: #fff;
  -webkit-appearance: menulist;
  appearance: menulist;
}
.form-select.hidden {
  display: none !important;
}

.admin-form-panel {
  overflow: visible;
}

/* —— 手机适配 —— */
@media (max-width: 768px) {
  .app-body {
    overflow-x: visible;
  }

  .app-main,
  .tab-panel,
  .admin-form-panel {
    overflow: visible;
    transform: none;
  }

  .app-nav-links {
    mask-image: none;
    -webkit-mask-image: none;
  }

  /* grid 内原生 select 在部分手机浏览器会弹层错位，改 flex 纵向 */
  #createUserForm,
  #createShopForm,
  #createGiftForm,
  #createJdForm,
  .modal-panel form.grid {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
  }

  #createUserForm > .md\:col-span-2,
  #createUserForm > .xl\:col-span-3,
  #createUserForm > .md\:col-span-2.xl\:col-span-1,
  #createShopForm > .md\:col-span-2,
  #createGiftForm > .md\:col-span-2 {
    width: 100%;
  }

  select,
  .form-select {
    font-size: 16px;
    min-height: 44px;
  }

  .orders-filters select,
  .orders-filters input,
  .orders-filters > div > button {
    height: 44px;
    min-height: 44px;
    line-height: 42px;
  }

  .nav-text-full { display: none; }
  .nav-text-short { display: inline; }

  .brand-logo { height: 36px; }
  .nav-link {
    padding: 7px 10px;
    font-size: 13px;
    border-radius: 8px;
  }
  .app-logout {
    padding: 6px 10px;
    font-size: 13px;
  }
  .app-nav-inner { padding-top: 6px; padding-bottom: 6px; }

  .page-title { font-size: 1.35rem; line-height: 1.3; }
  .page-sub { font-size: 0.8125rem; }

  .permission-grid,
  .scope-grid,
  .shop-auth-box {
    grid-template-columns: 1fr;
  }
  .batch-auth-grid {
    grid-template-columns: 1fr;
  }

  .modal-backdrop { padding: 8px; align-items: flex-end; }
  .modal-panel {
    max-width: 100%;
    max-height: min(92vh, 92dvh);
    border-radius: 16px 16px 0 0;
  }

  .promo-preview { max-height: 240px; padding: 12px; }

  .admin-table th,
  .admin-table td {
    padding: 10px 10px;
    font-size: 13px;
  }

  .trend-range-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* 订单筛选：小屏纵向排列，避免 select 弹层错位 */
  .orders-filters {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .orders-filters > .orders-filter-search,
  .orders-filters > .orders-filter-actions {
    grid-column: auto;
  }
  .orders-filters .w-44,
  .orders-filters .w-40,
  .orders-filters .w-36,
  .orders-filters .flex-1 {
    width: 100% !important;
    min-width: 0 !important;
  }
  .orders-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .orders-filter-actions > * {
    flex: 1 1 auto;
    text-align: center;
    min-width: 4.5rem;
  }
}

@media (max-width: 480px) {
  .orders-filters {
    grid-template-columns: none;
  }
}

@supports (padding: env(safe-area-inset-top)) {
  .app-nav {
    padding-top: env(safe-area-inset-top);
  }
  .app-main {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}
