:root {
  color-scheme: light;
  background: #ececec;
  --page-max-width: 430px;
  --od-green: #1aad19;
  --od-red: #e02e24;
  --od-text: #151516;
  --od-muted: #9c9c9c;
  --od-border: #ededed;
  --od-bottom-height: 72px;
  --od-space: 18px;
  --od-thumb: 118px;
  --od-btn-h: 40px;
  --od-bottom-btn-h: 46px;
}

* {
  box-sizing: border-box;
}

html {
  height: -webkit-fill-available;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  margin: 0;
  overflow-x: hidden;
}

body {
  display: flex;
  justify-content: center;
  background: #ececec;
}

.page {
  position: relative;
  width: min(100%, var(--page-max-width));
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  background: #f4f4f4;
  box-shadow: 0 0 32px rgb(0 0 0 / 10%);
}

.static-page-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1179 / 2424;
  overflow: hidden;
  background: #fff;
}

.page-image {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 100%;
  height: auto;
  transform: translateY(-5.164319%);
  user-select: none;
  -webkit-user-drag: none;
}

.home-feed,
.catalog-feed {
  display: none;
  padding-bottom: min(21.2vw, 91px);
}

body[data-page="home"] .static-page-frame,
body[data-page="profile"] .static-page-frame,
body[data-page="chat"] .static-page-frame {
  display: none;
}

body[data-page="home"] .home-feed {
  display: block;
}

body[data-page="profile"] .profile-feed,
body[data-page="chat"] .chat-feed {
  display: block;
}

body[data-page="orders"] .static-page-frame,
body[data-page="orders"] .home-feed,
body[data-page="orders"] .catalog-feed,
body[data-page="order-detail"] .static-page-frame,
body[data-page="order-detail"] .home-feed,
body[data-page="order-detail"] .catalog-feed {
  display: none;
}

body[data-page="orders"] .orders-page,
body[data-page="order-detail"] .order-detail-page {
  display: block;
}

body[data-page="orders"] .tabbar,
body[data-page="order-detail"] .tabbar {
  display: none;
}

.orders-page,
.order-detail-page {
  display: none;
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  background: #f4f4f4;
  -webkit-overflow-scrolling: touch;
}

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

.order-detail-page {
  padding-top: 0;
  padding-bottom: 0;
}

.orders-segment {
  position: relative;
  width: 100%;
}

.order-hit {
  position: absolute;
  top: var(--hit-top, 0%);
  left: 2%;
  z-index: 2;
  width: 96%;
  height: var(--hit-height, 100%);
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.orders-scroll {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.od-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  background: #f4f4f4;
}

.od-nav {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  min-height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 10px 0;
  background: #fff;
  border-bottom: 1px solid var(--od-border);
}

.od-back {
  width: 52px;
  height: 52px;
  padding: 0;
  color: #333;
  font-size: 34px;
  line-height: 52px;
  text-align: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.od-nav-title {
  margin: 0;
  color: var(--od-green);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(20px, 5.5vw, 23px);
  font-weight: 600;
  line-height: 52px;
  text-align: center;
}

.od-body {
  flex: 1;
  padding-bottom: calc(var(--od-bottom-height) + env(safe-area-inset-bottom) + 12px);
}

.od-card {
  margin-bottom: 8px;
  background: #fff;
}

.od-logistics {
  display: grid;
  grid-template-columns: 42px 1fr 20px;
  gap: 12px;
  align-items: start;
  padding: var(--od-space) var(--od-space) 14px;
}

.od-logistics-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: 2px;
  color: var(--od-green);
  flex-shrink: 0;
}

.od-logistics-icon img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.od-logistics-status {
  margin: 0 0 10px;
  color: var(--od-green);
  font-size: clamp(19px, 5vw, 22px);
  font-weight: 600;
  line-height: 1.3;
}

.od-logistics-name,
.od-logistics-address {
  margin: 0;
  color: #666;
  font-size: clamp(17px, 4.5vw, 19px);
  line-height: 1.45;
}

.od-logistics-note {
  margin: 10px 0 0;
  color: var(--od-green);
  font-size: clamp(16px, 4.2vw, 17px);
  line-height: 1.45;
}

.od-logistics-name {
  margin-bottom: 6px;
}

.od-logistics-arrow {
  color: #ccc;
  font-size: 22px;
  line-height: 36px;
  text-align: right;
}

.od-shop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px var(--od-space) 12px;
  border-bottom: 1px solid #f5f5f5;
}

.od-shop-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.od-shop-name {
  flex: 1;
  min-width: 0;
  color: var(--od-text);
  font-size: clamp(18px, 4.8vw, 20px);
  font-weight: 600;
  line-height: 1.3;
}

.od-shop-tags {
  display: inline-flex;
  gap: 5px;
  margin-left: 6px;
}

.od-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  border-radius: 3px;
}

.od-tag-red {
  color: #fff;
  background: var(--od-red);
}

.od-tag-black {
  color: #fff;
  background: #151516;
}

.od-tag-orange {
  color: #fff;
  background: #ff6a00;
}

.od-tag-blue {
  color: #fff;
  background: #16a7e0;
}

.od-tag-green-fill {
  color: #fff;
  background: var(--od-green);
}

.od-tag-green-outline {
  color: var(--od-green);
  background: #fff;
  border: 1px solid #9ad49a;
}

.od-shop-arrow {
  color: #ccc;
  font-size: 22px;
}

.od-product {
  display: grid;
  grid-template-columns: var(--od-thumb) 1fr;
  gap: 12px;
  padding: 0 var(--od-space) 14px;
}

.od-product-image {
  width: var(--od-thumb);
  height: var(--od-thumb);
  object-fit: cover;
  border-radius: 5px;
  background: #f7f7f7;
}

.od-product-main {
  min-width: 0;
}

.od-product-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 8px;
  color: var(--od-text);
  font-size: clamp(17px, 4.5vw, 19px);
  font-weight: 400;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.od-product-title .od-tag {
  margin-right: 5px;
  vertical-align: 1px;
}

.od-product-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.od-product-spec {
  margin: 0;
  color: #999;
  font-size: clamp(16px, 4.2vw, 17px);
  line-height: 1.4;
}

.od-product-price {
  flex-shrink: 0;
  color: #666;
  font-size: clamp(16px, 4.2vw, 17px);
  line-height: 1.4;
  text-align: right;
  white-space: nowrap;
}

.od-product-price strong {
  display: block;
  color: #666;
  font-size: clamp(17px, 4.5vw, 18px);
  font-weight: 500;
}

.od-service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.od-service-link {
  display: inline-flex;
  align-items: center;
  margin: 0 var(--od-space) 12px;
  color: var(--od-green);
  font-size: clamp(16px, 4.2vw, 17px);
  line-height: 1.4;
}

.od-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 var(--od-space) var(--od-space);
}

.od-action-btn {
  min-width: 88px;
  height: var(--od-btn-h);
  padding: 0 14px;
  color: #333;
  font-size: clamp(15px, 4vw, 16px);
  line-height: calc(var(--od-btn-h) - 2px);
  text-align: center;
  background: #fff;
  border: 1px solid #c8c8c8;
  border-radius: 5px;
  cursor: pointer;
  touch-action: manipulation;
}

.od-action-btn-danger {
  color: var(--od-red);
  border-color: var(--od-red);
}

.od-action-btn .od-chat-icon {
  margin-right: 3px;
  color: var(--od-green);
  font-size: 16px;
}

.od-category-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--od-space) 14px;
  overflow-x: auto;
  border-top: 1px solid #f5f5f5;
}

.od-category-row::-webkit-scrollbar {
  display: none;
}

.od-category-chip {
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  color: #666;
  font-size: 15px;
  line-height: 32px;
  background: #f7f7f7;
  border: 1px solid #ececec;
  border-radius: 17px;
}

.od-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--od-space);
}

.od-summary-discount {
  color: var(--od-red);
  font-size: clamp(16px, 4.2vw, 17px);
}

.od-summary-paid {
  color: #333;
  font-size: clamp(16px, 4.2vw, 17px);
}

.od-summary-paid strong {
  color: var(--od-text);
  font-size: clamp(18px, 4.8vw, 20px);
  font-weight: 700;
}

.od-meta-block {
  padding: 0 var(--od-space) 14px;
}

.od-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  color: #666;
  font-size: clamp(16px, 4.2vw, 17px);
  line-height: 1.45;
}

.od-meta-label {
  flex-shrink: 0;
  color: #999;
}

.od-meta-value {
  flex: 1;
  text-align: right;
  word-break: break-all;
}

.od-meta-value.is-red {
  color: var(--od-red);
}

.od-copy {
  margin-left: 8px;
  color: #666;
  font-size: 15px;
}

.od-expand-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 var(--od-space) 14px;
}

.od-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  color: #999;
  font-size: 16px;
  background: transparent;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.od-expand-panel {
  display: none;
  padding-top: 4px;
  border-top: 1px solid #f5f5f5;
}

.od-expand-panel.is-open {
  display: block;
}

.od-meta-collapsed.is-hidden {
  display: none;
}

.od-social {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px var(--od-space);
  color: #666;
  font-size: clamp(16px, 4.2vw, 17px);
  border-top: 1px solid #f5f5f5;
}

.od-social-link {
  margin-left: auto;
  color: #999;
}

.od-social-avatar {
  width: 28px;
  height: 28px;
  margin-left: 10px;
  border-radius: 50%;
  object-fit: cover;
}

.od-recommend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  background: #f4f4f4;
}

.od-recommend-card {
  overflow: hidden;
  background: #fff;
  border-radius: 4px;
}

.od-recommend-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.od-recommend-info {
  padding: 10px;
}

.od-recommend-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.od-bottom {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: min(100%, var(--page-max-width));
  min-height: calc(var(--od-bottom-height) + env(safe-area-inset-bottom));
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--od-border);
  transform: translateX(-50%);
}

.od-bottom-btn {
  min-width: 88px;
  height: var(--od-bottom-btn-h);
  padding: 0 16px;
  color: #333;
  font-size: clamp(16px, 4.2vw, 17px);
  line-height: calc(var(--od-bottom-btn-h) - 2px);
  text-align: center;
  background: #fff;
  border: 1px solid #c8c8c8;
  border-radius: 5px;
  cursor: pointer;
  touch-action: manipulation;
}

.od-bottom-btn-primary {
  color: var(--od-text);
  font-weight: 700;
  border-color: #333;
}

.image-slice {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  vertical-align: top;
  user-select: none;
  -webkit-user-drag: none;
}

.orders-scroll {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.orders-full-link {
  display: block;
  width: 100%;
}

.image-slice-link {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.image-page-back {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 6px);
  left: max(6px, env(safe-area-inset-left));
  z-index: 20;
  width: clamp(40px, 11vw, 48px);
  height: clamp(40px, 11vw, 48px);
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body[data-page="orders"] .image-page-back,
body[data-page="order-detail"] .image-page-back {
  left: 50%;
  margin-left: calc(min(100vw, var(--page-max-width)) / -2 + 6px);
}

.profile-order-entry {
  position: absolute;
  top: 24.5%;
  left: 3%;
  z-index: 2;
  width: 94%;
  height: 8.5%;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-top {
  position: relative;
  width: 100%;
  aspect-ratio: 1179 / 1372;
  overflow: hidden;
  background: #fff;
}

.home-top img {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 100%;
  height: auto;
  transform: translateY(-5.164319%);
  user-select: none;
  -webkit-user-drag: none;
}

.feed-top {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #fff;
}

.profile-top {
  aspect-ratio: 1179 / 1056;
}

.chat-top {
  aspect-ratio: 1179 / 1068;
}

.feed-top img {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 100%;
  height: auto;
  transform: translateY(-5.164319%);
  user-select: none;
  -webkit-user-drag: none;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 4px;
  padding: 4px;
  background: #f4f4f4;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: #222;
  text-align: left;
  background: #fff;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 8%);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.product-card:focus-visible {
  outline: 3px solid #e02e24;
  outline-offset: -3px;
}

.product-card:active {
  transform: scale(0.985);
}

.product-visual {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: #f7f7f7;
}

.product-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.product-info {
  display: none;
  flex-direction: column;
  gap: 3px;
  padding: 6px 7px;
  background: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.product-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 400;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-title strong {
  display: inline-flex;
  align-items: center;
  height: 16px;
  margin-right: 3px;
  padding: 0 3px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  vertical-align: 1px;
  background: #e02e24;
  border-radius: 2px;
}

.product-title strong.tag-blue {
  margin-left: -1px;
  background: #16a7e0;
}

.product-title strong.tag-bracket {
  height: auto;
  padding: 0;
  color: #222;
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
  background: transparent;
}

.product-title strong.tag-bracket::before {
  content: "[";
}

.product-title strong.tag-bracket::after {
  content: "]";
}

.product-offer {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  align-self: flex-start;
  padding: 0 4px;
  color: #e02e24;
  font-size: clamp(10px, 2.35vw, 11px);
  line-height: 15px;
  border: 1px solid #f3a19a;
  border-radius: 2px;
}

.product-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  margin-top: 5px;
  white-space: nowrap;
}

.product-meta b {
  color: #e02e24;
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 700;
  line-height: 1.2;
}

.product-meta small {
  overflow: hidden;
  color: #999;
  font-size: clamp(8px, 2.2vw, 10px);
  text-overflow: ellipsis;
}

.product-dialog {
  width: min(88vw, 360px);
  padding: 25px 22px 22px;
  color: #222;
  background: #fff;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 28%);
}

.dialog-product-image {
  display: block;
  width: 100%;
  margin: 12px 0 14px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: #f5f5f5;
}

.product-dialog::backdrop {
  background: rgb(0 0 0 / 45%);
  backdrop-filter: blur(3px);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #777;
  font-size: 26px;
  line-height: 1;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.dialog-kicker {
  color: #e02e24;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.product-dialog h2 {
  margin: 8px 0 10px;
  font-size: 20px;
  line-height: 1.35;
}

.dialog-description {
  margin: 0 0 18px;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.dialog-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}

.dialog-price-row strong {
  color: #e02e24;
  font-size: 24px;
}

.dialog-price-row span {
  color: #999;
  font-size: 12px;
}

.add-cart-button {
  width: 100%;
  min-height: 44px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  background: #e02e24;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 430px);
  height: min(21.2vw, 91px);
  background-color: #fff;
  background-image: var(--tabbar-image);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% auto;
  box-shadow: 0 -1px 6px rgb(0 0 0 / 8%);
  transform: translateX(-50%);
}

.tabbar-item {
  display: block;
  min-width: 0;
  border-radius: 10px 10px 0 0;
  outline-offset: -4px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tabbar-item:focus-visible {
  outline: 3px solid rgb(0 132 255 / 80%);
}

.tabbar-item:active {
  background: rgb(0 0 0 / 4%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 430px) {
  body {
    background: #fff;
  }

  .page {
    width: 100%;
    max-width: 100%;
    box-shadow: none;
  }

  body[data-page="orders"] .image-page-back,
  body[data-page="order-detail"] .image-page-back {
    left: max(6px, env(safe-area-inset-left));
    margin-left: 0;
  }
}

@media print {
  body,
  .page {
    background: #fff;
    box-shadow: none;
  }
}
