/* 订单中心专用布局：标题胶囊内展开搜索，状态筛选共用一个轻量容器。 */
body.user-subpage .user-order-topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) 40px !important;
  align-items: center !important;
  width: calc(100% - 20px) !important;
  min-height: 58px !important;
  margin: 10px 10px 0 !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
  border: 1px solid rgba(226, 229, 234, .92) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 5px 18px rgba(31, 36, 44, .05) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

body.user-subpage .user-order-topbar > a,
body.user-subpage .user-order-topbar .user-order-top-actions,
body.user-subpage .user-order-topbar .user-order-top-actions button {
  position: relative;
  z-index: 2;
  display: grid !important;
  place-items: center;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #2a2e35 !important;
}

body.user-subpage .user-order-topbar .user-order-top-actions {
  justify-self: end;
}

body.user-subpage .user-order-topbar .user-order-search-svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

body.user-subpage .user-order-title-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 42px;
  overflow: hidden;
}

body.user-subpage .user-order-title-slot > h1 {
  position: relative !important;
  left: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  overflow: hidden;
  color: #272b32 !important;
  font-size: 17px !important;
  font-weight: 850 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: none !important;
  transition: opacity .22s ease, transform .22s ease;
}

body.user-subpage .user-order-search-field {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transform: scaleX(.84);
  transform-origin: center;
  transition: max-width .28s cubic-bezier(.22, .7, .2, 1), opacity .18s ease, transform .28s cubic-bezier(.22, .7, .2, 1), border-color .2s ease, background-color .2s ease;
}

body.user-subpage .user-order-search-field > input {
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 0 9px 0 0;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
  color: #30343a;
  font: inherit;
  font-size: 12px;
}

body.user-subpage .user-order-search-field > input::placeholder {
  color: #a0a5ad;
}

body.user-subpage .user-order-topbar.search-open .user-order-title-slot > h1 {
  opacity: 0;
  transform: translateX(-7px) scale(.96) !important;
}

body.user-subpage .user-order-topbar.search-open .user-order-search-field {
  max-width: 100%;
  padding: 0 9px;
  border-color: #e1e5ea;
  background: rgba(248, 249, 251, .92);
  opacity: 1;
  pointer-events: auto;
  transform: scaleX(1);
}

body.user-subpage .user-order-topbar.search-open .user-order-top-actions button {
  color: #8a5cf6 !important;
  background: rgba(138, 92, 246, .08) !important;
}

/* 订单状态使用单一容器，按钮本身不再显示胶囊或黑底。 */
body.user-subpage .user-order-tabs {
  position: relative !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  width: calc(100% - 20px) !important;
  min-height: 46px !important;
  margin: 8px 10px 10px !important;
  padding: 0 6px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none;
  border: 1px solid rgba(229, 232, 236, .9) !important;
  border-radius: 15px !important;
  background: rgba(255, 255, 255, .82) !important;
  box-shadow: none !important;
  -webkit-overflow-scrolling: touch;
}

body.user-subpage .user-order-tabs::-webkit-scrollbar {
  display: none;
}

body.user-subpage .user-order-tabs > button {
  position: relative !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 66px !important;
  min-height: 45px !important;
  padding: 0 9px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #9298a1 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  white-space: nowrap;
  transition: color .2s ease;
}

body.user-subpage .user-order-tabs > button:hover,
body.user-subpage .user-order-tabs > button:focus-visible {
  background: transparent !important;
  color: #5d6470 !important;
  outline: none;
}

body.user-subpage .user-order-tabs > button.active {
  background: transparent !important;
  color: #8a5cf6 !important;
  box-shadow: none !important;
}

body.user-subpage .user-order-tabs > button.active::after {
  display: none !important;
}

body.user-subpage .user-order-tab-indicator {
  position: absolute;
  right: auto;
  bottom: 2px;
  left: 0;
  display: block;
  width: 26px;
  height: 3px;
  border-radius: 999px;
  background: #8a5cf6;
  pointer-events: none;
  transform: translateX(0);
  transition: transform .28s cubic-bezier(.22, .7, .2, 1), width .2s ease;
}

/* 旧搜索表单若由缓存脚本残留，不再单独占据页面空间。 */
body.user-subpage > .user-page-search,
body.front-frame-page > .front-app-frame.user-subpage .user-page-search {
  display: none !important;
}

@media (max-width: 360px) {
  body.user-subpage .user-order-topbar {
    width: calc(100% - 16px) !important;
    margin-right: 8px !important;
    margin-left: 8px !important;
  }

  body.user-subpage .user-order-tabs {
    width: calc(100% - 16px) !important;
    margin-right: 8px !important;
    margin-left: 8px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.user-subpage .user-order-title-slot > h1,
  body.user-subpage .user-order-search-field,
  body.user-subpage .user-order-tab-indicator {
    transition: none !important;
  }
}
