/* ==========================================================================
   魔方云订单管理工作台 · 移动端样式
   莫兰迪色系 / 清新简洁 / 图标与文字标准化
   ========================================================================== */

:root {
  --bg: #f4f0eb;
  --bg-deep: #ece5dd;
  --surface: #ffffff;
  --surface-2: #faf7f3;
  --ink: #332f2c;
  --ink-2: #6f6862;
  --ink-3: #a89f98;
  --line: #efe8e1;
  --line-2: #e5dcd3;
  --sage: #8fa79b;
  --sage-deep: #6d887b;
  --sage-soft: #e8efea;
  --blush: #d9b3a8;
  --blush-soft: #f7e8e3;
  --blue: #a3b3c0;
  --blue-soft: #eaf0f4;
  --sand: #cdb79f;
  --sand-soft: #f5ece1;
  --danger: #c1655b;
  --danger-soft: #fbeae7;
  --radius-l: 22px;
  --radius-m: 16px;
  --radius-s: 12px;
  --shadow: 0 8px 24px rgba(96, 81, 68, 0.07);
  --shadow-soft: 0 2px 10px rgba(96, 81, 68, 0.05);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans CJK SC', 'Microsoft YaHei', sans-serif;
  background: #e7e0d7;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  border: 0;
  outline: none;
  background: transparent;
  /* 允许选中文本：防止任何父级 user-select:none 继承后导致移动端无法唤起输入法 */
  -webkit-user-select: text;
  user-select: text;
}

input::placeholder,
textarea::placeholder {
  color: #bdb4ad;
}

img {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

/* ------------------------------- 应用外框 ------------------------------- */

.app-frame {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

@media (min-width: 520px) {
  .app-frame {
    box-shadow: 0 0 0 1px rgba(120, 104, 90, 0.08), 0 24px 60px rgba(96, 81, 68, 0.18);
  }
}

/* -------------------------------- 顶部栏 -------------------------------- */

.appbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
  background: linear-gradient(180deg, #f7f3ee 0%, rgba(244, 240, 235, 0.94) 70%, rgba(244, 240, 235, 0) 100%);
  position: relative;
  z-index: 20;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(140deg, #a8bcb1, #7d968a);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 4px 10px rgba(109, 136, 123, 0.28);
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
  flex: 1;
}

.brand-text h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text p {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.3px;
}

.avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line-2);
  color: var(--sage-deep);
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-soft);
}

/* -------------------------------- 页面容器 ------------------------------- */

.page-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}

.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 14px calc(28px + env(safe-area-inset-bottom));
  display: none;
  /* 不加 -webkit-overflow-scrolling: touch：iOS 13+ 已默认惯性滚动，
     旧写法在 iPad 上会加剧「惯性滚动未停就点击」时的命中偏移（点按钮却弹输入法） */
}

.page.active {
  display: block;
  animation: pageIn 0.22s ease;
}

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

/* -------------------------------- 通用组件 ------------------------------- */

.card {
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
  padding: 14px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 4px 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.section-title .sub {
  font-size: 11.5px;
  color: var(--ink-3);
}

.primary-btn {
  width: 100%;
  height: 50px;
  border-radius: 15px;
  background: linear-gradient(135deg, #9cb2a6, #77907f);
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 22px rgba(109, 136, 123, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s;
}

.primary-btn:active {
  transform: scale(0.985);
  box-shadow: 0 6px 14px rgba(109, 136, 123, 0.24);
}

/* ---------------------------- 数据备份页 ---------------------------- */

.danger-btn {
  width: 100%;
  height: 48px;
  border-radius: 15px;
  background: #fbeae6;
  color: var(--danger, #bb5f55);
  border: 1px solid rgba(187, 95, 85, 0.35);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.danger-text {
  color: var(--danger, #bb5f55) !important;
}

.storage-card {
  background: #fff;
  border: 1px solid var(--line, #ece5dd);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.storage-card.warn {
  border-color: rgba(187, 95, 85, 0.45);
  background: #fdf6f4;
}

.sb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #332f2c);
}

.sb-top b.warn {
  color: var(--danger, #bb5f55);
}

.sb-track {
  height: 10px;
  border-radius: 6px;
  background: #efe9e2;
  margin: 10px 0 8px;
  overflow: hidden;
}

.sb-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #9cb2a6, #77907f);
  transition: width 0.4s ease;
}

.sb-fill.mid {
  background: linear-gradient(90deg, #e2c08c, #d1a45e);
}

.sb-fill.warn {
  background: linear-gradient(90deg, #d98a7e, #bb5f55);
}

.sb-meta {
  font-size: 12px;
  color: var(--ink-3, #9a9188);
}

.sb-meta b {
  color: var(--ink-2, #6f6862);
}

.backup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 4px;
}

.backup-note {
  background: #f6f3ee;
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-2, #6f6862);
}

.backup-note b {
  display: block;
  margin-bottom: 6px;
  color: var(--ink, #332f2c);
}

.backup-note p {
  line-height: 1.7;
  margin: 0;
}

.store-storage-row {
  margin-bottom: 14px;
}

.row-ops {
  display: flex;
  gap: 10px;
  margin-top: -4px;
}

.row-ops button {
  flex: 1;
  height: 38px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--line, #ece5dd);
  font-size: 13px;
  color: var(--ink-2, #6f6862);
}

.clear-warn {
  background: #fdf6f4;
  border: 1px solid rgba(187, 95, 85, 0.3);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2, #6f6862);
}

.clear-warn b {
  color: var(--danger, #bb5f55);
}

.clear-warn.attention b {
  font-size: 14px;
}

.clear-warn p {
  margin: 6px 0 0;
}

.primary-btn[disabled] {
  opacity: 0.55;
  box-shadow: none;
}

.ghost-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ghost-btn.sage {
  color: var(--sage-deep);
  border-color: #cbdbd2;
  background: var(--sage-soft);
}

.mini-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mini-btn:active {
  background: var(--line);
}

.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-sm {
  width: 15px;
  height: 15px;
}

/* ------------------------------- 上传主区域 ------------------------------ */

.hero {
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -90px;
  background: radial-gradient(circle, rgba(232, 239, 234, 0.9), rgba(232, 239, 234, 0));
  pointer-events: none;
}

.hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.hero-head .t {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero-head .t b {
  font-weight: 600;
}

.dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(143, 167, 155, 0.18);
}

.hero-head .hint {
  font-size: 11px;
  color: var(--ink-3);
}

.upload-zone {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(212px, 36vh, 300px);
  border-radius: 18px;
  border: 1.5px dashed #d5cec6;
  background: linear-gradient(160deg, #fbf9f6, #f6f2ec);
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone:active {
  border-color: var(--sage);
  background: #f4f8f5;
}

.upload-zone .uz-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
}

.uz-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--sage-deep);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(96, 81, 68, 0.06);
  margin-bottom: 2px;
}

.uz-icon .icon {
  width: 24px;
  height: 24px;
}

.uz-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.uz-sub {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.6;
}

.uz-tags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.uz-tag {
  font-size: 10.5px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 9px;
}

.preview-box {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #f0eae3;
}

.preview-box img {
  width: 100%;
  height: clamp(212px, 36vh, 300px);
  object-fit: cover;
}

.preview-tools {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}

.preview-tools button {
  height: 30px;
  padding: 0 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  font-size: 11.5px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.preview-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  background: rgba(51, 47, 44, 0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hero-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.hero-foot .paste-tip {
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.4;
  flex: 1;
}

/* -------------------------------- 订单表单 ------------------------------- */

.form-card {
  margin-top: 12px;
}

.seg {
  display: flex;
  padding: 3px;
  background: var(--bg-deep);
  border-radius: 13px;
  margin-bottom: 14px;
}

.seg button {
  flex: 1;
  height: 38px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.seg button.active {
  background: #fff;
  color: var(--sage-deep);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(96, 81, 68, 0.09);
}

.field {
  margin-bottom: 13px;
}

.field > label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 7px;
  letter-spacing: 0.2px;
}

.field > label .lab-note {
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 400;
}

.field .input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: border-color 0.2s, background 0.2s;
}

.field .input-wrap:focus-within {
  border-color: #c3d2c9;
  background: #fff;
}

/* 校验失败字段高亮：红框 + 轻微抖动，只提示不抢焦点（避免 iPad 误弹键盘） */
.field .input-wrap.field-err {
  border-color: var(--danger);
  background: var(--danger-soft);
  animation: field-shake 0.4s;
}

@keyframes field-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

.field .input-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  font-size: 14.5px;
}

.field .input-wrap .unit {
  font-size: 11.5px;
  color: var(--ink-3);
  flex-shrink: 0;
}

.field .input-wrap .icon {
  color: var(--ink-3);
  width: 17px;
  height: 17px;
}

.field-row {
  display: flex;
  gap: 10px;
}

.field-row .field {
  flex: 1;
  min-width: 0;
}

textarea {
  width: 100%;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 14px;
  line-height: 1.55;
  resize: none;
  min-height: 68px;
}

textarea:focus {
  border-color: #c3d2c9;
  background: #fff;
}

/* 尺寸 chips */
.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.size-chip {
  min-width: 64px;
  padding: 7px 11px 6px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-align: center;
  transition: all 0.16s ease;
  line-height: 1.25;
}

.size-chip b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.size-chip span {
  display: block;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 1px;
}

.size-chip.active {
  background: var(--sage-soft);
  border-color: #a9c1b4;
}

.size-chip.active b {
  color: var(--sage-deep);
}

.size-chip.active span {
  color: #7d968a;
}

/* 圆形图标 chips（夹心 / 戚风） */
.icon-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 2px 2px 6px;
}

.ico-chip {
  flex-shrink: 0;
  width: 58px;
  text-align: center;
}

.ico-chip .circle {
  width: 50px;
  height: 50px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  border: 2px solid transparent;
  box-shadow: 0 3px 9px rgba(96, 81, 68, 0.12);
  overflow: hidden;
  position: relative;
  background: #ddd2c6;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.ico-chip .circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ico-chip .name {
  display: block;
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ico-chip.active .circle {
  border-color: var(--sage-deep);
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(143, 167, 155, 0.2), 0 4px 10px rgba(96, 81, 68, 0.14);
}

.ico-chip.active .name {
  color: var(--sage-deep);
  font-weight: 600;
}

.ico-chip.add .circle {
  background: #fff;
  border: 1.5px dashed #d5cec6;
  color: var(--ink-3);
  font-size: 20px;
  font-weight: 300;
  box-shadow: none;
}

/* 价格 */
.price-wrap {
  display: flex;
  align-items: center;
  height: 54px;
  padding: 0 12px;
  background: var(--blush-soft);
  border: 1px solid #f0d9d2;
  border-radius: 14px;
  gap: 4px;
}

.price-wrap .cur {
  font-size: 16px;
  font-weight: 600;
  color: #a8655a;
  margin-top: 3px;
}

.price-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  font-size: 24px;
  font-weight: 600;
  color: #a05a4f;
  letter-spacing: 0.5px;
}

.price-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--ink-3);
  flex-wrap: wrap;
}

.price-meta .std {
  color: var(--sage-deep);
  background: var(--sage-soft);
  border-radius: 6px;
  padding: 1px 6px;
}

.price-meta .discount {
  color: #a05a4f;
  background: #fbe9e5;
  border-radius: 6px;
  padding: 1px 6px;
}

.form-tip {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 4px 0 14px;
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.5;
}

.form-tip .icon {
  width: 13px;
  height: 13px;
  margin-top: 2px;
  color: var(--sage);
}

/* ------------------------------- 模块化按钮 ------------------------------ */

.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.module-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 13px 12px 12px;
  text-align: left;
  box-shadow: var(--shadow-soft);
  border: 1px solid #f2ece6;
  position: relative;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.module-card:active {
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(96, 81, 68, 0.05);
}

.module-ico {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  margin-bottom: 9px;
}

.module-ico .icon {
  width: 19px;
  height: 19px;
}

.m-sage .module-ico {
  background: var(--sage-soft);
  color: var(--sage-deep);
}

.m-blush .module-ico {
  background: var(--blush-soft);
  color: #b07a6d;
}

.m-blue .module-ico {
  background: var(--blue-soft);
  color: #6f8496;
}

.m-sand .module-ico {
  background: var(--sand-soft);
  color: #a1825f;
}

.module-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.module-card p {
  margin: 2px 0 0;
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.45;
  min-height: 15px;
}

.module-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--sage-deep);
  background: var(--sage-soft);
  border-radius: 7px;
  padding: 1px 6px;
}

.module-badge.alert {
  color: #a6544a;
  background: var(--danger-soft);
}

.invite-strip {
  margin-top: 10px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 18px;
  background: linear-gradient(120deg, #fff, #fbf7f2);
  border: 1px solid #f2ece6;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.invite-strip .txt {
  flex: 1;
  min-width: 0;
}

.invite-strip h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.invite-strip p {
  margin: 2px 0 0;
  font-size: 10.5px;
  color: var(--ink-3);
}

.invite-strip .arrow {
  color: var(--ink-3);
}

/* -------------------------------- 子页面头 ------------------------------- */

.page-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 10px;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(244, 240, 235, 0));
}

.page-head h2 {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.back-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  box-shadow: var(--shadow-soft);
  flex-shrink: 0;
}

.page-head .head-action {
  height: 32px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--sage-deep);
  background: var(--sage-soft);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* -------------------------------- 订单中心 ------------------------------- */

.page[data-page='orders'].active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 2px 0 0;
}

.page[data-page='orders'] .page-head,
.page[data-page='orders'] .orders-toolbar {
  padding-left: 14px;
  padding-right: 14px;
}

.orders-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
}

.sort-seg {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg-deep);
  border-radius: 11px;
  flex: 1;
}

.sort-seg button {
  flex: 1;
  height: 30px;
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.sort-seg button.active {
  background: #fff;
  color: var(--sage-deep);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(96, 81, 68, 0.1);
}

.count-badge {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}

.orders-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 0;
}

.filter-rail {
  width: 76px;
  flex-shrink: 0;
  padding: 2px 0 24px 6px;
  overflow-y: auto;
  scrollbar-width: none;
}

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

.filter-rail button {
  width: 100%;
  padding: 9px 6px 9px 10px;
  margin-bottom: 5px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink-2);
  text-align: left;
  line-height: 1.3;
  position: relative;
  transition: all 0.15s ease;
}

.filter-rail button small {
  display: block;
  font-size: 9.5px;
  color: var(--ink-3);
  margin-top: 1px;
}

.filter-rail button.active {
  background: #fff;
  color: var(--sage-deep);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.filter-rail button.active small {
  color: #93a89d;
}

.filter-rail button.active::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 15px;
  border-radius: 3px;
  background: var(--sage);
}

.orders-list {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 2px 12px 26px 4px;
  scrollbar-width: none;
}

.orders-list::-webkit-scrollbar {
  display: none;
}

.date-group-title {
  font-size: 11px;
  color: var(--ink-3);
  margin: 4px 2px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-group-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-2);
}

.order-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--surface);
  border-radius: 15px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 9px;
  border: 1px solid #f3ede7;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.order-card:active {
  transform: scale(0.987);
}

.order-card.urgent {
  background: linear-gradient(100deg, #fdf1ee, #fff 62%);
  border-color: #f3d7d1;
}

.order-card.urgent::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--danger);
}

.order-thumb {
  width: 66px;
  height: 78px;
  border-radius: 11px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(150deg, #f3ece4, #e9e0d6);
  position: relative;
  display: grid;
  place-items: center;
  color: #c2b3a4;
}

.order-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.order-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 5px;
  margin-bottom: 3px;
}

.mode-tag {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 5px;
  font-weight: 600;
  flex-shrink: 0;
}

.mode-tag.pickup {
  color: #a8825f;
  background: var(--sand-soft);
}

.mode-tag.delivery {
  color: #6f8496;
  background: var(--blue-soft);
}

.order-no {
  font-size: 10px;
  color: var(--ink-3);
  margin-left: auto;
  flex-shrink: 0;
}

.order-time {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.2px;
}

.order-time .warn {
  font-size: 9.5px;
  font-weight: 600;
  color: #fff;
  background: var(--danger);
  border-radius: 5px;
  padding: 1px 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.order-sub {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
  gap: 6px;
}

.order-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.3px;
}

.order-price small {
  font-size: 10px;
  font-weight: 400;
  color: var(--ink-3);
  margin-left: 2px;
}

.order-price .del {
  font-size: 10px;
  color: var(--ink-3);
  text-decoration: line-through;
  margin-left: 4px;
}

.order-actions {
  display: flex;
  gap: 5px;
}

.icon-action {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-2);
}

.icon-action .icon {
  width: 14px;
  height: 14px;
}

.empty {
  padding: 50px 16px;
  text-align: center;
  color: var(--ink-3);
}

.empty .ico {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  background: #fff;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  color: #c9beb4;
  box-shadow: var(--shadow-soft);
}

.empty p {
  margin: 0;
  font-size: 12.5px;
}

.empty span {
  font-size: 11px;
  color: #c0b6ae;
}

/* 日历筛选 */
.calendar-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 9px;
}

.calendar-bar input[type='date'] {
  flex: 1;
  font-size: 13px;
  color: var(--ink-2);
}

/* --------------------------------- 数据中心 ------------------------------ */

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi {
  background: var(--surface);
  border-radius: 17px;
  padding: 12px 13px;
  box-shadow: var(--shadow-soft);
  border: 1px solid #f3ede7;
}

.kpi .label {
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 5px;
}

.kpi .value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-top: 4px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.kpi .value small {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 400;
  margin-left: 2px;
}

.kpi .foot {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 3px;
}

.kpi.accent {
  background: linear-gradient(140deg, #f7f3ed, #fff);
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-l);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  border: 1px solid #f3ede7;
  margin-top: 10px;
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-head h3::before {
  content: '';
  width: 3px;
  height: 12px;
  border-radius: 3px;
  background: var(--sage);
}

.stat-head .link {
  font-size: 11px;
  color: var(--sage-deep);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.bar-row {
  margin-bottom: 10px;
}

.bar-row:last-child {
  margin-bottom: 0;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-2);
  margin-bottom: 4px;
}

.bar-label b {
  font-weight: 600;
  color: var(--ink);
}

.bar-track {
  height: 7px;
  border-radius: 7px;
  background: #f3eee8;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 7px;
  background: linear-gradient(90deg, #b6c8bd, #8fa79b);
  transition: width 0.5s ease;
}

.bar-fill.b2 {
  background: linear-gradient(90deg, #e6c8be, #d3a99d);
}

.bar-fill.b3 {
  background: linear-gradient(90deg, #c3ceda, #9fb0be);
}

.bar-fill.b4 {
  background: linear-gradient(90deg, #e0cfb8, #c9b193);
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 116px;
  padding-top: 14px;
}

.chart .col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 5px;
  position: relative;
}

.chart .bar {
  width: 100%;
  max-width: 18px;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(180deg, #a8bdb1, #cfdcd4);
  min-height: 3px;
  transition: height 0.5s ease;
}

.chart .bar.today {
  background: linear-gradient(180deg, #7f9a8c, #a4b9ad);
}

.chart .x {
  font-size: 9px;
  color: var(--ink-3);
  white-space: nowrap;
}

.chart .num {
  font-size: 9px;
  color: var(--ink-2);
  font-weight: 600;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.donut {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  display: grid;
  place-items: center;
}

.donut::after {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: #fff;
}

.donut .center {
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.2;
}

.donut .center b {
  display: block;
  font-size: 17px;
  font-weight: 600;
}

.donut .center span {
  font-size: 9.5px;
  color: var(--ink-3);
}

.legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legend .item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-2);
}

.legend .swatch {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend .item b {
  margin-left: auto;
  color: var(--ink);
  font-weight: 600;
}

.export-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ------------------------------ 口味 / 规格 ------------------------------ */

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  background: var(--bg-deep);
  padding: 3px;
  border-radius: 12px;
}

.tabs button {
  flex: 1;
  height: 34px;
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.tabs button.active {
  background: #fff;
  color: var(--sage-deep);
  font-weight: 600;
  box-shadow: 0 1px 5px rgba(96, 81, 68, 0.09);
}

.flavor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.flavor-item {
  background: #fff;
  border-radius: 16px;
  padding: 12px 8px 9px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  border: 1px solid #f3ede7;
  position: relative;
}

.flavor-item .circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  margin: 0 auto 7px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(96, 81, 68, 0.14);
}

.flavor-item .circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flavor-item .name {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flavor-item .state {
  display: block;
  font-size: 9.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.flavor-item.off {
  opacity: 0.55;
}

.flavor-item .del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f6f1ec;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
}

.flavor-item .mv {
  position: absolute;
  top: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f6f1ec;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  z-index: 2;
}
.flavor-item .mv-up {
  left: 5px;
}
.flavor-item .mv-down {
  left: 26px;
}
.flavor-item .mv:active {
  background: #e8e0d8;
}

.move-btn {
  width: 30px;
  height: 30px;
  font-size: 14px;
  color: var(--ink-2);
}

.time-text-btn {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.add-flavor {
  background: #fff;
  border-radius: 16px;
  border: 1.5px dashed #dcd3c9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink-3);
  font-size: 11.5px;
  min-height: 112px;
}

.add-flavor .plus {
  font-size: 22px;
  font-weight: 300;
  color: #bdb2a7;
}

.spec-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 15px;
  padding: 12px;
  margin-bottom: 9px;
  box-shadow: var(--shadow-soft);
  border: 1px solid #f3ede7;
}

.spec-row.off {
  opacity: 0.55;
}

.spec-size {
  width: 62px;
  height: 44px;
  border-radius: 11px;
  background: var(--sand-soft);
  color: #a5825f;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.spec-main {
  flex: 1;
  min-width: 0;
}

.spec-main .p {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.spec-main .p small {
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 400;
  margin-left: 3px;
}

.spec-main .s {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.spec-ops {
  display: flex;
  gap: 6px;
  align-items: center;
}

.switch {
  width: 38px;
  height: 22px;
  border-radius: 22px;
  background: #ded6ce;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.switch.on {
  background: var(--sage);
}

.switch.on::after {
  transform: translateX(16px);
}

/* --------------------------------- 邀请页 -------------------------------- */

.invite-hero {
  background: linear-gradient(150deg, #8fa79b, #71897c);
  border-radius: var(--radius-l);
  padding: 20px;
  color: #fff;
  box-shadow: 0 14px 30px rgba(109, 136, 123, 0.28);
  position: relative;
  overflow: hidden;
}

.invite-hero::after {
  content: '';
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  right: -40px;
  bottom: -70px;
}

.invite-hero h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.invite-hero p {
  margin: 0;
  font-size: 11.5px;
  opacity: 0.82;
  line-height: 1.6;
}

.invite-code {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px dashed rgba(255, 255, 255, 0.45);
  border-radius: 13px;
  padding: 10px 12px;
}

.invite-code .code {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
  font-family: 'SF Mono', Menlo, monospace;
}

.invite-code button {
  font-size: 11px;
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  height: 26px;
  padding: 0 9px;
}

.invite-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.invite-actions button {
  flex: 1;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--sage-deep);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.member-row:last-child {
  border-bottom: 0;
}

.member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--sage-deep);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.member-row .m-name {
  font-size: 13px;
  font-weight: 500;
}

.member-row .m-sub {
  font-size: 10.5px;
  color: var(--ink-3);
}

.member-row .m-self {
  margin-left: auto;
  font-size: 10px;
  color: var(--sage-deep);
  background: var(--sage-soft);
  border-radius: 6px;
  padding: 1px 6px;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.account-row:last-child {
  border-bottom: 0;
}

/* 账号页「更多设置」里的可点击行（手机端入口） */
.nav-link-row {
  width: 100%;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-family: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-link-row:last-child {
  border-bottom: 0;
}

.nav-link-row .v {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-link-row .icon-sm {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

.nav-link-row:active {
  background: rgba(0, 0, 0, 0.03);
}

.account-row .v {
  color: var(--ink-2);
  font-size: 12.5px;
}

.logout-btn {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line-2);
  color: var(--danger);
  font-size: 14px;
  margin-top: 14px;
}

/* -------------------------------- 底部弹层 ------------------------------- */

.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(52, 46, 41, 0.42);
  backdrop-filter: blur(2px);
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.sheet-mask.show {
  opacity: 1;
}

.sheet {
  width: 100%;
  max-width: 460px;
  max-height: 92dvh;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(18px);
  transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sheet-mask.show .sheet {
  transform: none;
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: #d8d0c8;
  margin: 4px auto 10px;
  flex-shrink: 0;
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  flex-shrink: 0;
}

.sheet-head h3 {
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.sheet-head .close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eae3db;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-size: 15px;
}

.sheet-body {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.sheet-body::-webkit-scrollbar {
  width: 0;
}

.sheet-foot {
  padding-top: 12px;
  flex-shrink: 0;
}

.img-preview {
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 26px rgba(96, 81, 68, 0.14);
  margin-bottom: 12px;
}

.img-preview img {
  width: 100%;
  display: block;
}

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

.sheet-actions .primary-btn {
  height: 46px;
  font-size: 14px;
}

.sheet-actions .ghost-btn {
  height: 46px;
  flex: 0 0 auto;
  padding: 0 16px;
  font-size: 13px;
}

.hint-line {
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 9px;
}

/* 表单弹层字段 */
.sheet .field .input-wrap {
  background: #fff;
}

.sheet .field textarea {
  background: #fff;
}

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

.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.color-dot.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px #fff inset;
}

/* -------------------------------- 登录界面 ------------------------------- */

.login-view {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  background: #f4f0eb;
  overflow-y: auto;
  z-index: 100;
}

.login-inner {
  width: 100%;
  max-width: 420px;
  padding: 0 26px calc(30px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.login-top {
  padding-top: calc(14vh + env(safe-area-inset-top));
  padding-bottom: 26px;
  text-align: left;
}

.login-logo {
  width: 60px;
  height: 60px;
  border-radius: 19px;
  background: linear-gradient(145deg, #a9bdb1, #71897c);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
  font-weight: 500;
  box-shadow: 0 12px 26px rgba(109, 136, 123, 0.32);
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.login-top h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.login-top p {
  margin: 7px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.4px;
}

/* 店主专属链接：登录页顶部显示店铺标识 */
.login-shop-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--sage-deep);
  background: rgba(220, 230, 222, 0.7);
  border: 1px solid rgba(148, 173, 158, 0.3);
}

.login-shop-tag::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
}

.login-card {
  background: #fff;
  border-radius: 22px;
  padding: 18px 16px;
  box-shadow: 0 14px 34px rgba(96, 81, 68, 0.1);
}

.login-tab {
  display: flex;
  gap: 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.login-tab button {
  font-size: 14px;
  color: var(--ink-3);
  padding: 0 2px 9px;
  position: relative;
}

.login-tab button.active {
  color: var(--ink);
  font-weight: 600;
}

.login-tab button.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--sage-deep);
}

.login-foot {
  margin-top: auto;
  padding-top: 26px;
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.8;
}

/* 登录页：仅在这台电脑上打开时，显示手机 / 平板该输入的地址 */
.lan-tip {
  margin-top: 18px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(124, 149, 135, 0.5);
  border-radius: 13px;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-2);
  text-align: center;
}

.lan-tip b {
  display: inline-block;
  margin-top: 3px;
  font-size: 15px;
  letter-spacing: 0.3px;
  color: var(--sage-deep);
  word-break: break-all;
}

.login-err {
  font-size: 11.5px;
  color: var(--danger);
  min-height: 16px;
  padding: 6px 2px 0;
}

/* -------------------------------- Toast --------------------------------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translate(-50%, 12px);
  background: rgba(51, 47, 44, 0.92);
  color: #fff;
  font-size: 12.5px;
  padding: 9px 16px;
  border-radius: 11px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.24s ease;
  max-width: 76vw;
  text-align: center;
  backdrop-filter: blur(6px);
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 生成中遮罩 */
.loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(52, 46, 41, 0.35);
  z-index: 150;
  display: grid;
  place-items: center;
  backdrop-filter: blur(2px);
}

.loading-box {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #e3dbd3;
  border-top-color: var(--sage);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   v2 新增：登录改版 / 平板布局 / 滚动时间选择 / 3:4 画幅 / 多店铺
   ========================================================================== */

/* 登录页：整体居中 */
.login-view {
  align-items: center;
}

.login-inner {
  align-items: center;
  justify-content: center;
  padding-top: calc(12vh + env(safe-area-inset-top));
}

.login-top {
  padding-top: 0;
  text-align: center;
}

.login-logo {
  margin: 0 auto 20px;
  font-size: 28px;
}

.login-card {
  width: 100%;
  text-align: left;
}

.login-tab {
  justify-content: center;
  gap: 28px;
}

.login-foot {
  text-align: center;
}

/* 主框架：移动端单列，平板双列（侧边导航） */
.app-frame {
  max-width: 460px;
  flex-direction: column;
}

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

.side-nav {
  display: none;
}

/* 3:4 画幅，完整显示不裁切 */
.upload-zone {
  height: auto;
  aspect-ratio: 3 / 4;
  max-height: 46vh;
}

.uz-inner {
  padding: 18px;
}

.preview-box img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  max-height: 46vh;
  object-fit: contain;
  background: #f7f3ee;
}

/* 滚动时间选择 */
.time-btn {
  justify-content: space-between;
  color: var(--ink);
  font-size: 14.5px;
  text-align: left;
}

.picker-wrap {
  margin: 4px 0 6px;
}

.picker {
  position: relative;
  display: flex;
  gap: 6px;
  height: 216px;
  padding: 0 2px;
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
}

.picker::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 86px;
  height: 44px;
  border-radius: 12px;
  background: var(--sage-soft);
  pointer-events: none;
  z-index: 0;
}

.picker-col {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
  padding: 86px 0;
}

.picker-col::-webkit-scrollbar {
  display: none;
}

.picker-col button {
  height: 44px;
  width: 100%;
  border-radius: 12px;
  scroll-snap-align: center;
  font-size: 16px;
  color: var(--ink-3);
  transition: color 0.15s, font-weight 0.15s;
}

.picker-col button.on {
  color: var(--sage-deep);
  font-weight: 600;
  font-size: 17px;
}

.picker-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.picker-actions .ghost-btn {
  height: 46px;
  padding: 0 18px;
}

/* 夹心可选数量设置 */
.setting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 13px 14px;
}

.setting-card b {
  font-size: 13px;
  font-weight: 600;
}

.setting-card p {
  margin: 2px 0 0;
  font-size: 10.5px;
  color: var(--ink-3);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 3px;
}

.stepper button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.stepper span {
  min-width: 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--sage-deep);
}

/* 店铺管理 */
.tenant-row {
  background: #fff;
  border: 1px solid #f3ede7;
  border-radius: 16px;
  padding: 13px 14px;
  margin-bottom: 9px;
  box-shadow: var(--shadow-soft);
}

.tenant-row.off {
  opacity: 0.6;
}

.tenant-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tenant-top h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-status {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--sage-soft);
  color: var(--sage-deep);
  flex-shrink: 0;
}

.tenant-status.off {
  background: #f2ece7;
  color: var(--ink-3);
}

/* 版本徽标：单店版 / 连锁版 */
.tenant-status.type {
  background: var(--sand-soft, #f3e9dd);
  color: #a1825f;
}

/* 连锁总账号：当前正在管理的门店高亮 */
.tenant-row.cur {
  border-color: var(--sage-deep, #8fa79b);
  box-shadow: 0 0 0 1px var(--sage-deep, #8fa79b) inset;
}

/* 列表分页器（商户列表 / 订单中心共用） */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 6px 6px;
}

.pager-btn {
  min-height: 34px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid #e7dfd5;
  background: #fff;
  color: var(--ink-2, #4a4038);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.pager-btn:active {
  background: #f7f4ef;
}

.pager-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.pager-info {
  font-size: 12px;
  color: var(--ink-3, #8b8179);
}

.pager-info b {
  color: var(--ink-1, #2b2622);
}

/* 连锁统一配置下发：模板摘要 */
.config-summary {
  background: var(--surface-2, #f7f4ef);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.config-line {
  font-size: 12px;
  color: var(--ink-2);
  min-width: 42%;
}
.config-line b {
  color: var(--ink-3);
  font-weight: 500;
  margin-right: 6px;
}

.tenant-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--ink-3);
}

.tenant-meta b {
  color: var(--ink-2);
  font-weight: 600;
}

.tenant-code {
  font-family: 'SF Mono', Menlo, monospace;
  letter-spacing: 1px;
  color: var(--sage-deep);
  font-weight: 600;
}

.tenant-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-2);
}

.tenant-ops button {
  flex: 1 1 calc(33.33% - 6px);
  height: 30px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tenant-ops button.wide {
  flex: 1 1 calc(50% - 6px);
  background: var(--sage-soft);
  color: var(--sage-deep);
  border-color: rgba(148, 173, 158, 0.45);
  font-weight: 500;
}

/* 管理平台统计条：本月新开 / 连锁版 / 单店版 */
.platform-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 4px;
  padding: 9px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--ink-2);
}

.platform-stats b {
  font-size: 14px;
  color: var(--ink);
}

.platform-stats .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-2, #ccc);
}

/* 连锁版旗下门店折叠开关 */
.chain-toggle {
  display: block;
  width: 100%;
  margin: -4px 0 8px;
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--sage-deep);
  background: var(--sage-soft, #eef3ef);
  border: 1px solid rgba(148, 173, 158, 0.35);
  border-radius: 10px;
}

/* 折叠展开后的旗下门店卡片：缩进 + 弱化边框 */
.tenant-row.sub {
  margin: 0 0 8px 18px;
  border-style: dashed;
  opacity: 0.96;
}

.tenant-row.sub .tenant-ops button {
  height: 28px;
  font-size: 11px;
}

/* 开通成功后的专属链接展示 */
.link-label {
  margin-top: 12px;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.4px;
}

.link-box {
  margin-top: 5px;
  padding: 9px 11px;
  border-radius: 11px;
  background: #fff;
  border: 1px dashed #c6d6cc;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--sage-deep);
  word-break: break-all;
  font-family: 'SF Mono', Menlo, monospace;
  user-select: all;
  -webkit-user-select: all;
}

/* 账户创建成功卡片 */
.created-card {
  background: var(--sage-soft);
  border: 1px dashed #b9cdc2;
  border-radius: 14px;
  padding: 13px;
}

.created-card .row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 4px 0;
  color: var(--ink-2);
}

.created-card .row b {
  color: var(--ink);
  font-family: 'SF Mono', Menlo, monospace;
}

/* ============================ 平板 / iPad ============================ */

@media (min-width: 760px) {
  body {
    background: #ddd5cb;
  }

  .app-frame {
    max-width: none;
    flex-direction: row;
    height: 100dvh;
    background: var(--bg);
  }

  .side-nav {
    display: flex;
    flex-direction: column;
    width: 218px;
    flex-shrink: 0;
    padding: 22px 14px 18px;
    background: linear-gradient(170deg, #f7f3ee, #efe7de);
    border-right: 1px solid #e7ddd3;
  }

  .side-brand {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 0 6px 20px;
  }

  .side-brand .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 17px;
  }

  .side-brand b {
    display: block;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: 0.2px;
  }

  .side-brand small {
    display: block;
    margin-top: 4px;
    font-size: 10.5px;
    color: var(--ink-3);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .side-links {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
  }

  .side-links button {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 13px;
    color: var(--ink-2);
    text-align: left;
    transition: background 0.15s, color 0.15s;
  }

  .side-links button .icon {
    width: 17px;
    height: 17px;
    color: var(--ink-3);
  }

  .side-links button.active {
    background: #fff;
    color: var(--sage-deep);
    font-weight: 600;
    box-shadow: var(--shadow-soft);
  }

  .side-links button.active .icon {
    color: var(--sage-deep);
  }

  .side-foot {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 8px 0;
    border-top: 1px solid #e3d9cf;
    margin-top: 10px;
  }

  .side-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: var(--sage-deep);
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
  }

  .side-foot b {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
  }

  .side-foot small {
    font-size: 10px;
    color: var(--ink-3);
  }

  .appbar {
    display: none;
  }

  .page {
    padding: 26px 30px 40px;
  }

  .page[data-page='orders'] {
    padding: 26px 0 0;
  }

  .page[data-page='orders'] .page-head,
  .page[data-page='orders'] .orders-toolbar {
    padding-left: 30px;
    padding-right: 30px;
  }

  .page-head {
    position: static;
    background: none;
    padding-bottom: 16px;
  }

  .page-head .back-btn {
    display: none;
  }

  .page-head h2 {
    font-size: 20px;
  }

  .page-head .head-action {
    height: 34px;
    padding: 0 14px;
    font-size: 12.5px;
  }

  .home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    max-width: 1080px;
    margin: 0 auto;
  }

  .home-right {
    position: static;
  }

  .hero {
    padding: 16px;
  }

  .upload-zone {
    max-height: none;
    aspect-ratio: 4 / 3;
  }

  .preview-box img {
    max-height: none;
    aspect-ratio: 3 / 4;
  }

  .module-grid {
    gap: 12px;
  }

  .module-card {
    padding: 15px 14px 14px;
  }

  .module-card h3 {
    font-size: 14.5px;
  }

  .orders-list {
    padding-right: 30px;
    padding-left: 8px;
  }

  .filter-rail {
    width: 96px;
    padding-left: 22px;
  }

  .filter-rail button {
    font-size: 12.5px;
  }

  .kpi .value {
    font-size: 24px;
  }

  .page[data-page='stats'],
  .page[data-page='flavors'],
  .page[data-page='specs'],
  .page[data-page='invite'],
  .page[data-page='platform'] {
    max-width: 820px;
    margin: 0 auto;
  }

  .flavor-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .sheet {
    max-width: 560px;
    border-radius: 24px 24px 0 0;
  }

  .login-inner {
    max-width: 440px;
    padding-top: 0;
    justify-content: center;
  }

  .login-card {
    padding: 24px 22px;
  }
}

@media (min-width: 1100px) {
  .side-nav {
    width: 240px;
    padding: 26px 18px 20px;
  }

  .home-grid {
    gap: 30px;
  }

  .page {
    padding: 30px 40px 46px;
  }
}

/* 横屏手机：压缩首屏高度 */
@media (max-height: 500px) and (orientation: landscape) {
  .upload-zone,
  .preview-box img {
    max-height: 60vh;
  }

  .appbar {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

/* 选择器底部按钮防换行 */
.picker-actions .ghost-btn {
  flex: 0 0 auto;
  min-width: 96px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 邀请页完整链接展示 */
.invite-link-tip {
  margin: 12px 2px 0;
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.6;
}

.invite-link-text {
  margin: 6px 2px 0;
  font-size: 10.5px;
  color: var(--sage-deep);
  word-break: break-all;
  line-height: 1.5;
  opacity: 0.85;
}

/* ==========================================================================
   v4：iPad 点击命中修正 / 表单控件不溢出 / 四按钮换行
   ========================================================================== */

/* 说明：表单列一律不使用 position: sticky。
   iPad Safari 在内部滚动容器里 sticky 会出现「点击命中偏移」，
   表现为点「生成订单图」却命中上方日期输入、弹出日历，故彻底改为静态布局。 */

/* 日期控件在 iOS 上原生宽度会撑破弹性布局，导致覆盖相邻元素的可点区域 */
.field-row > .field {
  min-width: 0;
}

#fDate {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

/* 提升移动端点击响应、避免 300ms 延迟造成的误触 */
button,
.chip,
.size-chip,
.module-card,
.icon-chip {
  touch-action: manipulation;
}

/* 店铺卡片四个操作按钮：允许换行 */
.tenant-ops {
  flex-wrap: wrap;
}

.tenant-ops button {
  flex: 1 1 calc(50% - 6px);
  min-width: 104px;
}

/* ==========================================================================
   v5：链接外观（品牌图标 / 登录页品牌区 / 分享文案配套样式）
   ========================================================================== */

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: none;
  box-shadow: 0 14px 30px rgba(109, 136, 123, 0.35);
}

/* 品牌 mark 使用图片图标后的自适应 */.brand-mark {
  object-fit: cover;
  background: none;
  box-shadow: 0 6px 16px rgba(109, 136, 123, 0.28);
}


/* ============================ v6：状态 / 底栏 / 多图 ============================ */

/* 订单制作状态标签 */
.st-tag {
  font-size: 10.5px;
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.st-tag.make {
  background: #F8DFC2;
  color: #A5581B;
}

.st-tag.wait {
  background: #DCE8F4;
  color: #3E6B96;
}

.st-tag.done {
  background: var(--sage-soft);
  color: var(--sage-deep);
}

/* 订单状态筛选条：与日期筛选叠加 */
.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.status-chips button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line-2);
  transition: all 0.15s ease;
}

.status-chips button small {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--sand-soft);
  border-radius: 999px;
  padding: 1px 7px;
}

.status-chips button.active {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

.status-chips button.active small {
  color: #fff;
  background: rgba(255, 255, 255, 0.28);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

/* 底部菜单栏（仅手机竖屏显示） */
.tabbar {
  display: none;
}

/* 多图缩略 */
.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.thumbs .thumb {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
}

.thumbs .thumb.main {
  border-color: var(--sage);
}

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

.thumbs .thumb i {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(51, 47, 44, 0.65);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* 支付方式设置行 */
.pay-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line-2);
}

.pay-set-row:last-of-type {
  border-bottom: 0;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-row input:checked + .switch {
  background: var(--sage);
}

.switch-row input:checked + .switch::after {
  transform: translateX(16px);
}

/* 手机竖屏：显示底部菜单栏，页面底部留出空间 */
@media (max-width: 759px) {
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(96, 81, 68, 0.07);
  }

  .tabbar button {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 9px;
    color: var(--ink-3);
    padding: 3px 0;
    touch-action: manipulation;
  }

  .tabbar button span {
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: clip;
    letter-spacing: -0.2px;
  }

  .tabbar button .icon {
    width: 19px;
    height: 19px;
  }

  .tabbar button.active {
    color: var(--sage-deep);
    font-weight: 600;
  }

  .page {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

/* 平板 / PC：底栏隐藏，保持侧边导航 */
@media (min-width: 760px) {
  .tabbar {
    display: none;
  }
}


/* 数据中心时间筛选：横向滚动条 */
#statRail {
  width: auto;
  display: flex;
  flex-direction: row;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 2px 6px;
}

#statRail button {
  width: auto;
  flex-shrink: 0;
  padding: 7px 14px;
  margin-bottom: 0;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
}

#statRail button.active {
  background: var(--sage-soft);
  border-color: rgba(148, 173, 158, 0.45);
}

#statRail button.active::before {
  display: none;
}

#customRangeBar {
  margin: 8px 0 4px;
}

/* ---------------- A4 彩色打印（浏览器系统打印通道） ---------------- */
/* #printA4 由 app.js 动态插入 body，平时隐藏；打印时只显示它，应用界面全部隐藏 */
#printA4 {
  display: none;
}
@media print {
  @page {
    size: A4;
    margin: 12mm;
  }
  html,
  body {
    background: #fff !important;
    height: auto !important;
    overflow: visible !important;
  }
  body > *:not(#printA4) {
    display: none !important;
  }
  #printA4 {
    display: block !important;
    position: static !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
}

/* ---------------- 打印设置 · 小票排版参数与预览 ---------------- */
.rc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin-top: 6px;
}

.rc-grid .field {
  margin-bottom: 0;
}

.rc-grid .field > label {
  font-size: 11.5px;
  color: var(--ink-3);
}

.rc-preview {
  margin: 0;
  padding: 10px 12px;
  background: #fbfaf7;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-2);
  white-space: pre;
  overflow-x: auto;
  max-height: 330px;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 360px) {
  .rc-preview {
    font-size: 10px;
  }
}
