#tool-body {
  --mt-primary: #ffd100;
  --mt-primary-dark: #f5b800;
  --mt-text: #1f2329;
  --mt-subtext: #667085;
  --mt-muted: #98a2b3;
  --mt-card: #ffffff;
  --mt-bg: #fff8df;
  --mt-border: #f2e3a2;
  --mt-danger: #ff4d4f;
  --mt-shadow: 0 12px 30px rgba(120, 90, 0, 0.12);
  color: var(--mt-text);
}

.theme-dark-mode #tool-body {
  --mt-text: #f5f5f5;
  --mt-subtext: #c8c8c8;
  --mt-muted: #9a9a9a;
  --mt-card: #2d2d2d;
  --mt-bg: #3a3218;
  --mt-border: #5f5124;
  --mt-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

#tool-body .coupon-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(255, 209, 0, 0.35), transparent 32%),
    linear-gradient(180deg, var(--mt-bg), transparent 360px);
  border-radius: 22px;
}

#tool-body .hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffd100 0%, #ffbe00 52%, #ff9f1c 100%);
  box-shadow: var(--mt-shadow);
}

#tool-body .hero:after {
  content: "";
  position: absolute;
  right: -48px;
  top: -58px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
}

#tool-body .hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

#tool-body .hero-title {
  font-size: 30px;
  font-weight: 800;
  color: #201a00;
  margin-bottom: 8px;
}

#tool-body .hero-desc {
  color: rgba(32, 26, 0, 0.75);
  font-size: 15px;
  line-height: 1.8;
  max-width: 620px;
}

#tool-body .hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

#tool-body .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  color: #332900;
  font-size: 13px;
  font-weight: 600;
}

#tool-body .hero-qrcode {
  width: 108px;
  min-width: 108px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

#tool-body .qr-auto {
  width: 88px;
  height: 88px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
}

#tool-body .qr-auto canvas,
#tool-body .qr-auto img {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

#tool-body .qr-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background:
    linear-gradient(90deg, #222 8px, transparent 8px) 0 0 / 18px 18px,
    linear-gradient(#222 8px, transparent 8px) 0 0 / 18px 18px,
    #fff;
}

#tool-body .hero-qrcode span {
  display: block;
  margin-top: 8px;
  color: #4a3c00;
  font-size: 12px;
}

#tool-body .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 2px 14px;
}

#tool-body .section-title {
  font-size: 20px;
  font-weight: 800;
}

#tool-body .section-tip {
  color: var(--mt-subtext);
  font-size: 13px;
}

#tool-body .category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 2px 16px;
}

#tool-body .category-tab {
  border: 1px solid var(--mt-border);
  background: var(--mt-card);
  color: var(--mt-subtext);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

#tool-body .category-tab.active {
  border-color: var(--mt-primary-dark);
  background: linear-gradient(135deg, var(--mt-primary), var(--mt-primary-dark));
  color: #211900;
  font-weight: 800;
}

#tool-body .category-tip {
  display: none;
  margin: -4px 2px 16px;
  padding: 10px 14px;
  border: 1px solid var(--mt-border);
  border-radius: 14px;
  background: rgba(255, 209, 0, 0.16);
  color: var(--mt-subtext);
  font-size: 13px;
  line-height: 1.7;
}

#tool-body .category-tip.show {
  display: block;
}

#tool-body .category-tip strong {
  color: var(--mt-text);
}

#tool-body .coupon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#tool-body .coupon-card {
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--mt-border);
  border-radius: 22px;
  background: var(--mt-card);
  box-shadow: 0 8px 22px rgba(20, 20, 20, 0.05);
}

#tool-body .coupon-card:before,
#tool-body .coupon-card:after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--mt-bg);
  transform: translateY(-50%);
  border: 1px solid var(--mt-border);
}

#tool-body .coupon-card:before {
  left: -10px;
}

#tool-body .coupon-card:after {
  right: -10px;
}

#tool-body .coupon-main {
  flex: 1;
  min-width: 0;
}

#tool-body .coupon-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

#tool-body .tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 209, 0, 0.22);
  color: #8a5d00;
  font-size: 12px;
  font-weight: 700;
}

.theme-dark-mode #tool-body .tag {
  color: #ffd95a;
}

#tool-body .coupon-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

#tool-body .coupon-value {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--mt-danger);
}

#tool-body .coupon-value strong {
  font-size: 34px;
  line-height: 1;
}

#tool-body .coupon-value span {
  padding-bottom: 4px;
  font-weight: 700;
}

#tool-body .coupon-value.is-benefit {
  display: inline-flex;
  align-items: center;
  gap: 0;
  max-width: 100%;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(255, 77, 79, 0.09);
  color: var(--mt-danger);
}

#tool-body .coupon-value.is-benefit strong {
  font-size: 18px;
  line-height: 1.2;
}

#tool-body .coupon-value.is-benefit span {
  padding-bottom: 0;
  font-size: 14px;
}

#tool-body .coupon-desc {
  color: var(--mt-subtext);
  line-height: 1.7;
  font-size: 13px;
  margin-bottom: 14px;
}

#tool-body .coupon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#tool-body .btn-claim {
  border: none;
  background: linear-gradient(135deg, var(--mt-primary), var(--mt-primary-dark));
  color: #211900;
  font-weight: 800;
  border-radius: 999px;
  padding: 0 20px;
}

#tool-body .btn-command,
#tool-body .btn-qr {
  border-radius: 999px;
}

#tool-body .btn-qr {
  width: 32px;
  padding: 0;
  text-align: center;
}

#tool-body .coupon-actions .btn-command {
  display: none;
}

#tool-body .coupon-side {
  width: 106px;
  min-width: 106px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 1px dashed var(--mt-border);
  padding-left: 14px;
  cursor: pointer;
}

#tool-body .coupon-side .qr-auto {
  width: 78px;
  height: 78px;
  padding: 5px;
}

#tool-body .qr-text {
  margin-top: 8px;
  color: var(--mt-muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
}

#tool-body .guide {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--mt-card);
  border: 1px solid var(--mt-border);
  color: var(--mt-subtext);
  line-height: 1.8;
  font-size: 13px;
}

#tool-body .guide strong {
  color: var(--mt-text);
}

#tool-body .coupon-dialog {
  padding: 18px;
  text-align: center;
  color: var(--mt-text);
}

#tool-body .coupon-dialog-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
}

#tool-body .coupon-dialog-qr {
  width: 180px;
  height: 180px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  margin: 8px auto 12px;
  box-sizing: border-box;
}

#tool-body .coupon-dialog-tip {
  color: var(--mt-subtext);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 12px;
}

#tool-body .coupon-dialog-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 768px) {
  #tool-body .coupon-page {
    padding: 12px;
    border-radius: 16px;
  }

  #tool-body .hero {
    padding: 22px;
  }

  #tool-body .hero-inner {
    display: block;
  }

  #tool-body .hero-title {
    font-size: 25px;
  }

  #tool-body .hero-qrcode {
    margin-top: 16px;
    width: 100%;
  }

  #tool-body .coupon-grid {
    grid-template-columns: 1fr;
  }

  #tool-body .coupon-card {
    padding: 16px;
  }

  #tool-body .coupon-actions .btn-command {
    display: inline-block;
  }

  #tool-body .coupon-side {
    display: none;
  }

  #tool-body .coupon-side .qr-auto {
    width: 68px;
    height: 68px;
  }

  #tool-body .coupon-value strong {
    font-size: 30px;
  }
}

@media (max-width: 420px) {
  #tool-body .coupon-card {
    flex-direction: column;
  }

  #tool-body .coupon-side {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    border-left: 0;
    border-top: 1px dashed var(--mt-border);
    padding: 12px 0 0;
  }

  #tool-body .qr-text {
    text-align: left;
    margin-top: 0;
  }
}