:root {
  --page-bg: #f4f4f4;
  --card-bg: #ffffff;
  --line: #e8e8e8;
  --text-main: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  --primary: #ff5000;
  --primary-dark: #ff2f00;
  --accent-bg: #fff2eb;
  --taobao-red: #ff4400;
  --taobao-line: #f40;
  --table-head: #fcfcfc;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--page-bg);
  color: var(--text-main);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.checkout-page {
  min-height: 100vh;
  padding-bottom: 32px;
}

.checkout-main {
  width: 1080px;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  padding: 16px 0 24px;
}

.card {
  background: var(--card-bg);
  border-radius: 0;
  box-shadow: none;
  border: 1px solid #f0f0f0;
}

.card + .card {
  margin-top: 18px;
}

.product-card,
.summary-card {
  padding: 16px 18px;
}

.section-title,
.shop-bar,
.option-row,
.summary-row,
.address-info__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-title {
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--taobao-red);
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
}

.shop-bar {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.shop-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.shop-name__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #fff0e8;
  color: var(--primary);
  font-size: 12px;
}

.shop-service {
  color: var(--primary);
  font-size: 11px;
}

.shop-tag {
  padding: 1px 6px;
  border: 1px solid #ffd0bc;
  color: var(--taobao-red);
  font-size: 11px;
  line-height: 1.5;
  background: #fff6f2;
}

.product-table {
  margin-top: 10px;
}

.product-table__header,
.product-row {
  display: grid;
  grid-template-columns: minmax(380px, 1.8fr) 0.45fr 0.5fr 0.5fr;
  gap: 14px;
  align-items: center;
}

.product-table__header {
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: 12px;
  background: var(--table-head);
  border: 1px solid #f0f0f0;
}

.product-row {
  padding: 14px 12px;
  border: 1px solid #f0f0f0;
  border-top: 0;
  background: #fffdfc;
}

.product-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.image-placeholder {
  width: 84px;
  height: 84px;
  border-radius: 0;
  border: 1px solid #f0f0f0;
  background: #ffffff;
  overflow: hidden;
  flex-shrink: 0;
}

.product-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-meta h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.product-spec,
.product-desc {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.product-desc {
  color: #999999;
}

.product-badges {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.product-badges span {
  padding: 1px 6px;
  border: 1px solid #ffcab3;
  color: var(--taobao-red);
  font-size: 11px;
  background: #fffaf7;
}

.product-price,
.product-subtotal {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.currency {
  font-size: 12px;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d9d9d9;
  border-radius: 0;
  overflow: hidden;
  justify-self: start;
}

.qty-button {
  width: 24px;
  height: 24px;
  border: 0;
  background: #f6f6f6;
  color: #666666;
  font-size: 14px;
  line-height: 1;
}

.qty-button:hover {
  background: #efefef;
}

.qty-input {
  width: 36px;
  height: 24px;
  border: 0;
  border-left: 1px solid #d9d9d9;
  border-right: 1px solid #d9d9d9;
  text-align: center;
  font-weight: 600;
  color: var(--text-main);
  background: #ffffff;
  font-size: 11px;
}

.qty-input:focus {
  outline: none;
}

.order-options {
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid var(--line);
}

.option-row {
  padding: 10px 12px;
  border-bottom: 1px solid #f4f4f4;
  background: #fcfcfc;
  font-size: 12px;
}

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

.option-row > span,
.option-row > label {
  font-weight: 400;
  color: var(--text-secondary);
}

.option-row__value {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
}

.option-emphasis {
  color: var(--taobao-red);
}

.option-row--textarea {
  align-items: flex-start;
}

.option-row textarea {
  width: min(520px, 100%);
  min-height: 60px;
  border: 1px solid #e7e7e7;
  border-radius: 0;
  resize: vertical;
  padding: 10px 12px;
  color: var(--text-main);
  background: #fcfcfc;
  font-size: 12px;
}

.option-row textarea:focus {
  outline: 2px solid rgba(255, 80, 0, 0.14);
  border-color: #ffb38f;
}

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

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

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #dadada;
  transition: 0.2s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  transition: 0.2s ease;
}

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

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

.summary-card {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  align-items: flex-end;
  border: 0;
  background: transparent;
  padding: 12px 12px 0;
  margin-top: 8px;
}

.summary-row {
  padding: 4px 0;
  font-size: 12px;
}

.summary-row strong {
  font-size: 14px;
}

.discount {
  color: #11a652;
}

.summary-pay {
  min-width: 280px;
  padding: 12px;
  border-radius: 0;
  background: #fff7e8;
  border: 1px solid #f7d8ad;
  text-align: right;
}

.summary-pay .submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.summary-pay__price {
  margin: 0;
  font-size: 12px;
}

.summary-pay__price span {
  color: var(--primary-dark);
}

.summary-pay__price strong {
  font-size: 24px;
}

.summary-pay__address,
.summary-pay__receiver {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
}

.submit-button {
  min-width: 120px;
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, #ff6600 0%, #ff4200 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: none;
}

.submit-button:hover {
  filter: brightness(1.02);
}

@media (max-width: 960px) {
  .product-table__header {
    display: none;
  }

  .product-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .product-price,
  .product-subtotal {
    font-size: 18px;
  }

  .summary-card {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-pay {
    min-width: 0;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .checkout-main {
    width: min(100% - 24px, 100%);
  }

  .product-card,
  .summary-card {
    padding: 14px;
  }

  .product-info,
  .section-title,
  .shop-bar,
  .option-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-info {
    width: 100%;
  }

  .image-placeholder {
    width: 100%;
    max-width: 140px;
  }

  .option-row__value {
    flex-wrap: wrap;
  }

  .option-row textarea {
    width: 100%;
  }

  .submit-button {
    width: 100%;
  }
}
