:root {
  --brand: #ff604d;
  --brand-dark: #ef4939;
  --text: #1f1f1f;
  --muted: #8a8a8a;
  --line: #eeeeee;
  --page: #f6f6f6;
  --white: #ffffff;
  --green: #38b97b;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  background: #ececec;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body {
  min-width: 320px;
  margin: 0;
  background: #ececec;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--page);
  box-shadow: 0 0 24px rgb(0 0 0 / 7%);
}

.page {
  min-height: 100vh;
}

.page--with-bar {
  padding-bottom: calc(92px + var(--safe-bottom));
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 8px 14px;
  border-bottom: 1px solid rgb(0 0 0 / 4%);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(10px);
}

.topbar__title {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  text-align: center;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f3f3f3;
  font-size: 25px;
  line-height: 1;
}

.icon-button--ghost {
  background: transparent;
}

.topbar__spacer {
  width: 40px;
}

.store-hero {
  padding: 22px 20px 18px;
  background: linear-gradient(135deg, #fff8ee 0%, #fff 62%);
}

.store-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.store-logo {
  display: grid;
  flex: 0 0 74px;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 1px solid #ead9bd;
  border-radius: 50%;
  background: #fffaf2;
  color: #8a5d2b;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 20px;
  box-shadow: 0 4px 12px rgb(103 67 24 / 9%);
}

.store-card h1,
.store-card p {
  margin: 0;
}

.store-card h1 {
  font-size: 25px;
}

.store-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.store-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.store-actions button {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  font-weight: 650;
}

.store-actions .primary-button {
  color: #fff;
}

.secondary-button {
  background: #f1f1f1;
}

.tabs {
  display: flex;
  gap: 28px;
  padding: 18px 20px 12px;
  background: #fff;
  color: #858585;
  font-size: 16px;
}

.tabs__item--active {
  position: relative;
  color: var(--text);
  font-weight: 700;
}

.tabs__item--active::after {
  position: absolute;
  right: 8px;
  bottom: -11px;
  left: 8px;
  height: 3px;
  border-radius: 2px;
  background: var(--text);
  content: "";
}

.product-section {
  padding: 22px 14px 28px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 4px 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 21px;
}

.section-heading span {
  color: #7183a5;
  font-size: 14px;
}

.product-list {
  display: grid;
  gap: 12px;
}

.product-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 13px;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 18px rgb(30 30 30 / 4%);
}

.product-card__image {
  width: 116px;
  height: 116px;
  border-radius: 10px;
  object-fit: cover;
}

.product-card__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.product-card__title {
  display: -webkit-box;
  min-height: 44px;
  margin: 2px 0 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-card__tag {
  align-self: flex-start;
  margin-top: 7px;
  color: var(--green);
  font-size: 13px;
}

.product-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.price {
  color: var(--brand);
  font-weight: 750;
}

.price--card {
  font-size: 21px;
}

.buy-button {
  min-width: 58px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #f2f2f2;
  font-weight: 650;
}

.image-hero {
  background: #fff;
}

.image-hero img {
  width: 100%;
  height: auto;
}

.detail-card,
.content-card,
.order-card,
.form-card {
  margin-top: 10px;
  background: #fff;
}

.detail-card {
  padding: 20px;
}

.detail-card .price {
  font-size: 31px;
}

.detail-card h1 {
  margin: 12px 0 8px;
  font-size: 21px;
  line-height: 1.45;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8f8f8f;
  font-size: 14px;
}

.content-card {
  padding: 20px;
}

.content-card h2 {
  margin: 0 0 14px;
  font-size: 19px;
}

.content-card h3 {
  margin: 18px 0 8px;
  font-size: 16px;
}

.content-card p,
.content-card li {
  color: #555;
  font-size: 14px;
  line-height: 1.8;
}

.content-card p {
  margin: 0;
}

.content-card ul,
.content-card ol {
  margin: 0;
  padding-left: 20px;
}

.content-service-button {
  min-height: 42px;
  margin-top: 14px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  font-weight: 650;
}

.notice-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 9px;
  background: #fff7ef;
  color: #81542d;
  font-size: 13px;
  line-height: 1.7;
}

.store-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 17px 20px;
  background: #fff;
}

.store-mini .store-logo {
  flex-basis: 54px;
  width: 54px;
  height: 54px;
  font-size: 15px;
}

.store-mini__name {
  flex: 1;
  font-weight: 700;
}

.order-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

.order-card img {
  width: 112px;
  height: 112px;
  border-radius: 9px;
  object-fit: cover;
}

.order-card h1 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.order-card p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 13px;
}

.order-card .price {
  display: block;
  margin-top: 8px;
  font-size: 23px;
}

.form-card {
  padding: 4px 18px;
}

.form-row {
  display: flex;
  min-height: 62px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

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

.form-row label {
  flex: 0 0 68px;
  font-weight: 650;
}

.form-row input {
  min-width: 0;
  flex: 1;
  padding: 10px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  text-align: right;
}

.form-row input::placeholder {
  color: #b8b8b8;
}

.form-error {
  min-height: 20px;
  margin: 6px 18px 0;
  color: #d93b2d;
  font-size: 13px;
}

.quantity {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
}

.quantity button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f5f5f5;
  font-size: 22px;
}

.quantity button:disabled {
  color: #bbb;
  cursor: not-allowed;
}

.quantity output {
  min-width: 20px;
  text-align: center;
}

.pay-notice {
  margin: 14px 18px;
  color: #777;
  font-size: 13px;
  line-height: 1.7;
}

.bottom-bar {
  position: fixed;
  z-index: 30;
  right: max(0px, calc((100vw - 480px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 480px) / 2));
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgb(255 255 255 / 97%);
}

.bottom-bar__tools {
  display: flex;
  gap: 14px;
}

.tool-button {
  min-width: 45px;
  padding: 2px;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.tool-button span {
  display: block;
  margin-bottom: 2px;
  font-size: 23px;
}

.primary-button {
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.primary-button:active {
  background: var(--brand-dark);
}

.bottom-bar .primary-button {
  min-height: 48px;
  flex: 1;
  padding: 0 18px;
  font-size: 17px;
}

.total-block {
  min-width: 112px;
}

.total-block small {
  display: block;
  color: #777;
}

.total-block .price {
  font-size: 25px;
}

.site-footer {
  padding: 24px 12px 28px;
  color: #8d8d8d;
  font-size: 12px;
  text-align: center;
}

.page--with-bar .site-footer {
  padding-bottom: 18px;
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
}

.modal__mask {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgb(0 0 0 / 45%);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  max-height: 86vh;
  padding: 24px 22px calc(22px + var(--safe-bottom));
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  background: #fff;
}

.modal__panel h2 {
  margin: 0 36px 15px 0;
  font-size: 21px;
}

.modal__close {
  position: absolute;
  top: 15px;
  right: 16px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #777;
  font-size: 28px;
}

.modal__content {
  color: #555;
  font-size: 14px;
  line-height: 1.8;
}

.modal__content p,
.modal__content ol {
  margin: 7px 0;
}

.modal__content ol {
  padding-left: 20px;
}

.modal__confirm {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
}

@media (max-width: 359px) {
  .product-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .product-card__image {
    width: 96px;
    height: 108px;
  }

  .tabs {
    gap: 20px;
  }

  .order-card {
    grid-template-columns: 94px minmax(0, 1fr);
    padding: 14px;
  }

  .order-card img {
    width: 94px;
    height: 105px;
  }

  .bottom-bar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .bottom-bar__tools {
    gap: 6px;
  }
}

@media (min-width: 481px) {
  .app-shell {
    min-height: calc(100vh - 32px);
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: 18px;
  }
}
