@charset "UTF-8";

:root {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  color: #332a27;
  background: #eee9e5;
  font-synthesis: none;
  --red: #b4232e;
  --red-dark: #861720;
  --red-light: #d4484d;
  --gold: #d7b47d;
  --text: #332a27;
  --muted: #82756f;
  --line: #ece2dc;
  --paper: #fff;
  --background: #f7f4f1;
  --shadow: 0 10px 30px rgba(81, 42, 32, 0.07);
  --shadow-hover: 0 16px 36px rgba(113, 42, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #eee9e5;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(180, 35, 46, 0.06), transparent 32%),
    radial-gradient(circle at 85% 95%, rgba(215, 180, 125, 0.12), transparent 35%),
    #eee9e5;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.page {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--background);
}

.ad-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #aaa09a;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 2px;
}

.home-heading,
.detail-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 221, 178, 0.2), transparent 34%),
    radial-gradient(circle at 5% 95%, rgba(255, 187, 153, 0.12), transparent 38%),
    linear-gradient(145deg, var(--red-dark), var(--red) 58%, #c3323b);
  text-align: center;
}

.home-heading::after,
.detail-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -58px;
  bottom: -88px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(255, 239, 215, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 239, 215, 0.035), 0 0 0 58px rgba(255, 239, 215, 0.025);
}

.home-heading {
  padding: 42px 26px 46px;
  border-radius: 0 0 30px 30px;
}

.bank-name {
  color: rgba(255, 244, 228, 0.8);
  font-size: 14px;
  letter-spacing: 4px;
}

.home-heading h1 {
  margin-top: 22px;
  color: #fff9ee;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: 5px;
  text-shadow: 0 4px 16px rgba(65, 5, 12, 0.2);
}

.home-heading h1 span {
  display: block;
}

.home-subtitle {
  display: inline-block;
  margin-top: 22px;
  padding: 7px 17px;
  border: 1px solid rgba(255, 236, 209, 0.28);
  border-radius: 999px;
  color: #fff3df;
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 1px;
}

.card-description {
  max-width: 310px;
  margin: 25px auto 0;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 239, 218, 0.2);
  color: rgba(255, 244, 230, 0.7);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 1px;
}

.benefit-list {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 17px;
  margin-top: -20px;
  padding: 0 18px 42px;
}

.benefit-card {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(156, 105, 87, 0.09);
  border-radius: 18px;
  color: var(--text);
  background: var(--paper);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.benefit-card::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--red-light), var(--red-dark));
}

.benefit-card .ad-badge {
  top: 21px;
  right: 18px;
}

.benefit-date {
  padding: 20px 20px 0;
  color: #9a8b84;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.3px;
}

.benefit-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 22px 20px;
}

.benefit-body > div {
  min-width: 0;
}

.benefit-body h2 {
  color: var(--red);
  font-size: 27px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: 1px;
}

.benefit-summary {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.participate-button {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 10px 17px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--red-light), var(--red));
  box-shadow: 0 6px 14px rgba(180, 35, 46, 0.2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.detail-hero {
  padding: 66px 24px 46px;
  border-radius: 0 0 30px 30px;
}

.detail-hero > .ad-badge {
  color: rgba(255, 244, 230, 0.65);
}

.detail-title {
  position: relative;
  z-index: 1;
}

.back-button,
.logout-button {
  position: absolute;
  z-index: 3;
  top: 16px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 244, 225, 0.32);
  border-radius: 999px;
  color: rgba(255, 250, 240, 0.92);
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.back-button {
  left: 16px;
}

.logout-button {
  right: 16px;
}

.detail-card-name {
  color: rgba(255, 241, 222, 0.75);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 1px;
}

.detail-title h1 {
  margin-top: 17px;
  color: #fff9ee;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 4px;
  text-shadow: 0 4px 15px rgba(65, 5, 12, 0.18);
}

.detail-title h2 {
  margin-top: 8px;
  color: #ffe9c9;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.4;
}

.detail-subtitle {
  display: inline-block;
  margin-top: 17px;
  padding: 6px 14px;
  border-radius: 999px;
  color: rgba(255, 244, 230, 0.82);
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
  line-height: 1.6;
}

.detail-content {
  position: relative;
  z-index: 2;
  margin-top: -20px;
  padding: 0 14px 42px;
}

.coupon-panel,
.rules-card,
.marketing-panel {
  border: 1px solid rgba(156, 105, 87, 0.09);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.coupon-panel {
  padding: 20px;
}

.coupon-panel > h2,
.marketing-panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.coupon-panel > h2::before,
.marketing-panel h2::before {
  content: "";
  width: 4px;
  height: 17px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--red-light), var(--red-dark));
}

.coupon-panel > h2 {
  margin-bottom: 16px;
}

.coupon {
  display: flex;
  align-items: stretch;
  min-height: 96px;
  overflow: hidden;
  border: 1px solid #f0dcd5;
  border-radius: 14px;
  background: linear-gradient(120deg, #fff9f6, #fff3ee);
}

.coupon-value {
  display: flex;
  flex: 0 0 34%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px dashed #dfb9ad;
  color: var(--red);
}

.coupon-value strong {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -1px;
  white-space: nowrap;
}

.coupon-value small {
  margin-bottom: 4px;
  color: #a26455;
  font-size: 12px;
}

.coupon-description {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 13px;
  color: var(--text);
  line-height: 1.6;
}

.coupon-description strong {
  font-size: 16px;
  font-weight: 700;
}

.coupon-description span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.coupon-monthly .coupon-value {
  flex-basis: 42%;
}

.coupon-monthly .coupon-value strong {
  font-size: 31px;
}

.claim-button,
.primary-button {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--red-light), var(--red));
  box-shadow: 0 8px 18px rgba(180, 35, 46, 0.2);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.claim-button {
  display: block;
  width: 100%;
  max-width: 290px;
  height: 50px;
  margin: 22px auto;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
}

.claim-button.is-claimed,
.claim-button:disabled {
  color: #f5f3f1;
  background: #bbb5b1;
  box-shadow: none;
  cursor: default;
}

.rules-card {
  overflow: hidden;
}

.rules-card > h2 {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  font-weight: 700;
  text-align: left;
}

.rules-body {
  padding: 18px 16px 22px;
}

.rule-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 17px;
}

.rule-row:last-child {
  margin-bottom: 0;
}

.rule-row h3 {
  align-self: start;
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--red);
  background: #fff0ec;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}

.rule-copy {
  min-width: 0;
  color: #594b45;
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.rule-copy ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rules;
}

.rule-copy li {
  position: relative;
  padding-left: 18px;
  counter-increment: rules;
}

.rule-copy li::before {
  content: counter(rules) ".";
  position: absolute;
  left: 0;
  color: var(--red);
}

.marketing-header {
  padding-bottom: 46px;
}

.marketing-content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 17px;
  margin-top: -20px;
  padding: 0 14px 42px;
}

.marketing-panel {
  padding: 20px;
}

.panel-description {
  margin: 9px 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  color: #554741;
  font-size: 13px;
  font-weight: 600;
}

.form-field input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #e3d8d2;
  border-radius: 10px;
  color: var(--text);
  background: #fbf9f7;
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-field input::placeholder {
  color: #b0a49e;
}

.form-field input:focus {
  border-color: rgba(180, 35, 46, 0.6);
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(180, 35, 46, 0.08);
}

.code-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.primary-button,
.secondary-button {
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
}

.primary-button {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 17px;
  font-size: 15px;
  font-weight: 500;
}

.secondary-button {
  padding: 9px 13px;
  border: 1px solid #ddc8c0;
  color: var(--red);
  background: #fff;
  font-size: 13px;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease;
}

.primary-button:disabled,
.secondary-button:disabled {
  border-color: #ddd6d2;
  color: #99918c;
  background: #eeeae7;
  box-shadow: none;
  cursor: default;
}

.form-hint {
  margin: -3px 0 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.form-error {
  min-height: 22px;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.6;
}

.qr-panel > .primary-button {
  max-width: 290px;
  margin: 0 auto;
}

.qr-result {
  display: grid;
  justify-items: center;
  gap: 15px;
  margin-top: 22px;
}

.qr-result[hidden] {
  display: none;
}

.qr-code {
  width: 236px;
  height: 236px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(65, 40, 32, 0.09);
}

.qr-code canvas,
.qr-code img {
  display: block;
  width: 216px;
  height: 216px;
  border-radius: 7px;
}

.qr-code img {
  -webkit-touch-callout: default;
  touch-action: manipulation;
  user-select: auto;
}

.qr-save-hint {
  margin-top: -4px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.marketing-link {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #faf7f5;
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-heading > span {
  color: #a0928b;
  font-size: 11px;
  white-space: nowrap;
}

.marketing-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
  padding: 17px 0;
  border-radius: 14px;
  background: linear-gradient(120deg, #fff5f0, #faf6f2);
}

.marketing-stats > div {
  text-align: center;
}

.marketing-stats > div + div {
  border-left: 1px solid #eadbd4;
}

.marketing-stats strong {
  display: block;
  color: var(--red);
  font-size: 26px;
  font-weight: 750;
  line-height: 1.2;
}

.marketing-stats span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.record-list {
  display: grid;
  gap: 13px;
  margin-top: 18px;
}

.marketing-record {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fdfcfa;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.record-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-top h3 {
  color: #3e322e;
  font-size: 17px;
  font-weight: 700;
}

.record-status-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.status-badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.status-pending {
  color: #8b5a0b;
  background: #fff0ce;
}

.status-issued {
  color: #256b43;
  background: #e2f3e8;
}

.status-failed {
  color: #a12d34;
  background: #fbe5e4;
}

.status-update-button {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
}

.record-details {
  display: grid;
  gap: 9px;
  margin: 15px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #f8f5f2;
  font-size: 12px;
}

.record-details > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.record-details > div[hidden] {
  display: none;
}

.record-details dt {
  color: #92857e;
}

.record-details dd {
  margin: 0;
  color: #51453f;
  font-weight: 500;
  text-align: right;
}

.empty-records {
  padding: 26px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.view-more-button {
  display: block;
  width: max-content;
  margin: 18px auto 0;
  padding: 9px 22px;
  border-radius: 999px;
  text-decoration: none;
}

.records-filter {
  margin-top: 18px;
}

.records-filter select {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px solid #e3d8d2;
  border-radius: 10px;
  color: var(--text);
  background: #fbf9f7;
  font: inherit;
}

.records-filter select:focus {
  border-color: rgba(180, 35, 46, 0.6);
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(180, 35, 46, 0.08);
}

.date-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.filter-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.filter-actions .secondary-button {
  min-height: 46px;
  padding-right: 18px;
  padding-left: 18px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pagination > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pagination .secondary-button {
  min-width: 78px;
}

@media (max-width: 374px) {
  .date-filter-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .pagination {
    gap: 8px;
  }

  .pagination .secondary-button {
    min-width: 70px;
  }
}

.toast {
  position: fixed;
  z-index: 100;
  bottom: max(30px, env(safe-area-inset-bottom));
  left: 50%;
  width: max-content;
  max-width: calc(100vw - 48px);
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #fff;
  background: rgba(48, 38, 34, 0.92);
  box-shadow: 0 10px 30px rgba(45, 25, 20, 0.2);
  backdrop-filter: blur(10px);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #16748b;
  outline-offset: 3px;
}

@media (hover: hover) {
  .benefit-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
  }

  .participate-button:hover,
  .claim-button:not(:disabled):hover,
  .primary-button:not(:disabled):hover {
    filter: brightness(1.04);
  }

  .claim-button:not(:disabled):hover,
  .primary-button:not(:disabled):hover {
    box-shadow: 0 10px 22px rgba(180, 35, 46, 0.25);
    transform: translateY(-1px);
  }

  .secondary-button:not(:disabled):hover {
    border-color: rgba(180, 35, 46, 0.55);
    background: #fff8f6;
  }

  .back-button:hover,
  .logout-button:hover {
    border-color: rgba(255, 244, 225, 0.55);
    background: rgba(255, 255, 255, 0.13);
  }

  .marketing-record:hover {
    border-color: #dec9c0;
    box-shadow: 0 7px 18px rgba(81, 42, 32, 0.05);
  }
}

@media (min-width: 521px) {
  body {
    padding: 26px 0;
  }

  .page {
    min-height: calc(100vh - 52px);
    border: 1px solid rgba(127, 91, 76, 0.1);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(69, 37, 29, 0.12);
  }
}

@media (max-width: 374px) {
  .home-heading {
    padding-right: 18px;
    padding-left: 18px;
  }

  .home-heading h1 {
    font-size: 38px;
  }

  .home-subtitle {
    font-size: 16px;
  }

  .benefit-list {
    padding-right: 12px;
    padding-left: 12px;
  }

  .benefit-body {
    gap: 9px;
    padding-right: 13px;
    padding-left: 16px;
  }

  .benefit-body h2 {
    font-size: 24px;
  }

  .benefit-summary {
    font-size: 12px;
  }

  .participate-button {
    padding-right: 12px;
    padding-left: 12px;
    font-size: 13px;
  }

  .detail-title h1 {
    font-size: 34px;
  }

  .detail-title h2 {
    font-size: 21px;
  }

  .detail-content,
  .marketing-content {
    padding-right: 10px;
    padding-left: 10px;
  }

  .coupon-panel,
  .marketing-panel {
    padding: 15px;
  }

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

  .coupon-monthly .coupon-value strong {
    font-size: 26px;
  }

  .coupon-description {
    padding: 10px;
  }

  .coupon-description strong {
    font-size: 14px;
  }

  .rules-body {
    padding-right: 12px;
    padding-left: 12px;
  }

  .rule-row {
    gap: 6px;
  }

  .rule-copy {
    font-size: 12px;
  }

  .code-input-row {
    gap: 7px;
  }

  .secondary-button {
    padding-right: 9px;
    padding-left: 9px;
    font-size: 12px;
  }

  .marketing-record {
    padding: 13px;
  }

  .record-top {
    flex-wrap: wrap;
  }

  .record-status-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .marketing-stats strong {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
