main[data-product-detail-page] [data-buyer-showcase]:not([hidden]) {
  display: block;
}

main[data-product-detail-page] .buyer-review-entry {
  padding: 0;
  background: #fff;
  border: 1px solid #eee3d6;
  border-radius: 14px;
  overflow: hidden;
}

main[data-product-detail-page] .buyer-review-entry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: start;
  padding: 20px 22px;
  border-bottom: 1px solid #f0e7db;
}

main[data-product-detail-page] .buyer-review-entry-title h2 {
  margin: 4px 0 0;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
}

main[data-product-detail-page] .buyer-review-entry-copy {
  margin: 10px 0 0;
  color: #6a675f;
  font-size: 14px;
  line-height: 1.7;
}

main[data-product-detail-page] .buyer-review-entry-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 10px;
  min-width: min(360px, 38vw);
}

main[data-product-detail-page] .buyer-review-stat {
  padding: 11px 12px;
  border: 1px solid #ece2d5;
  border-radius: 10px;
  background: #fffaf5;
  text-align: center;
}

main[data-product-detail-page] .buyer-review-stat strong,
main[data-product-detail-page] .buyer-review-stat span {
  display: block;
}

main[data-product-detail-page] .buyer-review-stat strong {
  color: #221f1a;
  font-size: 22px;
  line-height: 1;
}

main[data-product-detail-page] .buyer-review-stat span {
  margin-top: 5px;
  color: #7a756d;
  font-size: 12px;
  font-weight: 700;
}

main[data-product-detail-page] .buyer-review-entry-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: start;
  min-width: 0;
}

main[data-product-detail-page] .buyer-review-entry-hint {
  color: #968c81;
  font-size: 12px;
}

main[data-product-detail-page] .buyer-review-open-button {
  min-height: 40px;
  padding-inline: 18px;
}

main[data-product-detail-page] .buyer-review-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 22px 22px;
}

main[data-product-detail-page] .buyer-review-preview-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #f0e5d7;
  border-radius: 12px;
  background: #fff;
}

main[data-product-detail-page] .buyer-review-preview-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}

main[data-product-detail-page] .buyer-review-preview-info strong,
main[data-product-detail-page] .buyer-review-preview-info span {
  display: block;
}

main[data-product-detail-page] .buyer-review-preview-info strong {
  color: #1f1c17;
  font-size: 14px;
}

main[data-product-detail-page] .buyer-review-preview-info span {
  margin-top: 3px;
  color: #8a8277;
  font-size: 12px;
}

main[data-product-detail-page] .buyer-review-preview-text {
  margin: 0;
  color: #2f2b25;
  font-size: 14px;
  line-height: 1.75;
}

main[data-product-detail-page] .buyer-review-preview-card .buyer-review-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

main[data-product-detail-page] .buyer-review-preview-card .buyer-review-preview-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

main[data-product-detail-page] .buyer-review-avatar {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #f1dfc9;
  color: #7d4f18;
  font-size: 15px;
  font-weight: 800;
}

body.buyer-review-lock {
  overflow: hidden;
}

.buyer-review-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 20, 15, 0.45);
}

.buyer-review-modal[hidden] {
  display: none;
}

.buyer-review-modal-panel {
  width: min(1320px, calc(100vw - 24px));
  height: min(94vh, 1080px);
  max-height: none;
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.buyer-review-modal-head {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: start;
  padding: 18px 20px 14px;
}

.buyer-review-modal-eyebrow {
  margin: 0;
  color: #9c7a4a;
  font-size: 12px;
  font-weight: 800;
}

.buyer-review-modal-title {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.2;
}

.buyer-review-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #f6f1ea;
  color: #5f5447;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.buyer-review-modal-bar {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 16px;
  border-bottom: 1px solid #f1e8db;
}

.buyer-review-verified {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: #a56a20;
  font-size: 13px;
  font-weight: 700;
}

.buyer-review-modal-bar-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.buyer-review-select {
  min-width: 124px;
  height: 34px;
  padding: 0 34px 0 12px;
  border: 1px solid #e6ddd0;
  border-radius: 8px;
  background-color: #fff;
  color: #2f2b25;
  font-size: 13px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #7d7469 50%),
    linear-gradient(135deg, #7d7469 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 15px,
    calc(100% - 11px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.buyer-review-modal-content {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  min-height: 0;
}

.buyer-review-tabs-wrap {
  padding: 14px 20px 0;
}

.buyer-review-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.buyer-review-tab {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #fff7ef;
  color: #2f2b25;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.buyer-review-tab.is-active {
  border-color: #f1bc80;
  background: #fff2e5;
  color: #b06a16;
}

.buyer-review-list {
  min-height: 0;
  overflow: auto;
  padding: 10px 20px 0;
}

.buyer-review-empty {
  padding: 18px 0 20px;
  color: #7a756d;
  font-size: 14px;
}

.buyer-review-card {
  padding: 18px 0 20px;
  border-bottom: 1px solid #f1e8db;
}

.buyer-review-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.buyer-review-card-left {
  display: flex;
  gap: 12px;
  min-width: 0;
  align-items: center;
}

.buyer-review-card-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.buyer-review-card-meta strong {
  color: #1f1c17;
  font-size: 15px;
}

.buyer-review-card-line {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  color: #8b8378;
  font-size: 12px;
}

.buyer-review-stars {
  color: #f08a24;
  font-size: 15px;
  letter-spacing: 0;
}

.buyer-review-card-right {
  color: #a97a45;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.buyer-review-card-text {
  margin: 12px 0 0;
  color: #2f2b25;
  font-size: 15px;
  line-height: 1.8;
}

.buyer-review-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.buyer-review-photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.buyer-review-reply {
  margin-top: 12px;
  padding: 12px 14px;
  border-top: 1px solid #f1e8db;
  background: #fffaf4;
  border-radius: 8px;
}

.buyer-review-reply-label {
  display: inline-flex;
  margin-bottom: 8px;
  color: #a06b26;
  font-size: 12px;
  font-weight: 700;
}

.buyer-review-reply p {
  margin: 0;
  color: #6f675e;
  font-size: 13px;
  line-height: 1.75;
}

.buyer-review-compose {
  display: grid;
  gap: 8px;
  padding: 8px 20px 10px;
  border-top: 1px solid #f1e8db;
  background: #fffdf9;
}

.buyer-review-compose-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.buyer-review-upload-button {
  appearance: none;
  padding: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  min-height: 56px;
  overflow: hidden;
  border: 1px solid #e7d8c6;
  border-radius: 8px;
  background: #fff8ed;
  color: #8b5a1f;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.buyer-review-upload-button::before {
  content: '+';
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}

.buyer-review-upload-button:hover {
  border-color: #bd7d37;
  background: #fff0dc;
  box-shadow: 0 6px 14px rgba(139, 90, 31, 0.12);
  transform: translateY(-1px);
}

.buyer-review-upload-button:focus-visible {
  border-color: #8b5a1f;
  box-shadow: 0 0 0 3px rgba(139, 90, 31, 0.18);
}

.buyer-review-text-field {
  min-width: 0;
}

.buyer-review-text-field textarea {
  width: 100%;
  height: 56px;
  min-height: 56px;
  padding: 4px 13px;
  line-height: 1.4;
  resize: vertical;
}

.buyer-review-compose-actions {
  display: flex;
  justify-content: flex-end;
  align-self: start;
}

.buyer-review-compose-actions .button {
  min-height: 56px;
  white-space: nowrap;
}

.buyer-review-output {
  min-height: 20px;
  color: #8b5a1f;
  font-size: 13px;
}

@media (max-width: 980px) {
  main[data-product-detail-page] .buyer-review-entry-head {
    grid-template-columns: 1fr;
  }

  main[data-product-detail-page] .buyer-review-entry-stats {
    min-width: 0;
    width: 100%;
  }

  main[data-product-detail-page] .buyer-review-entry-actions {
    justify-items: start;
  }

  main[data-product-detail-page] .buyer-review-preview-grid {
    grid-template-columns: 1fr;
  }

  .buyer-review-modal-panel {
    width: min(calc(100vw - 16px), 1320px);
    max-height: calc(100vh - 16px);
  }

  .buyer-review-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  main[data-product-detail-page] .buyer-review-entry-head,
  main[data-product-detail-page] .buyer-review-preview-grid,
  .buyer-review-modal-head,
  .buyer-review-modal-bar,
  .buyer-review-list,
  .buyer-review-tabs-wrap,
  .buyer-review-compose {
    padding-left: 16px;
    padding-right: 16px;
  }

  .buyer-review-card-head {
    flex-direction: column;
  }

  .buyer-review-compose-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
  }

  .buyer-review-upload-button {
    width: 44px;
  }

  .buyer-review-compose-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .buyer-review-compose-actions .button {
    min-height: 40px;
  }

  .buyer-review-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Taobao-like inline review block */
main[data-product-detail-page] .taobao-review-entry {
  border: 0;
  border-radius: 0;
  background: #fff;
  overflow: visible;
}

main[data-product-detail-page] .buyer-review-section-title {
  padding: 28px 56px 0;
}

main[data-product-detail-page] .buyer-review-section-title h2 {
  margin: 0;
  color: #1f1d1a;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 850;
}

main[data-product-detail-page] .buyer-review-preview-list {
  display: grid;
  gap: 0;
  padding: 0 56px;
}

main[data-product-detail-page] .buyer-review-preview-card {
  display: block;
  padding: 18px 0 24px;
  border: 0;
  border-bottom: 1px solid #f0eee9;
  border-radius: 0;
  background: #fff;
}

main[data-product-detail-page] .buyer-review-preview-meta {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

main[data-product-detail-page] .buyer-review-avatar {
  width: 38px;
  height: 38px;
  border: 2px solid #f4d990;
  background: #f6d1a8;
  color: #7d501c;
  font-size: 14px;
}

main[data-product-detail-page] .buyer-review-preview-info {
  min-width: 0;
}

main[data-product-detail-page] .buyer-review-preview-name-row {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

main[data-product-detail-page] .buyer-review-preview-name-row strong {
  color: #1f1d1a;
  font-size: 14px;
  font-weight: 750;
}

main[data-product-detail-page] .buyer-review-level-badge {
  display: inline-flex;
  min-width: 22px;
  height: 14px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff7a20, #ff3d1d);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

main[data-product-detail-page] .buyer-review-level-badge.blue {
  background: linear-gradient(90deg, #79d6ff, #44a8ff);
}

main[data-product-detail-page] .buyer-review-preview-detail {
  display: block;
  margin-top: 4px;
  color: #8a857d;
  font-size: 13px;
}

main[data-product-detail-page] .buyer-review-preview-tools {
  color: #8e8982;
  font-size: 13px;
  white-space: nowrap;
}

main[data-product-detail-page] .buyer-review-preview-text {
  margin: 10px 0 10px 54px;
  color: #1f1d1a;
  font-size: 15px;
  line-height: 1.75;
}

main[data-product-detail-page] .buyer-review-preview-photos {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 8px;
  margin-left: 54px;
  max-width: 850px;
}

main[data-product-detail-page] .buyer-review-preview-photo {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f1ea;
  cursor: pointer;
}

main[data-product-detail-page] .buyer-review-preview-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

main[data-product-detail-page] .buyer-review-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 14px;
}

main[data-product-detail-page] .buyer-review-seller-reply {
  margin: 18px 0 0 54px;
  padding-top: 14px;
  border-top: 1px solid #f0eee9;
  color: #8a857d;
  font-size: 14px;
  line-height: 1.8;
}

main[data-product-detail-page] .buyer-review-preview-footer {
  display: flex;
  justify-content: center;
  padding: 18px 0 6px;
}

main[data-product-detail-page] .buyer-review-all-button {
  min-width: 150px;
  min-height: 44px;
  padding: 0 26px;
  border: 1px solid #eee8dc;
  border-radius: 999px;
  background: #fff;
  color: #1f1d1a;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(25, 24, 20, 0.04);
}

main[data-product-detail-page] .buyer-review-all-button:hover {
  border-color: #ff8a55;
  color: #ff4d1c;
}

@media (max-width: 980px) {
  main[data-product-detail-page] .buyer-review-section-title,
  main[data-product-detail-page] .buyer-review-preview-list {
    padding-left: 22px;
    padding-right: 22px;
  }

  main[data-product-detail-page] .buyer-review-preview-photos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-left: 0;
  }

  main[data-product-detail-page] .buyer-review-preview-text,
  main[data-product-detail-page] .buyer-review-seller-reply {
    margin-left: 0;
  }
}

/* Inline product review: no avatar/name, origin only on bottom-right */
main[data-product-detail-page] .taobao-review-entry .buyer-review-preview-card {
  position: relative;
  padding: 18px 0 28px;
}

main[data-product-detail-page] .taobao-review-entry .buyer-review-preview-meta,
main[data-product-detail-page] .taobao-review-entry .buyer-review-preview-info,
main[data-product-detail-page] .taobao-review-entry .buyer-review-preview-name-row,
main[data-product-detail-page] .taobao-review-entry .buyer-review-preview-tools {
  display: none;
}

main[data-product-detail-page] .taobao-review-entry .buyer-review-preview-text {
  margin: 0 0 12px;
  color: #1f1d1a;
  font-size: 15px;
  line-height: 1.8;
}

main[data-product-detail-page] .taobao-review-entry .buyer-review-preview-photos {
  margin-left: 0;
  max-width: 850px;
}

main[data-product-detail-page] .buyer-review-preview-origin {
  margin-top: 12px;
  color: #8a857d;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}
