:root {
  --primary: #f45d5c;
  --primary-dark: #e93d3d;
  --bg: #f5f5f5;
  --card: #fff;
  --text: #333;
  --muted: #888;
  --border: #eee;
  --tabbar-height: 52px;
  --chat-composer-height: 58px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --viewport-height: 100dvh;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: PingFang SC, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #f7f7f8;
  -webkit-tap-highlight-color: transparent;
}

body {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

#app {
  min-height: calc(var(--viewport-height, 100vh) - var(--tabbar-height) - var(--safe-bottom));
  padding-bottom: 8px;
}

.has-tabbar #app {
  min-height: calc(var(--viewport-height, 100vh) - var(--tabbar-height) - var(--safe-bottom));
  padding-bottom: 64px;
}

.hidden { display: none !important; }

/* Tab bar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--tabbar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid #f0f0f0;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  display: flex;
  z-index: 100;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #999;
  font-size: 11px;
  gap: 1px;
  padding-top: 4px;
}

.tab-item.active { color: var(--primary); }
.tab-icon { font-size: 20px; line-height: 1; }
.tab-svg {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
}

.tab-item.active .tab-svg {
  stroke-width: 2.2;
}

#page-dynamic.hidden,
#page-home.hidden {
  display: none;
}

/* Header */
.page-header {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-header h1 {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
}

.btn-back {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-header-refresh {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.65);
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-header-refresh:disabled {
  opacity: 0.6;
  cursor: default;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.loot-layout-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.btn-header-more {
  border: 0;
  background: transparent;
  padding: 0 4px;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 1px;
  cursor: pointer;
}

.loot-products-header .btn-header-more {
  color: #222;
}

.loot-layout-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 132px;
  overflow: hidden;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.loot-layout-menu-item {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  padding: 12px 14px;
  color: #333;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.loot-layout-menu-item + .loot-layout-menu-item {
  border-top: 1px solid #f2f2f2;
}

.loot-layout-menu-item.is-active {
  color: #1677ff;
  font-weight: 600;
  background: #f5f9ff;
}

.loot-layout-menu-item:active {
  background: #f7f7f7;
}

.loot-sort-menu-wrap .loot-layout-menu {
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
}

.btn-header-link {
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  text-decoration: none;
  white-space: nowrap;
}

.loot-history-tip {
  margin: 12px 16px 0;
  font-size: 12px;
  color: #888;
}

/* 抢购专区：场次列表与顶栏留出间距 */
.loot-page {
  display: flex;
  flex-direction: column;
}
.loot-page > .page-header {
  flex-shrink: 0;
}
.loot-page [data-loot-subarea-list] {
  padding: 20px 0 24px;
}
.loot-page [data-loot-subarea-list] .loot-festive-list {
  width: 100%;
  padding-top: 0;
  padding-bottom: 0;
}

.loot-time-diagnostic {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  color: #5f4300;
  background: #fff8df;
  font-size: 12px;
  line-height: 1.7;
}
.loot-time-diagnostic > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.loot-time-diagnostic strong {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: right;
  overflow-wrap: anywhere;
}

/* Cards & lists */
.card {
  background: var(--card);
  border-radius: 8px;
  margin: 12px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.list-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.list-item:active { background: #fafafa; }

.thumb {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
  background: #f0f0f0;
  flex-shrink: 0;
}

.item-body { flex: 1; min-width: 0; }
.item-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-meta { color: var(--muted); font-size: 12px; line-height: 1.6; }
.price { color: var(--primary); font-weight: 600; font-size: 16px; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 22px;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}

.form-input:focus { border-color: var(--primary); }

.login-page {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--primary) 0%, #fff 45%);
  padding: 48px 24px 24px;
}

.has-tabbar .login-page {
  min-height: calc(100vh - 52px - var(--safe-bottom));
  padding-bottom: 16px;
}

.login-logo {
  text-align: center;
  color: #fff;
  margin-bottom: 32px;
}

.login-logo h2 { font-size: 28px; margin-bottom: 8px; }

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: #666;
}

.auth-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}

.auth-link:active {
  opacity: 0.75;
}

/* 注册页布局：保留品牌区 + 适中间距 + 底部操作栏固定 */
.login-page.is-register {
  display: flex;
  flex-direction: column;
  padding: 22px 18px 0;
}

.has-tabbar .login-page.is-register {
  min-height: calc(100vh - 52px - var(--safe-bottom));
}

.login-page.is-register .login-logo {
  margin-bottom: 14px;
}

.login-page.is-register .login-logo h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

.login-page.is-register .login-logo p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  opacity: .95;
}

.login-page.is-register .login-card {
  flex: 0 1 auto;
  padding: 16px 16px 12px;
}

.login-page.is-register .form-group {
  margin-bottom: 10px;
}

.login-page.is-register .form-group label {
  margin-bottom: 4px;
  font-size: 13px;
}

.login-page.is-register .form-input {
  padding: 10px 12px;
  font-size: 15px;
}

.login-page.is-register .form-error {
  min-height: 0;
  margin-top: 0;
  font-size: 12px;
  line-height: 1.35;
}

.login-page.is-register .form-error:not(:empty) {
  margin-top: 4px;
}

.login-page.is-register .invite-register-tip {
  margin-bottom: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

.register-form {
  display: block;
}

.register-form-fields {
  overflow: visible;
}

.register-form-actions {
  position: sticky;
  bottom: 0;
  margin-top: 4px;
  padding-top: 10px;
  background: linear-gradient(to top, #fff 88%, rgba(255, 255, 255, .94));
  border-top: 1px solid rgba(0, 0, 0, .05);
}

.register-form-actions .auth-agreement {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.5;
}

.register-form-actions .btn {
  margin-top: 0;
}

.register-form-actions .auth-footer {
  margin: 10px 0 0;
  font-size: 13px;
}

@media (max-height: 700px) {
  .login-page.is-register {
    padding-top: 14px;
  }

  .login-page.is-register .login-logo {
    margin-bottom: 10px;
  }

  .login-page.is-register .login-logo h2 {
    font-size: 22px;
  }

  .login-page.is-register .login-card {
    padding: 14px 14px 10px;
  }

  .login-page.is-register .form-group {
    margin-bottom: 8px;
  }

  .login-page.is-register .form-input {
    padding: 9px 11px;
    font-size: 14px;
  }
}

/* Banner */
.banner-wrap {
  margin: 12px;
  border-radius: 8px;
  overflow: hidden;
}

.banner-img {
  width: 100%;
  display: block;
  aspect-ratio: 2/1;
  object-fit: cover;
  background: #eee;
}

/* Tabs inline */
.inline-tabs {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.inline-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.inline-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* Status badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: #f0f0f0;
  color: var(--muted);
}

.badge-warn { background: #fff3e0; color: #e65100; }
.badge-ok { background: #e8f5e9; color: #2e7d32; }
.badge-processing { background: #e3f2fd; color: #1565c0; }

.subarea-status { margin-top: 6px; }
.subarea-time { margin-top: 6px; font-size: 12px; color: #888; }
.subarea-countdown {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
}
.countdown-label { color: #666; font-weight: 600; }
.countdown-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  color: #e65100;
  letter-spacing: 1px;
}
.subarea-closed {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #999;
}
.subarea-banner { margin: 12px; padding: 14px 16px; }

/* 商品列表页：顶栏固定，倒计时覆盖在商品区顶部，仅商品区滚动。 */
body.has-tabbar:has(.loot-products-page) {
  overflow: hidden;
  height: 100%;
}
.has-tabbar #app:has(.loot-products-page) {
  padding-bottom: 0;
  min-height: 0;
  height: calc(100vh - 52px - var(--safe-bottom));
  overflow: hidden;
}
.has-tabbar #page-dynamic:has(.loot-products-page) {
  height: 100%;
}
.loot-products-page {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}
.loot-products-page > .page-header {
  flex-shrink: 0;
  position: relative;
  top: auto;
}
.loot-products-header {
  background: #fff;
  color: #222;
  border-bottom: 1px solid #f0f0f0;
  box-shadow: none;
  display: grid;
  grid-template-columns: minmax(76px, 1fr) minmax(0, 190px) minmax(76px, 1fr);
  gap: 4px;
  min-height: 48px;
  padding: 4px 10px;
}
.loot-products-header .btn-back {
  color: #222;
  justify-self: start;
}
.loot-products-header .btn-header-refresh {
  width: 34px;
  height: 34px;
  border: 0;
  color: #1677ff;
  border-radius: 4px;
  padding: 0;
  font-size: 0;
}
.loot-products-header .btn-header-refresh::before {
  content: "↻";
  display: block;
  font-size: 22px;
  line-height: 34px;
}
.loot-products-header .page-header-actions {
  justify-content: flex-end;
  gap: 2px;
  min-width: 76px;
}
.loot-sort-tabs {
  display: flex;
  align-items: center;
  align-self: stretch;
  min-width: 0;
  gap: 0;
  padding: 0;
  background: #fff;
}
.loot-sort-tab {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 2px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.loot-sort-tab.is-active {
  color: #1677ff;
  font-weight: 600;
}
.loot-sort-tab.is-active::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -4px;
  height: 2px;
  background: #1677ff;
  border-radius: 1px;
}
.loot-sort-menu {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  color: #666;
  cursor: pointer;
}
.loot-float-layer {
  /* 脱离文档流后悬浮在商品列表顶部，不再挤占首屏商品展示空间。 */
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: auto;
  max-width: 92vw;
  margin: 0;
  padding: 4px 12px 6px;
}
.loot-float-layer.is-hidden {
  display: none;
}
.loot-schedule-anchor,
.loot-festive-countdown.is-schedule-only {
  display: none;
}
.loot-float-countdown-box {
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .12);
  text-align: center;
}
.loot-float-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.loot-float-digit {
  font-size: 22px;
  font-weight: 700;
  color: #e53935;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.loot-float-sep {
  font-size: 18px;
  font-weight: 700;
  color: #e53935;
  margin: 0 1px;
  line-height: 1;
}
.loot-float-toast {
  pointer-events: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 11px;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  line-height: 1.4;
}
/* 列表模式将倒计时压缩为单行悬浮条，并预留最小安全间距，避免遮挡首条商品名称。 */
.loot-products-page:has(.loot-product-list) .loot-float-layer {
  flex-direction: row;
  gap: 5px;
  width: max-content;
  max-width: calc(100vw - 16px);
  padding: 0;
}
.loot-products-page:has(.loot-product-list) .loot-float-countdown-box {
  padding: 6px 9px;
  border-radius: 6px;
}
.loot-products-page:has(.loot-product-list) .loot-float-digit {
  font-size: 15px;
}
.loot-products-page:has(.loot-product-list) .loot-float-sep {
  font-size: 13px;
}
.loot-products-page:has(.loot-product-list) .loot-float-toast {
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 10px;
}
.loot-products-page:has(.loot-product-list) .loot-products-scroll {
  padding-top: 40px;
}
.loot-products-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.loot-products-pager {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 30;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
  padding-bottom: var(--safe-bottom);
}
.loot-products-pager:empty {
  display: none;
}

/* 商品列表置顶区：倒计时 + 工具栏 */
.loot-products-sticky-head {
  flex-shrink: 0;
  z-index: 40;
  background: var(--bg, #f5f5f5);
  padding-bottom: 2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
}
.loot-products-sticky-head .loot-session-strip {
  margin: 8px 12px 0;
}
.loot-products-sticky-head .loot-toolbar {
  margin: 8px 12px 6px;
}
.loot-session-strip { margin: 10px 12px 8px; }
.loot-session-strip .loot-festive-card { margin: 0; }
.loot-session-strip .loot-countdown-bar { margin: 0; }

/* 商品列表倒计时条（喜庆红） */
.loot-countdown-bar.is-festive {
  position: relative;
  overflow: hidden;
  padding: 14px 14px 13px;
  border-radius: 12px;
  color: #fff;
  background:
    radial-gradient(ellipse 120% 80% at 50% 120%, rgba(120, 8, 12, .55) 0%, transparent 62%),
    linear-gradient(165deg, #d83238 0%, #c4242a 42%, #b01c22 100%);
  box-shadow: 0 8px 22px rgba(160, 24, 30, .28);
}
.loot-countdown-bar.is-festive::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .07;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(255, 255, 255, .12) 18px 19px),
    repeating-linear-gradient(-45deg, transparent 0 24px, rgba(255, 255, 255, .08) 24px 25px);
}
.loot-countdown-bar.is-festive::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 38% 70% at 12% 100%, rgba(90, 6, 10, .55) 0%, transparent 72%),
    radial-gradient(ellipse 42% 75% at 48% 100%, rgba(90, 6, 10, .45) 0%, transparent 74%),
    radial-gradient(ellipse 36% 68% at 86% 100%, rgba(90, 6, 10, .5) 0%, transparent 70%);
}
.loot-countdown-bar-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.loot-countdown-bar-deco::after {
  content: "福 福 福 福 福 福";
  position: absolute;
  inset: 4% 6%;
  color: #fff;
  opacity: .05;
  font-size: 22px;
  line-height: 1.8;
  letter-spacing: 8px;
  word-break: break-all;
  text-align: center;
}
.loot-countdown-bar-cloud {
  position: absolute;
  top: 6px;
  width: 30px;
  height: 16px;
  opacity: .82;
  background:
    radial-gradient(circle at 28% 70%, #f0c85a 0 42%, transparent 44%),
    radial-gradient(circle at 52% 58%, #f0c85a 0 48%, transparent 50%),
    radial-gradient(circle at 76% 72%, #f0c85a 0 40%, transparent 42%);
}
.loot-countdown-bar-cloud-l { left: 8px; }
.loot-countdown-bar-cloud-r { right: 8px; transform: scaleX(-1); }
.loot-countdown-bar.is-festive .loot-countdown-bar-main {
  position: relative;
  z-index: 1;
}
.loot-countdown-bar.is-festive.is-ended {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  opacity: .92;
}
.loot-countdown-bar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.loot-countdown-bar-info {
  min-width: 0;
  flex: 1;
}
.loot-countdown-bar-tag {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 8px;
  border: 1px solid rgba(240, 200, 90, .55);
  border-radius: 999px;
  color: #ffe9a8;
  background: rgba(0, 0, 0, .12);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1.5;
}
.loot-countdown-bar-label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
}
.loot-countdown-bar-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, .82);
  line-height: 1.35;
}
.loot-countdown-bar-timer {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.loot-countdown-bar-digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  border-radius: 4px;
  background: #1a1a1a;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.loot-countdown-bar-sep {
  margin: 0 1px;
  color: #ffe9a8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
.loot-countdown-bar.is-active .loot-countdown-bar-tag {
  border-color: rgba(255, 255, 255, .45);
  color: #fff;
  background: rgba(0, 168, 112, .35);
}

/* 抢购商品双列网格 */
.loot-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}
.loot-product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.loot-product-img-wrap {
  /* 长方形商品图完整居中展示，缩短卡片高度并避免证书或商品主体被裁切。 */
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 6px;
  background: #fff;
  cursor: pointer;
}
.loot-product-img-wrap:active {
  opacity: 0.92;
}
.loot-product-img-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.loot-product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 8px 10px 10px;
}
.loot-product-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: #222;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.loot-product-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  row-gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}
.loot-product-price {
  flex: 1;
  min-width: 0;
  color: #e53935;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.loot-product-buy {
  flex-shrink: 0;
  margin-left: auto;
  padding: 5px 10px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #ff7043 0%, #e53935 100%);
  box-shadow: 0 2px 8px rgba(229, 57, 53, .28);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.loot-product-block-reason {
  margin-top: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  color: #c62828;
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border: 1px solid #ffb74d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}
.loot-product-block-reason.is-sold {
  color: #fff;
  background: #6b7280;
  border-color: #6b7280;
}
/* 已售商品保留在抢购页展示成交结果，通过弱化内容和状态标签避免误认为仍可抢购。 */
.loot-product-card.is-sold,
.loot-product-row.is-sold {
  background: #f8f9fa;
}
.loot-product-card.is-sold img,
.loot-product-row.is-sold img {
  opacity: .48;
  filter: grayscale(70%);
}
.loot-product-card.is-sold .loot-product-name,
.loot-product-row.is-sold .loot-product-row-name,
.loot-product-card.is-sold .loot-product-price,
.loot-product-row.is-sold .loot-product-price {
  color: #8a9099;
}

/* 抢购商品列表布局 */
.loot-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
}
.loot-product-row {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.loot-product-row-img {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  overflow: hidden;
  padding: 4px;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.loot-product-row-img:active {
  opacity: 0.92;
}
.loot-product-row-img img {
  /* 列表缩略图保留完整原图，避免长方形证书或商品在方形容器中被裁切。 */
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.loot-product-row-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}
.loot-product-row-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #222;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.loot-product-row-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}
.loot-product-row .loot-product-block-reason {
  margin-top: 8px;
  text-align: left;
}

/* 抢购节庆卡片 */
.loot-festive-list {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}
html[data-client-theme="jade"] [data-loot-subarea-list] .loot-festive-list {
  padding: 0;
}
.loot-festive-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  color: #fff;
  background:
    radial-gradient(ellipse 120% 80% at 50% 120%, rgba(120, 8, 12, .55) 0%, transparent 62%),
    linear-gradient(165deg, #d83238 0%, #c4242a 42%, #b01c22 100%);
  box-shadow: 0 10px 28px rgba(160, 24, 30, .28);
}
.loot-festive-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .07;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(255, 255, 255, .12) 18px 19px),
    repeating-linear-gradient(-45deg, transparent 0 24px, rgba(255, 255, 255, .08) 24px 25px);
}
.loot-festive-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 38% 70% at 12% 100%, rgba(90, 6, 10, .55) 0%, transparent 72%),
    radial-gradient(ellipse 42% 75% at 48% 100%, rgba(90, 6, 10, .45) 0%, transparent 74%),
    radial-gradient(ellipse 36% 68% at 86% 100%, rgba(90, 6, 10, .5) 0%, transparent 70%);
}
.loot-festive-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.loot-festive-deco::after {
  content: "福 福 福 福 福 福 福 福 福 福 福 福";
  position: absolute;
  inset: 6% 4%;
  color: #fff;
  opacity: .05;
  font-size: 26px;
  line-height: 2.1;
  letter-spacing: 10px;
  word-break: break-all;
  text-align: center;
}
.loot-festive-cloud {
  position: absolute;
  top: 8px;
  width: 34px;
  height: 18px;
  opacity: .82;
  background:
    radial-gradient(circle at 28% 70%, #f0c85a 0 42%, transparent 44%),
    radial-gradient(circle at 52% 58%, #f0c85a 0 48%, transparent 50%),
    radial-gradient(circle at 76% 72%, #f0c85a 0 40%, transparent 42%);
}
.loot-festive-cloud-l { left: 10px; }
.loot-festive-cloud-r { right: 10px; transform: scaleX(-1); }
.loot-festive-body {
  position: relative;
  z-index: 1;
  padding: 18px 14px 42px;
  text-align: center;
}
.loot-festive-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.loot-festive-line {
  flex: 1;
  max-width: 72px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9) 35%, rgba(255, 255, 255, .9) 65%, transparent);
}
.loot-festive-heading {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 3px;
  white-space: nowrap;
}
.loot-festive-time {
  margin: 14px 0 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .3px;
}
.loot-festive-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 16px;
}
.loot-festive-countdown-label {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.loot-festive-countdown-units {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.loot-festive-digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 5px;
  border-radius: 4px;
  background: #1a1a1a;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.loot-festive-unit {
  font-size: 14px;
  font-weight: 500;
}
.loot-festive-closed {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  opacity: .88;
}
.loot-festive-badge {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.loot-festive-badge.is-open {
  color: #fff;
  background: #00a870;
}
.loot-festive-badge.is-waiting {
  color: #5c3d00;
  background: #f5c842;
}
.loot-festive-badge.is-closed {
  color: rgba(255, 255, 255, .92);
  background: rgba(0, 0, 0, .28);
}
.loot-festive-badge.is-settle {
  color: #5c3d00;
  background: linear-gradient(135deg, #ffe7a3, #f5c842);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.loot-festive-settle-hint {
  margin: 10px 0 6px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  color: #fff8e8;
  text-shadow: 0 1px 3px rgba(80, 0, 0, .45);
}
.loot-festive-card.loot-item.is-settle {
  cursor: pointer;
}
.loot-festive-card.loot-item.is-settle:active {
  transform: scale(.985);
}
.loot-festive-card.loot-item {
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.loot-festive-card.loot-item:active {
  transform: scale(.985);
}
.loot-festive-card.loot-item.is-disabled {
  opacity: .82;
  cursor: not-allowed;
}
.loot-festive-banner {
  box-shadow: 0 8px 22px rgba(160, 24, 30, .22);
}
.loot-toolbar { display: flex; align-items: center; gap: 8px; margin: 12px 12px 8px; }
.loot-product-count { flex: 1; color: var(--muted); font-size: 12px; }
.loot-settle-link { border: 0; padding: 7px 4px; color: #1677ff; background: transparent; cursor: pointer; white-space: nowrap; }
.loot-toolbar .loot-sort-row { display: flex; align-items: center; gap: 5px; margin: 0; padding: 0; color: var(--muted); white-space: nowrap; }
.loot-toolbar .loot-sort-row select { min-width: 132px; }
@media (max-width: 380px) {
  .loot-toolbar { gap: 3px; }
  .loot-settle-link { padding-inline: 2px; }
  .loot-toolbar .loot-sort-row select { min-width: 122px; }
  .loot-festive-time { font-size: 15px; }
  .loot-festive-countdown { gap: 5px 6px; }
  .loot-festive-digit { min-width: 26px; height: 26px; font-size: 14px; }
  .loot-countdown-bar-main { gap: 8px; }
  .loot-countdown-bar-digit { min-width: 24px; height: 26px; font-size: 14px; }
  .loot-countdown-bar-sep { font-size: 14px; }
  .loot-countdown-bar-timer { padding: 5px 6px; }
  .loot-countdown-bar-label { font-size: 14px; }
  .loot-float-digit { font-size: 20px; }
  .loot-float-sep { font-size: 16px; }
  .loot-float-countdown-box { padding: 8px 12px; }
  .loot-sort-tab { font-size: 12px; padding: 11px 2px; }
  .loot-product-buy { padding: 5px 8px; font-size: 10px; }
  .loot-product-price { font-size: 13px; }
}
.list-item.is-disabled { opacity: 0.72; cursor: not-allowed; }
.list-item.is-sold .thumb { opacity: 0.55; }
.list-item.is-sold .btn-buy { background: #ccc; border-color: #ccc; }
.list-item.loot-item { cursor: pointer; }
.btn-buy:disabled { opacity: 0.5; cursor: not-allowed; }

.bill-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 12px 0;
}
.bill-tab {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
  color: #666;
  font-size: 14px;
  cursor: pointer;
}
.bill-tab.active {
  background: #fff5f5;
  border-color: #f45d5c;
  color: #f45d5c;
  font-weight: 600;
}
.my-orders-page .bill-tabs {
  justify-content: center;
  gap: 6px;
}
.my-orders-page .bill-tab {
  flex: 0 1 68px;
  padding: 8px 6px;
  border-radius: 7px;
  font-size: 13px;
}
.bill-summary {
  margin: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bill-summary-label { color: #666; font-size: 14px; }
.bill-summary-value { font-size: 22px; font-weight: 700; color: #f45d5c; }
.bill-settle-page { padding-bottom: 12px; }
.bill-settle-sticky-head {
  position: sticky;
  top: 0;
  z-index: 50;
}
.bill-settle-product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}
.bill-settle-product-card {
  padding: 8px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}
.bill-settle-product-card-clickable {
  cursor: pointer;
}
.bill-settle-product-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: #f5f5f5;
}
.bill-settle-product-name {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.bill-settle-product-price {
  margin-top: 4px;
  color: #f45d5c;
  font-size: 14px;
  font-weight: 700;
}
.bill-product-empty {
  margin: 0 12px;
  padding: 24px 12px;
  color: #999;
  font-size: 13px;
  text-align: center;
}
.bill-settle-detail {
  margin: 0 12px 12px;
  padding: 0;
  overflow: hidden;
}
.bill-settle-detail-empty .bill-settle-row { padding: 14px 16px; }
.bill-settle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
}
.bill-settle-row:last-child { border-bottom: none; }
.bill-settle-row strong { font-weight: 600; text-align: right; }
.bill-settle-status-row .badge { flex-shrink: 0; }
.bill-amount-payable { color: #f45d5c; font-weight: 700; }
.bill-amount-receivable { color: #52c41a; font-weight: 700; }
.bill-settle-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid #eee;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}
.bill-settle-footer-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #333;
}
.bill-settle-footer-receive .bill-settle-footer-text { color: #389e0d; }
.bill-settle-footer-pay .bill-settle-footer-text { color: #cf1322; }
.section-title {
  margin: 16px 12px 8px;
  font-size: 13px;
  color: #999;
  font-weight: 600;
}
.link-card {
  margin: 12px;
  padding: 14px 16px;
  color: #1677ff;
  font-size: 14px;
  cursor: pointer;
}
.pay-item { cursor: pointer; position: relative; }
.pay-item-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #ccc;
  font-size: 20px;
}
.muted { color: #999; font-size: 12px; }
.pay-detail-card .pay-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
}
.pay-detail-card .pay-detail-row:last-child { border-bottom: none; }
.pay-method { margin-top: 12px; text-align: center; }
.pay-method-empty { padding: 12px 0; text-align: center; font-size: 13px; }
.pay-method-title { margin-bottom: 8px; color: #666; font-size: 13px; }
.pay-qr { max-width: 220px; width: 100%; border-radius: 8px; }
.btn-save-pay-image { display: block; margin: 10px auto 0; min-width: 132px; }
.pay-voucher { max-width: 100%; border-radius: 8px; }
.pay-action-box { padding: 16px 12px 24px; }
.pay-voucher-preview { display: block; width: 100%; max-height: 320px; margin-bottom: 12px; border-radius: 8px; object-fit: contain; background: #f5f5f5; }
.pay-voucher-preview.hidden { display: none; }
.pay-voucher-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-voucher-actions .btn { margin: 0; }

/* Warehouse grid */
.warehouse-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px;
  background: var(--bg);
}

.warehouse-card {
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.warehouse-card:active {
  opacity: 0.92;
}

.warehouse-card-img {
  width: 100%;
  aspect-ratio: 1.08 / 1;
  overflow: hidden;
  background: #f0f0f0;
  border-radius: 6px;
}

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

.warehouse-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  padding: 9px 0 2px;
}

.warehouse-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: auto;
}

.warehouse-card-price {
  min-width: 0;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.warehouse-card-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
}

.warehouse-card-status.is-pending { color: #f5a623; }
.warehouse-card-status.is-listed { color: #2e7d32; }
.warehouse-card-status.is-disabled { color: #e65100; }
.warehouse-card-status.is-sync-highlight {
  animation: warehouse-status-highlight 1s ease;
}
@keyframes warehouse-status-highlight {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; transform: scale(1.05); }
}
.action-bar.hidden { display: none; }
.warehouse-orders-list { padding: 12px; background: var(--bg); }

/* Empty */
.empty-hint {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #999;
  line-height: 1.5;
  font-weight: 400;
}

.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

/* User page */
.user-header {
  background: var(--primary);
  color: #fff;
  padding: 24px 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  object-fit: cover;
}

.user-name { font-size: 18px; font-weight: 600; }
.user-name-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.user-name-edit > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-name-edit-icon { flex-shrink: 0; color: var(--primary); font-size: 15px; }
.user-mobile { font-size: 13px; opacity: .85; margin-top: 4px; }

.money-card {
  margin: -16px 12px 12px;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  text-align: center;
}

.money-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

/* Detail */
.detail-img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  background: #fff;
  display: block;
}

.detail-info { padding: 16px; background: #fff; }
.detail-info h2 { font-size: 18px; margin-bottom: 12px; }
.goods-detail-card { margin-top: 12px; }
.goods-rich-content {
  padding: 12px 16px 16px;
  line-height: 1.7;
  font-size: 14px;
  color: #333;
  word-break: break-word;
}
.goods-rich-content img { max-width: 100%; height: auto; display: block; margin: 10px 0; border-radius: 6px; }
.goods-rich-content p { margin: 0 0 10px; }

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.info-row span:first-child { color: var(--muted); }

.action-bar {
  padding: 16px;
  background: #fff;
  position: sticky;
  bottom: 0;
}

/* Coupon select */
.coupon-list { margin-top: 12px; }
.coupon-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}

.coupon-item.selected {
  border-color: var(--primary);
  background: #fff5f5;
}

.grounding-tip {
  margin: 8px 0 0;
  text-align: center;
  font-size: 13px;
  color: #999;
}

.grounding-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.grounding-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.grounding-card-body {
  flex: 1;
  min-width: 0;
}

.grounding-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.grounding-card-price {
  font-size: 18px;
  font-weight: 700;
}

.grounding-detail {
  margin-top: 0;
}

.grounding-coupon-row {
  align-items: center;
  width: 100%;
  border: none;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.grounding-coupon-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #666;
  font-size: 14px;
}

.grounding-coupon-arrow {
  color: #bbb;
  font-size: 18px;
  line-height: 1;
}

.grounding-balance-hint {
  padding-top: 0;
  margin-top: -8px;
  border-bottom: none;
}

.grounding-balance-hint .muted {
  font-size: 12px;
  color: #999;
}

.grounding-coupon-select {
  flex: 1;
  max-width: 62%;
  border: none;
  background: transparent;
  text-align: right;
  font-size: 14px;
  color: #666;
}

.grounding-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.grounding-sheet.hidden {
  display: none;
}

.grounding-sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.grounding-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 70vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.grounding-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.grounding-sheet-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.grounding-sheet-body {
  padding: 12px 16px 24px;
  overflow-y: auto;
}

.grounding-coupon-option {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.grounding-coupon-option-title {
  display: block;
  font-size: 15px;
  color: #333;
}

.grounding-coupon-option-meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #999;
}

.grounding-notice {
  margin: 12px 16px;
  padding: 12px;
  background: #fafafa;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: #888;
}

.grounding-notice strong {
  color: #e53935;
  font-weight: 600;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  transition: 0.2s;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .switch-slider {
  background: var(--primary);
}

.switch input:checked + .switch-slider:before {
  transform: translateX(20px);
}

.grounding-balance-row {
  align-items: center;
}

.grounding-discount-row.hidden {
  display: none;
}

.grounding-discount-amount {
  color: #43a047;
  font-weight: 600;
}

.grounding-pay-method {
  margin: 12px 16px;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.grounding-pay-method-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.grounding-pay-method-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grounding-pay-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8f8f8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

.grounding-pay-item input[type="radio"] {
  margin: 0;
  accent-color: var(--primary);
}

.grounding-pay-icon {
  font-size: 18px;
}

.grounding-pay-name {
  flex: 1;
}

/* Signing */
.signing-gate { margin-top: 0; }
.signing-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.signing-gate-action { margin-top: 16px; }
.signing-status-card { margin-top: 0; flex-shrink: 0; }
.signing-status-line { margin-bottom: 8px; }
.signing-reject-note {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff3e0;
  color: #e65100;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.signing-image-wrap { margin-top: 12px; text-align: center; }
.signing-image-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.signing-preview {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  object-fit: contain;
  background: #f5f5f5;
}
.signing-preview-sm {
  max-height: 120px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.signing-field-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.signing-prev-sign {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.signing-form-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
  padding-bottom: calc(68px + var(--safe-bottom));
}
.signing-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.signing-name-group {
  flex-shrink: 0;
  margin-bottom: 12px;
}
.signing-signature-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 140px;
  margin-bottom: 0;
}
.signature-pad-wrap {
  position: relative;
  flex: 1;
  min-height: 140px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  touch-action: none;
}
.signature-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
.signature-pad-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 15px;
  pointer-events: none;
}
.signature-pad-placeholder.hidden {
  display: none;
}
.signature-pad-clear {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
}
.btn-ghost {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #e8e8e8;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}
.image-upload-box {
  border: 1px dashed #ddd;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  background: #fafafa;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-upload-placeholder {
  color: var(--muted);
  font-size: 14px;
}
.menu-card { padding: 0; overflow: hidden; }
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #fafafa; }
.menu-item-title { font-size: 15px; font-weight: 500; }
.menu-item-extra {
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-arrow { color: #ccc; font-size: 18px; line-height: 1; }
.menu-hint { padding: 0 16px 12px; margin-top: 0; }

/* User page (new layout) */
.user-page { padding-bottom: 16px; background: #f5f6f8; min-height: 100vh; }
.user-top {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 16px; background: linear-gradient(135deg, #fff 0%, #f8fbff 100%);
}
.user-top-info { flex: 1; min-width: 0; }
.dialog-open { overflow: hidden; }
.profile-dialog {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.profile-dialog.hidden { display: none; }
.profile-dialog-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(0, 0, 0, .45);
}
.profile-dialog-panel {
  position: relative;
  width: min(100%, 360px);
  padding: 22px 18px 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .2);
}
.profile-dialog-title { margin-bottom: 16px; font-size: 18px; font-weight: 600; text-align: center; }
.profile-dialog-help { margin-top: 7px; color: var(--muted); font-size: 12px; }
.profile-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.profile-dialog-actions .btn { width: 100%; }
.user-level-group {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 46%;
}
.user-level-badge {
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #4f8cff);
  box-shadow: 0 2px 8px rgba(47, 111, 235, 0.25);
}
.user-level-badge.is-default {
  color: #666;
  background: #eef1f5;
  box-shadow: none;
}
.user-level-expiry {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.3;
  color: #666;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.user-level-expiry.is-permanent {
  color: #888;
}
.user-level-expiry.is-expired {
  color: #e53935;
}
.member-privilege-card {
  margin: 0 12px 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.member-privilege-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.member-privilege-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
}
.member-privilege-level {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: #eef4ff;
}
.member-privilege-list {
  margin: 0;
  padding-left: 18px;
  color: #555;
  font-size: 13px;
  line-height: 1.7;
}
.user-section { margin: 12px; background: #fff; border-radius: 12px; padding: 14px 12px; }
.user-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 15px; font-weight: 600; }
.user-link { color: #999; font-size: 12px; text-decoration: none; }
.user-order-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.user-order-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: #333; font-size: 12px; }
.user-order-icon-wrap { position: relative; display: inline-flex; }
.user-order-icon { font-size: 22px; }
.user-order-badge {
  position: absolute; top: -4px; right: -10px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #f44336; color: #fff;
  font-size: 10px; line-height: 16px; text-align: center;
  box-sizing: border-box;
}
.user-wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 12px 12px; }
.user-wallet-card { border-radius: 12px; padding: 16px 14px; color: #333; text-decoration: none; }
.user-wallet-balance { background: linear-gradient(135deg, #fff7e8, #ffe9c7); }
.user-wallet-coupon { background: linear-gradient(135deg, #eef6ff, #dbeafe); }
.user-wallet-value { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.user-wallet-label { font-size: 12px; color: #666; }
.user-menu-card { margin: 0 12px 12px; background: #fff; border-radius: 12px; overflow: hidden; }
.user-menu-item { display: flex; align-items: center; gap: 10px; padding: 14px 16px; text-decoration: none; color: inherit; border-bottom: 1px solid #f2f2f2; }
.user-menu-item:last-child { border-bottom: none; }
.user-menu-item.is-disabled { opacity: .45; pointer-events: none; }
.user-menu-icon { width: 28px; text-align: center; font-size: 18px; }
.user-menu-title { flex: 1; font-size: 15px; }
.user-menu-arrow { color: #ccc; font-size: 18px; }
.user-logout-bar { margin: 0 12px 16px; }

/* Address */
.addr-page { padding: 12px 12px 88px; min-height: calc(100vh - 52px); }
.addr-list { display: flex; flex-direction: column; gap: 10px; }
.addr-card { background: #fff; border-radius: 12px; padding: 14px 16px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.addr-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.addr-card-head strong { font-size: 15px; margin-right: 10px; }
.addr-phone { color: #666; font-size: 13px; }
.addr-default { flex-shrink: 0; font-size: 11px; color: #fff; background: var(--primary); border-radius: 10px; padding: 2px 8px; }
.addr-card-detail { font-size: 13px; color: #555; line-height: 1.5; }
.addr-card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #f4f4f4; }
.addr-action { border: none; background: transparent; color: #666; font-size: 13px; padding: 4px 6px; cursor: pointer; }
.addr-action-del { color: #e53935; }
.addr-form { background: #fff; padding-bottom: 88px; min-height: calc(100vh - 52px); }
.addr-region-selects { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.addr-region-selects select {
  width: 100%; border: none; background: transparent; text-align: right; font-size: 14px; outline: none; color: #333;
}
.addr-region-selects select:disabled { color: #bbb; }
.pay-field-top { align-items: flex-start; }
.addr-detail {
  flex: 1; border: none; resize: none; font-size: 14px; outline: none; text-align: right; min-height: 64px; background: transparent; font-family: inherit;
}
.addr-default-row {
  display: flex; align-items: center; gap: 8px; padding: 16px; font-size: 14px; color: #333;
}
.addr-default-row input { width: 16px; height: 16px; }
.addr-save-bar,
.pay-save-bar,
.signing-save-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  bottom: 0;
  padding: 8px 24px calc(8px + var(--safe-bottom));
  background: transparent;
  box-shadow: none;
  z-index: 99;
  box-sizing: border-box;
}
.addr-save-bar .btn,
.pay-save-bar .btn,
.signing-save-bar .btn {
  width: 100%;
  max-width: 100%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.has-tabbar .addr-save-bar,
.has-tabbar .pay-save-bar,
.has-tabbar .signing-save-bar {
  bottom: calc(52px + var(--safe-bottom));
}

/* Payment method */
.page-header-green h1 { color: #333; }
.pay-page { background: #fff; min-height: calc(100vh - 52px); display: flex; flex-direction: column; padding-bottom: 72px; }
.pay-tabs { display: flex; border-bottom: 1px solid #eee; }
.pay-tab { flex: 1; padding: 14px 8px; border: none; background: transparent; font-size: 15px; color: #666; cursor: pointer; }
.pay-tab.active { color: #33a44d; font-weight: 600; box-shadow: inset 0 -2px 0 #33a44d; }
.pay-form { flex: 1; display: flex; flex-direction: column; }
.pay-panel { padding: 8px 0; }
.pay-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #f2f2f2; }
.pay-field-label { flex-shrink: 0; width: 88px; font-size: 14px; color: #333; }
.pay-field-input { flex: 1; border: none; text-align: right; font-size: 14px; outline: none; background: transparent; }
.pay-upload-box { position: relative; flex: 1; }
.pay-upload-box input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.image-upload-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.image-upload-actions .btn { flex: 1 1 120px; min-width: 0; }
.pay-upload-preview { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; display: block; margin-left: auto; }
.pay-upload-placeholder { width: 88px; height: 88px; margin-left: auto; border: 1px dashed #ddd; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #999; text-align: center; padding: 8px; }
.pay-status-tip { padding: 12px 16px; font-size: 13px; color: #666; }
.btn-save { background: #00bc7e; border: none; }

/* Signing page with fixed submit bar */
.signing-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 48px);
  padding-bottom: 72px;
}
.has-tabbar .signing-page {
  min-height: calc(100vh - 48px - 52px - var(--safe-bottom));
}

/* Profit page */
.profit-page {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: #f5f6f8;
  height: calc(100vh - 52px);
  box-sizing: border-box;
}
.profit-page-sticky { flex-shrink: 0; }
.profit-filter-chips { margin-bottom: 10px; }
.profit-filter { text-align: center; font-size: 13px; color: #666; margin-bottom: 12px; }
.profit-summary-card {
  background: linear-gradient(135deg, #4a9df8, #2f7fe8);
  border-radius: 14px; padding: 22px 18px; color: #fff; margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(47, 127, 232, .28);
}
.profit-summary-label { font-size: 14px; opacity: .92; margin-bottom: 8px; }
.profit-summary-value { font-size: 28px; font-weight: 700; }
.profit-list { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.profit-order-card { background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.profit-order-card-clickable { cursor: pointer; }
.profit-order-wait-hint { font-size: 12px; color: #999; margin-top: 6px; }
.profit-order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 12px; margin-bottom: 10px; }
.profit-order-no { color: #666; font-weight: 500; line-height: 1.4; word-break: break-all; }
.profit-order-status { color: #f57c00; flex-shrink: 0; text-align: right; }
.profit-order-body { display: flex; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid #f2f2f2; }
.profit-order-img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: #f5f5f5; flex-shrink: 0; }
.profit-order-main { flex: 1; min-width: 0; }
.profit-order-name { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.profit-order-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.profit-tag { font-size: 12px; padding: 4px 8px; border-radius: 6px; }
.profit-tag.price { background: #fff0ee; color: #c62828; }
.profit-tag.income { background: #e8f5e9; color: #2e7d32; }
.profit-order-users { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #7f4141; }
.profit-order-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; font-size: 12px; color: #999; }
.profit-order-foot .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  box-sizing: border-box;
  line-height: 1;
  text-align: center;
}
.profit-type-badge { padding: 2px 8px; border-radius: 10px; color: #fff; font-size: 11px; }
.profit-type-badge.buy { background: #00bc7e; }
.profit-type-badge.sell { background: #fc8131; }

/* Coupons page */
.page-header-light {
  background: #f5f6f8;
  color: #333;
  box-shadow: none;
}
.page-header-light .btn-back { color: #333; }
.coupon-page {
  padding: 12px 16px 24px;
  background: #f5f6f8;
  min-height: calc(100vh - 52px);
  box-sizing: border-box;
}
.coupon-hero { margin-bottom: 14px; }
.coupon-hero-title { font-size: 24px; font-weight: 700; color: #222; margin: 0 0 6px; }
.coupon-hero-sub { font-size: 13px; color: #999; margin: 0; }
.coupon-stats-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #fff;
  border-radius: 14px;
  padding: 18px 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.coupon-stat-item { text-align: center; }
.coupon-stat-value { font-size: 22px; font-weight: 700; color: #e53935; line-height: 1.2; }
.coupon-stat-label { font-size: 12px; color: #666; margin-top: 6px; }
.coupon-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border-bottom: 1px solid #eee;
}
.coupon-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 8px 10px;
  font-size: 14px;
  color: #999;
  cursor: pointer;
  position: relative;
}
.coupon-tab.active {
  color: #e53935;
  font-weight: 600;
}
.coupon-tab.active::after {
  content: '';
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 0;
  height: 3px;
  background: #e53935;
  border-radius: 2px;
}
.coupon-list { display: flex; flex-direction: column; gap: 12px; }
.coupon-empty { padding: 40px 0; }
.coupon-card {
  display: flex;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
  min-height: 96px;
}
.coupon-card-value {
  width: 108px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff0f0, #ffe8e8);
  border-right: 1px dashed #f0c4c4;
  padding: 12px 8px;
}
.coupon-amount {
  font-size: 20px;
  font-weight: 700;
  color: #e53935;
  text-align: center;
  line-height: 1.3;
}
.coupon-card-body {
  flex: 1;
  min-width: 0;
  padding: 14px 14px 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.coupon-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  margin-bottom: 10px;
  line-height: 1.4;
}
.coupon-card-meta { font-size: 12px; }
.coupon-meta-label { color: #999; display: block; margin-bottom: 4px; }
.coupon-meta-time { color: #333; font-weight: 600; font-size: 13px; }
.user-wallet-card.user-wallet-coupon {
  color: inherit;
  cursor: pointer;
}

/* Team management */
.team-page { padding: 12px; background: #f5f6f8; min-height: calc(100vh - 52px); }
.team-summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px;
}
.team-summary-item {
  background: linear-gradient(135deg, #4a9df8, #2f7fe8);
  border-radius: 12px; padding: 16px; color: #fff; text-align: center;
}
.team-summary-value { font-size: 24px; font-weight: 700; }
.team-summary-label { font-size: 12px; opacity: .9; margin-top: 4px; }
.team-tabs, .team-subtabs {
  display: flex; gap: 8px; margin-bottom: 12px; background: #fff; border-radius: 10px; padding: 4px;
}
.team-tab, .team-subtab {
  flex: 1; border: none; background: transparent; padding: 10px 8px; border-radius: 8px;
  font-size: 14px; color: #666; cursor: pointer;
}
.team-tab.active, .team-subtab.active { background: #e8f4ff; color: #1677ff; font-weight: 600; }
.team-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.team-chip {
  border: 1px solid #d9d9d9; background: #fff; border-radius: 16px; padding: 6px 12px;
  font-size: 12px; color: #666; cursor: pointer;
}
.team-chip.active { border-color: #1677ff; color: #1677ff; background: #e8f4ff; }
.team-search { display: flex; gap: 8px; margin-bottom: 12px; }
.team-search input {
  flex: 1; border: 1px solid #eee; border-radius: 8px; padding: 10px 12px; font-size: 14px;
}
.team-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.team-orders-link { font-size: 13px; color: #1677ff; text-decoration: none; }
.team-list { display: flex; flex-direction: column; gap: 10px; }
.team-pagination {
  display: flex; justify-content: center; align-items: center; gap: 16px;
  padding: 14px 0 4px; color: var(--muted); font-size: 14px;
}
.team-page-btn {
  border: 1px solid #ddd; background: #fff; border-radius: 4px;
  padding: 7px 12px; color: #333; cursor: pointer;
}
.team-member-card {
  display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px;
  padding: 12px; text-decoration: none; color: inherit; box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.team-member-avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #f0f0f0; flex-shrink: 0;
}
.team-member-avatar.lg { width: 64px; height: 64px; }
.team-member-main { flex: 1; min-width: 0; }
.team-member-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.team-member-mobile { font-size: 12px; color: #999; margin-bottom: 6px; }
.team-member-stats { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: #666; }
.team-member-arrow { color: #ccc; font-size: 20px; }
.team-direct-tag {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 500;
  color: #1677ff; background: #e8f4ff; border-radius: 8px; padding: 1px 6px;
}
.team-level-tag {
  display: inline-block; margin-left: 4px; font-size: 10px; font-weight: 500;
  color: #fff; background: #4a9df8; border-radius: 8px; padding: 1px 6px;
}
.team-level-tag.l2 { background: #52c41a; }
.team-level-tag.l3 { background: #faad14; }
.team-level-tag.l4 { background: #9254de; }
.team-level-tag.l5 { background: #8c8c8c; }
.team-member-ref { font-size: 11px; color: #888; margin-bottom: 4px; }
.team-member-ref em { color: #1677ff; font-style: normal; }
.team-tree-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.team-tree-hint { font-size: 12px; color: #999; }
.team-tree-actions { display: flex; gap: 8px; }
.team-tree-btn {
  border: 1px solid #d9d9d9; background: #fff; border-radius: 14px;
  padding: 4px 10px; font-size: 12px; color: #666; cursor: pointer;
}
.team-tree-list { display: flex; flex-direction: column; }
.team-tree-branch {
  margin-bottom: 0;
  padding-left: calc(min(max(var(--tree-depth, 1) - 1, 0), 5) * 14px);
}
.team-tree-node { display: flex; align-items: stretch; gap: 0; margin-bottom: 8px; }
.team-tree-gutter {
  width: 28px; flex-shrink: 0; display: flex; flex-direction: column;
  align-items: center; position: relative;
}
.team-tree-toggle {
  width: 24px; height: 24px; border: 1px solid #d9d9d9; border-radius: 6px;
  background: #fff; color: #1677ff; font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; z-index: 2; margin-top: 14px;
}
.team-tree-toggle.leaf { visibility: hidden; pointer-events: none; }
.team-tree-line-down {
  flex: 1; width: 1px; background: #d9e8ff; margin-top: 4px; min-height: 8px;
}
.team-tree-branch:last-child > .team-tree-node > .team-tree-gutter > .team-tree-line-down {
  display: none;
}
.team-tree-children {
  margin-left: 0; padding-left: 0; border-left: none; display: none;
}
.team-tree-children.expanded { display: block; }
.team-tree-children > .team-tree-branch {
  position: relative;
}
.team-tree-children > .team-tree-branch::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #d9e8ff;
}
.team-tree-children > .team-tree-branch:last-child::before {
  bottom: 50%;
}
.team-tree-card { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.team-detail-page { padding: 12px; }
.team-detail-head {
  display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
}
.team-detail-name { font-size: 18px; font-weight: 700; }
.team-detail-mobile { font-size: 13px; color: #999; margin-top: 4px; }

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 9999;
  font-size: 14px;
  max-width: 80%;
  text-align: center;
}

/* Loading */
.loading {
  text-align: center;
  padding: 24px;
  color: var(--muted);
}

.invite-page {
  padding: 16px;
}

.invite-qr-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
  text-align: center;
}

.invite-user {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.invite-code {
  margin-top: 8px;
  font-size: 13px;
  color: #888;
}

.invite-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0 12px;
}

.invite-qr-canvas {
  display: block;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.invite-qr-url {
  font-size: 12px;
  color: #666;
  word-break: break-all;
  line-height: 1.5;
  padding: 0 8px;
}

.invite-qr-tip {
  margin: 12px 0 16px;
  font-size: 12px;
  color: #999;
  line-height: 1.6;
}

.invite-register-tip {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7e6;
  color: #ad6800;
  font-size: 13px;
  line-height: 1.5;
}

.boot-error-page {
  margin: 24px 16px;
  padding: 20px 16px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
  text-align: center;
}
.boot-error-page h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #cf1322;
}
.boot-error-page p {
  margin: 0 0 10px;
  color: #666;
  line-height: 1.6;
  font-size: 14px;
}
.boot-error-hint {
  color: #999 !important;
  font-size: 12px !important;
}
.boot-error-page .btn {
  margin-top: 8px;
}

.loot-pagination { display:flex; justify-content:center; align-items:center; gap:16px; padding:10px 16px; color:var(--muted); font-size:14px; }
.loot-sort-row { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:12px 0; color:var(--muted); }
.loot-sort-row select { min-width:132px; padding:7px 28px 7px 10px; border:1px solid var(--border); border-radius:4px; background:var(--card); color:var(--text); font-size:14px; }
.loot-page-btn { border:1px solid #ddd; background:#fff; border-radius:4px; padding:7px 12px; color:#333; cursor:pointer; }
.loot-page-btn:disabled { color:#aaa; cursor:default; }

/* 注册与新用户引导 */
.password-input-wrap { position: relative; }
.password-input-wrap .form-input { padding-right: 58px; }
.password-toggle { position:absolute; right:8px; top:50%; transform:translateY(-50%); border:0; background:transparent; color:var(--primary); padding:8px; font-size:13px; cursor:pointer; }
.form-error { min-height:18px; margin-top:4px; color:#d93025; font-size:12px; line-height:1.4; }
.form-help { margin-top:5px; color:var(--muted); font-size:12px; }
.form-help.is-valid { color:#16845b; }
.form-input.is-invalid { border-color:#d93025; box-shadow:0 0 0 2px rgba(217,48,37,.08); }
.auth-agreement { margin:2px 0 0; color:var(--muted); font-size:13px; line-height:1.6; }
.auth-agreement label { display:flex; min-width:0; align-items:flex-start; gap:8px; }
.auth-agreement input { margin-top:4px; flex:0 0 auto; }
.auth-agreement-text { display:block; min-width:0; overflow:hidden; }
.auth-protocol-link { border:0; background:none; color:var(--primary); padding:0; font:inherit; cursor:pointer; }
.auth-protocol-first { max-width:42%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:bottom; }
.auth-protocol-dialog { position:fixed; inset:0; z-index:1000; display:flex; align-items:flex-end; justify-content:center; }
.auth-protocol-dialog.hidden { display:none; }
.auth-protocol-mask { position:absolute; inset:0; border:0; background:rgba(0,0,0,.48); }
.auth-protocol-panel { position:relative; width:min(100%,520px); max-height:80vh; border-radius:20px 20px 0 0; background:#fff; padding:18px; box-shadow:0 -10px 30px rgba(0,0,0,.15); }
.auth-protocol-head { position:relative; min-height:34px; border-bottom:1px solid var(--border); padding:0 42px 12px; }
.auth-protocol-head h3 { margin:0; color:var(--text); font-size:18px; line-height:1.45; overflow-wrap:anywhere; text-align:center; }
.auth-protocol-head button { position:absolute; top:-3px; right:0; width:34px; height:34px; border:0; background:none; color:var(--muted); font-size:28px; line-height:1; cursor:pointer; }
.auth-protocol-head .auth-protocol-back { right:auto; left:0; font-size:22px; }
.auth-protocol-content { max-height:60vh; overflow:auto; padding:16px 2px; white-space:pre-wrap; color:#444; font-size:14px; line-height:1.8; }
.auth-protocol-list { display:flex; flex-direction:column; gap:0; padding:4px 0; white-space:normal; }
.auth-protocol-list button { display:flex; min-height:48px; align-items:center; justify-content:space-between; gap:12px; border:0; border-bottom:1px solid var(--border); background:#fff; padding:10px 4px; color:#333; font:inherit; text-align:left; cursor:pointer; }
.auth-protocol-list button:last-child { border-bottom:0; }
.auth-protocol-list button span { min-width:0; overflow-wrap:anywhere; }
.auth-protocol-list button i { flex:0 0 auto; color:var(--muted); font-size:22px; font-style:normal; }
@media (max-width:420px) {
  .auth-agreement-text { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
  .auth-protocol-panel { padding:16px; }
}
.invite-register-tip.is-valid { color:#16845b; background:rgba(22,132,91,.08); }
.invite-register-tip.is-invalid { color:#d93025; background:rgba(217,48,37,.08); }
.btn.is-loading { cursor:wait; opacity:.78; }

.welcome-page { max-width:560px; margin:0 auto; padding:28px 16px 36px; }
.welcome-hero { text-align:center; padding:18px 8px 24px; }
.welcome-icon { display:grid; place-items:center; width:58px; height:58px; margin:0 auto 14px; border-radius:50%; background:#16845b; color:#fff; font-size:30px; box-shadow:0 10px 24px rgba(22,132,91,.22); }
.welcome-hero h1 { margin:0 0 8px; font-size:23px; }
.welcome-hero p, .onboarding-intro, .onboarding-wait { color:var(--muted); font-size:14px; line-height:1.6; }
.onboarding-card { margin:12px; padding:18px; border:1px solid rgba(22,132,91,.16); border-radius:18px; background:linear-gradient(145deg,#fff,#f5fbf8); box-shadow:0 8px 24px rgba(30,70,55,.08); }
.welcome-page .onboarding-card { margin:0; }
.onboarding-card.is-compact { margin:12px 12px 4px; }
.onboarding-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.onboarding-head h2 { margin:3px 0 0; font-size:19px; }
.onboarding-head > strong { color:#16845b; font-size:18px; }
.onboarding-eyebrow { color:#16845b; font-size:12px; font-weight:700; letter-spacing:.08em; }
.onboarding-intro { margin:8px 0 12px; }
.onboarding-progress { height:7px; overflow:hidden; border-radius:99px; background:#e5eee9; }
.onboarding-progress span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#16845b,#45ad80); transition:width .3s ease; }
.onboarding-tasks { margin:14px 0; border-top:1px solid rgba(0,0,0,.06); }
.onboarding-task { display:grid; grid-template-columns:30px 1fr auto; align-items:center; gap:10px; padding:14px 0; border-bottom:1px solid rgba(0,0,0,.06); color:inherit; text-decoration:none; }
.onboarding-task small { display:block; margin-top:3px; color:var(--muted); line-height:1.4; }
.onboarding-task em { color:var(--primary); font-size:12px; font-style:normal; }
.onboarding-check { display:grid; place-items:center; width:26px; height:26px; border-radius:50%; background:#e5eee9; color:#16845b; font-weight:700; }
.onboarding-task.is-done .onboarding-check { background:#16845b; color:#fff; }
.onboarding-primary { margin-top:14px; }
.onboarding-wait { margin:10px 0 0; text-align:center; }
.onboarding-explain { margin-top:16px; padding:16px; border-radius:14px; background:#fff; color:var(--muted); box-shadow:0 5px 18px rgba(0,0,0,.05); }
.onboarding-explain h3 { margin:0 0 8px; color:var(--text); font-size:16px; }
.onboarding-explain p { margin:0; line-height:1.7; }
.home-onboarding-slot { position:relative; z-index:2; max-width:720px; margin:0 auto; }
.home-auth-card { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:12px; padding:16px; border-radius:16px; background:#fff; box-shadow:0 8px 22px rgba(0,0,0,.08); }
.home-auth-card p { margin:5px 0 0; color:var(--muted); font-size:13px; }
.home-auth-actions { display:flex; gap:8px; flex:0 0 auto; }
.home-auth-actions .btn { width:auto; min-width:66px; padding:9px 12px; }
.home-goods-row.is-actionable, .goods-card.is-actionable { cursor:pointer; }
.home-goods-row.is-actionable:focus-visible, .goods-card.is-actionable:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
@media (max-width:420px) { .home-auth-card { align-items:flex-start; flex-direction:column; } .home-auth-actions { width:100%; } .home-auth-actions .btn { flex:1; } }
.balance-log-page { padding: 12px 16px 24px; }
.balance-log-tabs { display:flex; border-bottom:1px solid #eee; margin-bottom:12px; }
.balance-log-tab { flex:1; border:0; background:transparent; padding:11px 4px; color:#777; border-bottom:2px solid transparent; }
.balance-log-tab.active { color:#1677ff; border-bottom-color:#1677ff; font-weight:600; }
.balance-log-filters { display:flex; gap:8px; margin-bottom:10px; }
.balance-log-filters button, .balance-log-custom button { border:1px solid #ddd; background:#fff; border-radius:4px; padding:6px 10px; color:#555; }
.balance-log-custom { display:flex; align-items:center; gap:6px; margin-bottom:10px; }
.balance-log-custom input { min-width:0; flex:1; border:1px solid #ddd; border-radius:4px; padding:6px; color:#555; }
.balance-log-list { background:#fff; }
.balance-log-item { display:flex; justify-content:space-between; align-items:center; padding:14px 0; border-bottom:1px solid #f0f0f0; }
.balance-log-memo { color:#222; font-size:15px; margin-bottom:4px; }
.balance-log-amount { font-weight:600; font-size:16px; }
.balance-log-amount.positive { color:#16a34a; }
.balance-log-amount.negative { color:#dc2626; }
.tab-item.hidden { display: none; }

/* 聊天页：锁定视口高度，输入框固定在底栏上方 */
body.has-tabbar:has(.chat-page-wrap) {
  overflow: hidden;
  height: 100%;
}
.has-tabbar #app:has(.chat-page-wrap) {
  padding-bottom: 0;
  min-height: 0;
  height: calc(var(--viewport-height, 100vh) - var(--tabbar-height) - var(--safe-bottom));
  overflow: hidden;
}
.has-tabbar #page-dynamic:has(.chat-page-wrap) {
  height: 100%;
}

.chat-page-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: #ededed;
  position: relative;
}
.chat-page-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}
.chat-header-placeholder,
.chat-header-more {
  width: 40px;
  flex-shrink: 0;
}
.chat-header-title {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #111;
  text-align: center;
  line-height: 1.3;
}
.chat-header-more {
  background: none;
  border: 0;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  color: #111;
  letter-spacing: 1px;
  cursor: default;
}
.chat-message-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 0 calc(var(--chat-composer-height) + 12px);
  -webkit-overflow-scrolling: touch;
}
.chat-page-wrap:has(.chat-composer-wrap.is-emoji-open) .chat-message-list {
  padding-bottom: calc(var(--chat-composer-height) + min(42vh, 280px) + 12px);
}
.chat-time-divider {
  text-align: center;
  margin: 14px 0;
  padding: 0 16px;
}
.chat-time-divider span {
  display: inline-block;
  font-size: 12px;
  color: #b2b2b2;
  line-height: 1.4;
}
.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 12px;
}
.chat-msg-self {
  justify-content: flex-end;
}
.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: cover;
  background: #ddd;
}
.chat-msg-body {
  max-width: calc(100% - 56px);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-msg-self .chat-msg-body {
  align-items: flex-end;
}
.chat-msg-name {
  font-size: 12px;
  color: #888;
  margin: 0 0 4px 2px;
  line-height: 1.2;
}
.chat-bubble {
  display: inline-block;
  max-width: 100%;
  text-align: left;
}
.chat-bubble-text {
  position: relative;
  background: #fff;
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 16px;
  line-height: 1.45;
  word-break: break-word;
  color: #111;
}
.chat-msg-other .chat-bubble-text::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 12px;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-right-color: #fff;
  border-left: 0;
}
.chat-msg-self .chat-bubble-text {
  background: #95ec69;
}
.chat-msg-self .chat-bubble-text::before {
  content: '';
  position: absolute;
  right: -5px;
  top: 12px;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-left-color: #95ec69;
  border-right: 0;
}
.chat-composer-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  bottom: calc(var(--tabbar-height) + var(--safe-bottom));
  z-index: 90;
  --composer-panel-height: 0px;
}
.chat-composer-wrap.is-emoji-open {
  --composer-panel-height: min(42vh, 280px);
}
.chat-emoji-panel {
  display: none;
  height: var(--composer-panel-height);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #f0f0f0;
  border-top: 1px solid #e0e0e0;
}
.chat-composer-wrap.is-emoji-open .chat-emoji-panel {
  display: block;
}
.chat-emoji-section {
  padding: 8px 10px 4px;
}
.chat-emoji-section-title {
  font-size: 12px;
  color: #999;
  margin-bottom: 6px;
  padding-left: 2px;
}
.chat-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.chat-emoji-grid-recent {
  grid-template-columns: repeat(8, 1fr);
}
.chat-emoji-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background .15s;
}
.chat-emoji-item:active,
.chat-emoji-item:hover {
  background: rgba(0, 0, 0, .06);
}
.chat-emoji-empty {
  display: block;
  grid-column: 1 / -1;
  font-size: 12px;
  color: #bbb;
  padding: 6px 2px 10px;
}
.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: #f7f7f7;
  border-top: 1px solid #e8e8e8;
  box-sizing: border-box;
}
.chat-input {
  flex: 1;
  min-height: 38px;
  max-height: 96px;
  resize: none;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 16px;
  line-height: 1.4;
  background: #fff;
  transition: border-color .2s;
}
.chat-emoji-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color .2s, background .2s;
}
.chat-emoji-btn.is-active {
  color: #07c160;
  background: rgba(7, 193, 96, .1);
}
.chat-emoji-btn:active {
  background: rgba(0, 0, 0, .06);
}
.chat-input:focus {
  outline: none;
  border-color: #07c160;
}
.chat-send-btn {
  flex-shrink: 0;
  min-width: 60px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 19px;
  background: #07c160;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 38px;
  cursor: pointer;
  transition: opacity .2s, background .2s;
}
.chat-send-btn:disabled {
  opacity: .45;
  cursor: default;
}
.chat-send-btn:not(:disabled):active {
  background: #06ad56;
}
.chat-redpacket {
  display: block;
  width: min(240px, 72vw);
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.chat-redpacket-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 10px;
}
.chat-redpacket-seal {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8 0%, #f5c842 45%, #d4a017 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .45), 0 1px 2px rgba(0, 0, 0, .12);
  position: relative;
}
.chat-redpacket-seal::after {
  content: '福';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #b8860b;
}
.chat-redpacket-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-redpacket-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-all;
}
.chat-redpacket-status {
  font-size: 12px;
  line-height: 1.3;
  opacity: .92;
}
.chat-redpacket-foot {
  display: block;
  padding: 5px 12px 6px;
  font-size: 11px;
  line-height: 1.2;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
/* 可领取：微信橙红 */
.chat-redpacket.is-active {
  background: linear-gradient(160deg, #f79b4a 0%, #ec5f45 55%, #e04a3f 100%);
  color: #fff;
}
.chat-redpacket.is-active .chat-redpacket-foot {
  color: rgba(255, 255, 255, .82);
  border-top-color: rgba(255, 255, 255, .18);
}
.chat-redpacket.is-active:active { filter: brightness(.96); }
/* 已领取 */
.chat-redpacket.is-opened {
  background: #f7e3d0;
  color: #9a7b66;
  cursor: pointer;
}
.chat-redpacket.is-opened .chat-redpacket-seal {
  background: radial-gradient(circle at 35% 30%, #ece3d6 0%, #d8c8b8 100%);
  box-shadow: none;
}
.chat-redpacket.is-opened .chat-redpacket-seal::after { color: #b0a090; }
.chat-redpacket.is-opened .chat-redpacket-foot {
  color: #b5a090;
  border-top-color: rgba(0, 0, 0, .06);
}
/* 不可领 / 已领完 */
.chat-redpacket.is-muted {
  background: #ecdfd3;
  color: #a89888;
  cursor: pointer;
}
.chat-redpacket.is-muted .chat-redpacket-seal {
  background: radial-gradient(circle at 35% 30%, #e8ddd2 0%, #cfc0b2 100%);
  box-shadow: none;
}
.chat-redpacket.is-muted .chat-redpacket-seal::after { color: #b5a69a; }
.chat-redpacket.is-muted .chat-redpacket-text { color: #9a8e82; }
.chat-redpacket.is-muted .chat-redpacket-status { color: #b0a498; }
.chat-redpacket.is-muted .chat-redpacket-foot {
  color: #b8aca0;
  border-top-color: rgba(0, 0, 0, .06);
}
.chat-empty { text-align: center; color: #888; padding: 48px 16px; }
.chat-empty-hint { margin-top: 8px; font-size: 13px; color: #aaa; }

/* 群聊红包领取特效 */
.rp-fx-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s ease;
}
.rp-fx-overlay.is-visible { opacity: 1; }
.rp-fx-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
}
.rp-fx-card {
  position: relative;
  width: min(300px, 86vw);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #f25c54 0%, #d63e3a 55%, #c8322e 100%);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
  transform: scale(.85);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
  z-index: 1;
}
.rp-fx-overlay.is-visible .rp-fx-card { transform: scale(1); }
.rp-fx-card[data-stage="opening"] .rp-fx-open { animation: rp-fx-spin .6s ease-in-out infinite; }
.rp-fx-card[data-stage="opening"] .rp-fx-preview { opacity: .5; }
.rp-fx-card[data-stage="result"] .rp-fx-preview { display: none; }
.rp-fx-card[data-stage="result"] .rp-fx-result { display: flex; }
.rp-fx-card[data-stage="opening"] .rp-fx-loading { display: flex; }
.rp-fx-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, .15);
  color: rgba(255, 255, 255, .85);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.rp-fx-curve {
  height: 56px;
  background: radial-gradient(ellipse 140% 100% at 50% 0%, #e04a49 40%, transparent 70%);
  margin-top: -8px;
}
.rp-fx-body { padding: 0 24px 32px; text-align: center; min-height: 280px; }
.rp-fx-preview { display: flex; flex-direction: column; align-items: center; }
.rp-fx-avatar {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 12px;
}
.rp-fx-sender { color: #f5d78e; font-size: 15px; margin: 0 0 16px; }
.rp-fx-bless { color: #fff; font-size: 20px; font-weight: 500; margin: 0 0 36px; line-height: 1.4; }
.rp-fx-open {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid #f5d78e;
  background: linear-gradient(180deg, #f5d78e, #d4a84b);
  color: #5c3a0a;
  font-size: 36px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
  animation: rp-fx-pulse 1.8s ease-in-out infinite;
}
.rp-fx-open:disabled { cursor: not-allowed; animation: none; }
.rp-fx-result {
  display: none;
  flex-direction: column;
  align-items: center;
  animation: rp-fx-fade-up .5s ease;
}
.rp-fx-result-label { color: #f5d78e; font-size: 14px; margin: 8px 0 12px; }
.rp-fx-amount-wrap { color: #f5d78e; margin-bottom: 8px; }
.rp-fx-amount-unit { font-size: 28px; margin-right: 4px; }
.rp-fx-amount-num { font-size: 52px; font-weight: 700; letter-spacing: 1px; }
.rp-fx-result-hint { color: rgba(255, 255, 255, .75); font-size: 13px; margin: 0 0 28px; }
.rp-fx-accept {
  border: 1px solid #f5d78e;
  background: transparent;
  color: #f5d78e;
  border-radius: 24px;
  padding: 10px 36px;
  font-size: 15px;
  cursor: pointer;
}
.rp-fx-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  background: rgba(198, 50, 46, .6);
  color: #fff;
  font-size: 14px;
  gap: 12px;
}
.rp-fx-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, .3);
  border-top-color: #f5d78e;
  border-radius: 50%;
  animation: rp-fx-spin .8s linear infinite;
}
.rp-fx-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.rp-fx-coin {
  position: absolute;
  top: -20px;
  color: #f5d78e;
  font-weight: 700;
  opacity: 0;
  animation: rp-fx-coin-fall 1.6s ease-in forwards;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
@keyframes rp-fx-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes rp-fx-spin {
  to { transform: rotate(360deg); }
}
@keyframes rp-fx-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rp-fx-coin-fall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(320px) rotate(360deg); }
}

/* 群聊红包详情 */
.rp-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s ease;
}
.rp-detail-overlay.is-visible { opacity: 1; }
.rp-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
}
.rp-detail-panel {
  position: relative;
  width: min(100%, 480px);
  max-height: 82vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .28s ease;
}
.rp-detail-overlay.is-visible .rp-detail-panel { transform: translateY(0); }
.rp-detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: #888;
}
.rp-detail-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .06);
  color: #666;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.rp-detail-header {
  background: linear-gradient(180deg, #e04a3f 0%, #d9443a 100%);
  color: #fff;
  text-align: center;
  padding: 28px 20px 20px;
  flex-shrink: 0;
}
.rp-detail-seal {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8 0%, #f5c842 45%, #d4a017 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .45);
}
.rp-detail-sender { margin: 0 0 8px; font-size: 14px; color: #f5d78e; }
.rp-detail-bless { margin: 0 0 12px; font-size: 18px; font-weight: 500; line-height: 1.4; }
.rp-detail-my { margin: 8px 0 4px; }
.rp-detail-my-amount { display: block; font-size: 40px; font-weight: 700; color: #f5d78e; line-height: 1.1; }
.rp-detail-my-hint { display: block; margin-top: 4px; font-size: 12px; color: rgba(255, 255, 255, .75); }
.rp-detail-summary { margin: 8px 0 0; font-size: 12px; color: rgba(255, 255, 255, .82); }
.rp-detail-kind { margin: 6px 0 0; font-size: 11px; color: rgba(255, 255, 255, .65); }
.rp-detail-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
  -webkit-overflow-scrolling: touch;
}
.rp-detail-empty {
  text-align: center;
  color: #aaa;
  padding: 32px 16px;
  font-size: 14px;
}
.rp-detail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.rp-detail-item.is-best { background: #fff9f0; }
.rp-detail-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f0f0;
}
.rp-detail-item-main { flex: 1; min-width: 0; }
.rp-detail-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rp-detail-name {
  font-size: 15px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-detail-amount {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  flex-shrink: 0;
}
.rp-detail-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.rp-detail-time { font-size: 12px; color: #aaa; }
.rp-detail-best {
  font-size: 11px;
  color: #e6a23c;
  background: #fdf6ec;
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.readiness-steps {
  display: flex;
  align-items: flex-start;
  margin: 0 12px 12px;
  padding: 14px 8px 12px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}
.readiness-step {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: visible;
  text-align: center;
  color: var(--muted);
}

.login-access-notice {
  margin-bottom: 18px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--primary) 8%, #fff);
  color: var(--primary);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}
.readiness-step-line {
  position: absolute;
  top: 15px;
  left: -50%;
  right: auto;
  width: 100%;
  height: 2px;
  margin: 0;
  background: var(--border);
  transform: none;
  z-index: 0;
}
.readiness-step-line.is-done { background: var(--primary); }
.readiness-step-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: 0 auto 8px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: #fafafa;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.readiness-step-prefix {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  line-height: 1.2;
}
.readiness-step-label {
  display: block;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.readiness-step-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(244, 93, 92, .12);
  color: var(--primary);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.5;
}
.readiness-step-badge.is-done {
  background: rgba(244, 93, 92, .08);
  color: var(--primary);
}
.readiness-step.is-active .readiness-step-dot {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(244, 93, 92, .28);
}
.readiness-step.is-active .readiness-step-label { color: var(--primary); }
.readiness-step.is-done .readiness-step-dot {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.readiness-step.is-done .readiness-step-label { color: var(--text); }
.readiness-step.is-done .readiness-step-prefix { color: var(--primary); }
.readiness-gate { margin-top:0; }
.welcome-skip { margin-top:10px; }

.payment-progress {
  margin: 0 0 12px;
  padding: 20px 16px 16px;
  background: #fff;
}
.payment-progress h2 { margin: 0 0 5px; font-size: 25px; line-height: 1.3; }
.payment-progress p, .payment-methods-action p { margin: 0; color: #616168; }
.payment-progress ol { list-style: none; padding: 0; margin: 15px 0 0; }
.payment-step {
  --step-marker-color: #74747b;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}
.payment-step:not(:last-child)::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 14px;
  background: var(--step-marker-color);
  inset: 27px auto auto 8px;
}
.payment-step.is-done, .payment-step.is-current { --step-marker-color: var(--primary, #c82328); }
.payment-step.is-current { color: var(--step-marker-color); font-weight: 700; }
.payment-step.is-pending { color: #616168; }
.payment-step-marker {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--step-marker-color);
  border-radius: 50%;
  box-sizing: border-box;
  font-size: 12px;
}
.payment-step.is-done .payment-step-marker { color: #fff; background: var(--step-marker-color); }
.payment-step.is-current .payment-step-marker { border-width: 5px; }
.payment-summary .payment-summary-amount { font-size: 27px; font-variant-numeric: tabular-nums; }
.payment-methods-action { margin: 12px 0; text-align: center; }
.payment-methods-action p { margin-bottom: 8px; }
#payment-methods { scroll-margin-top: 56px; }
