:root {
  --match-ink: #27213a;
  --match-muted: #766f82;
  --match-line: #eadfe6;
  --match-rose: #bf5c7a;
  --match-soft: #fff5f8;
  --match-warm: #fffaf4;
}

body.matchmaking-page {
  margin: 0;
  background:
    radial-gradient(circle at 8% 8%, rgba(241, 190, 208, .34), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(250, 218, 175, .30), transparent 30rem),
    #fbfafc;
  color: var(--match-ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

.matchmaking {
  min-height: 100vh;
}

.match-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(222, 205, 215, .75);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(16px);
}

.match-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.match-brand i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ce6886, #9c496e);
  color: #fff;
  font-style: normal;
  box-shadow: 0 8px 20px rgba(177, 75, 112, .22);
}

.match-back {
  border: 1px solid var(--match-line);
  border-radius: 999px;
  padding: 9px 16px;
  background: #fff;
  color: var(--match-ink);
  font-weight: 700;
  cursor: pointer;
}

.match-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 16px;
}

.match-actions button,
.match-dialog button,
.share-result button {
  border: 1px solid var(--match-line);
  border-radius: 999px;
  padding: 9px 14px;
  background: #fff;
  color: var(--match-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.match-actions button:hover,
.match-actions button.active,
.match-dialog footer button:last-child,
.share-result button {
  border-color: #b65678;
  background: #b65678;
  color: #fff;
}

.match-actions button:disabled,
.match-dialog button:disabled {
  cursor: wait;
  opacity: .6;
}

.share-expiry {
  color: var(--match-muted);
  font-size: 12px;
}

.match-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.match-hero {
  display: grid;
  grid-template-columns: minmax(260px, 390px) 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid rgba(230, 211, 221, .9);
  border-radius: 34px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 28px 80px rgba(75, 52, 67, .09);
}

.match-photo {
  position: relative;
  overflow: hidden;
  aspect-ratio: 474 / 609;
  border-radius: 28px;
  background: #eee7e8;
  box-shadow: 0 20px 48px rgba(70, 48, 59, .18);
}

.match-photo img {
  position: absolute;
  top: -36.45%;
  left: -10.1%;
  width: 269.62%;
  max-width: none;
  height: auto;
}

.match-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: inherit;
  pointer-events: none;
}

.match-photo.photo-hidden {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f8e8ee, #f4dfe7);
}

.match-photo-placeholder {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: #fff;
  color: #a04b6d;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 800;
  box-shadow: 0 16px 40px rgba(94, 48, 67, .12);
}

.match-kicker {
  margin: 0 0 14px;
  color: var(--match-rose);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .16em;
}

.match-hero h1 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.match-lead {
  max-width: 680px;
  margin: 24px 0;
  color: var(--match-muted);
  font-size: 18px;
  line-height: 1.85;
}

.match-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.match-tags span {
  padding: 8px 13px;
  border: 1px solid #ecd9e1;
  border-radius: 999px;
  background: var(--match-soft);
  color: #8b3f60;
  font-size: 14px;
  font-weight: 700;
}

.match-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 24px 0 44px;
}

.match-fact {
  padding: 20px;
  border: 1px solid var(--match-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .8);
}

.match-fact small {
  display: block;
  margin-bottom: 7px;
  color: var(--match-muted);
}

.match-fact strong {
  font-size: 19px;
}

.match-section {
  margin-top: 24px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--match-line);
  border-radius: 28px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 16px 48px rgba(66, 49, 60, .045);
}

.match-section-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.match-section-head > span {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: var(--match-soft);
  color: var(--match-rose);
  font-weight: 900;
}

.match-section h2 {
  margin: 0 0 6px;
  font-size: 25px;
}

.match-section-head p {
  margin: 0;
  color: var(--match-muted);
}

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

.match-item {
  padding: 18px 20px;
  border-radius: 18px;
  background: #faf8fa;
  line-height: 1.75;
}

.match-item.wide {
  grid-column: 1 / -1;
}

.match-item b {
  display: block;
  margin-bottom: 4px;
  color: #8e3e5f;
}

.match-item p {
  margin: 0;
  color: #504958;
}

.privacy-hidden {
  border: 1px dashed #dfc7d1;
  background: repeating-linear-gradient(-45deg, #fff9fb, #fff9fb 8px, #fcf1f5 8px, #fcf1f5 16px);
  color: var(--match-muted);
}

.match-list {
  margin: 10px 0 0;
  padding-left: 22px;
  color: #504958;
}

.match-list li + li {
  margin-top: 7px;
}

.match-quote {
  margin-top: 24px;
  padding: 26px;
  border-radius: 22px;
  background: linear-gradient(135deg, #9f496d, #c56b82);
  color: #fff;
  font-size: 20px;
  line-height: 1.8;
  text-align: center;
}

.match-footer {
  padding-top: 28px;
  color: var(--match-muted);
  text-align: center;
  font-size: 13px;
}

.match-dialog {
  width: min(940px, calc(100% - 28px));
  max-height: min(88vh, 900px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  color: var(--match-ink);
  box-shadow: 0 30px 90px rgba(42, 25, 35, .25);
}

.match-dialog.compact {
  width: min(560px, calc(100% - 28px));
}

.match-dialog::backdrop {
  background: rgba(42, 31, 39, .48);
  backdrop-filter: blur(5px);
}

.match-dialog form {
  padding: 26px;
}

.match-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.match-dialog h2,
.match-dialog h3 {
  margin: 0;
}

.match-dialog header p {
  margin: 6px 0 0;
  color: var(--match-muted);
  font-size: 13px;
}

.match-dialog .dialog-close {
  min-width: 36px;
  padding: 7px;
  font-size: 20px;
}

.match-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-height: 52vh;
  padding: 4px 8px 4px 2px;
  overflow: auto;
}

.match-edit-grid label,
.match-dialog.compact form > label {
  display: grid;
  gap: 7px;
}

.match-edit-grid label.wide {
  grid-column: 1 / -1;
}

.match-edit-grid label > span,
.match-dialog.compact label > span {
  color: #6a6070;
  font-size: 13px;
  font-weight: 700;
}

.match-edit-grid input,
.match-edit-grid textarea,
.match-dialog select,
.share-result input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #e2d8df;
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
  background: #fff;
  color: var(--match-ink);
  font: inherit;
  line-height: 1.55;
}

.match-edit-grid input:focus,
.match-edit-grid textarea:focus,
.match-dialog select:focus {
  border-color: #bd6482;
  box-shadow: 0 0 0 3px rgba(189, 100, 130, .12);
}

.privacy-settings {
  margin-top: 20px;
  padding: 18px;
  border-radius: 16px;
  background: var(--match-soft);
}

.privacy-settings > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin-top: 12px;
}

.privacy-settings .privacy-option {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.privacy-settings input {
  accent-color: #b65678;
}

.match-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.match-dialog footer .secondary {
  background: #fff;
  color: var(--match-ink);
}

.share-result {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: var(--match-soft);
}

.share-result small {
  display: block;
  margin-bottom: 9px;
  color: var(--match-muted);
}

.share-result > div {
  display: flex;
  gap: 8px;
}

.match-contact-note {
  margin: 22px 0 0;
  padding: 14px 18px;
  border: 1px dashed #dec7d2;
  border-radius: 16px;
  background: #fff8fa;
  color: var(--match-muted);
  text-align: center;
  font-size: 13px;
}

.match-contact {
  border-color: #d9c0cb;
  background: linear-gradient(135deg, #fff, #fff7fa);
}

.share-authorizations {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.share-authorizations label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--match-line);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.share-authorizations input {
  accent-color: #b65678;
}

.share-preview,
.managed-shares {
  margin-top: 18px;
  padding: 15px;
  border-radius: 16px;
  background: #faf7f9;
}

.share-preview h3,
.managed-shares h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.managed-shares > p {
  margin: -4px 0 12px;
  color: var(--match-muted);
  font-size: 12px;
}

.share-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.share-preview-grid span {
  padding: 9px 10px;
  border-radius: 10px;
  background: #fff;
  color: #5b5260;
  font-size: 12px;
}

.share-preview-grid b {
  display: block;
  margin-bottom: 3px;
  color: #8e3e5f;
}

.managed-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--match-line);
  border-radius: 12px;
  background: #fff;
}

.managed-share-row + .managed-share-row {
  margin-top: 8px;
}

.managed-share-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.managed-share-row small {
  color: var(--match-muted);
}

.managed-share-row .danger {
  flex: 0 0 auto;
  border-color: #d49aab;
  color: #a43e5d;
}

.match-toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 11px 18px;
  border-radius: 999px;
  background: #342a31;
  color: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .2);
}

.match-watermark {
  position: fixed;
  z-index: 18;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-content: space-around;
  gap: 70px 30px;
  overflow: hidden;
  pointer-events: none;
}

.match-watermark span {
  color: rgba(139, 63, 96, .085);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  transform: rotate(-24deg);
}

.match-link-error {
  display: grid;
  min-height: 100vh;
  place-items: center;
  text-align: center;
}

.match-link-error > div {
  padding: 42px;
  border: 1px solid var(--match-line);
  border-radius: 24px;
  background: #fff;
}

.match-link-error b {
  color: var(--match-rose);
  font-size: 38px;
}

.match-exporting .match-topbar,
.match-exporting .match-toast {
  display: none !important;
}

@media (max-width: 800px) {
  .match-topbar {
    position: relative;
    flex-wrap: wrap;
    height: auto;
    min-height: 60px;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .match-actions {
    order: 3;
    width: 100%;
    margin: 0;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .match-actions button {
    flex: 0 0 auto;
  }

  .match-main {
    padding-top: 20px;
  }

  .match-hero {
    grid-template-columns: 1fr;
  }

  .match-photo {
    width: min(100%, 380px);
    margin: 0 auto;
  }

  .match-facts,
  .match-grid {
    grid-template-columns: 1fr;
  }

  .match-item.wide {
    grid-column: auto;
  }

  .match-edit-grid {
    grid-template-columns: 1fr;
  }

  .match-edit-grid label.wide {
    grid-column: auto;
  }

  .share-preview-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  body.matchmaking-page {
    background: #fff;
  }

  .match-topbar,
  .match-toast,
  .match-dialog {
    display: none !important;
  }

  .match-main {
    width: 100%;
    padding: 0;
  }

  .match-hero,
  .match-section,
  .match-fact {
    break-inside: avoid;
    box-shadow: none;
  }

  .match-section {
    margin-top: 12px;
    padding: 20px;
  }
}
