.membership-status {
  flex: 0 0 auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #c9dceb;
  border-radius: 999px;
  background: #f5f9fc;
  color: #315f7d;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.membership-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7892a6;
}

.membership-status[data-state="active"] {
  border-color: #b9ded4;
  background: #eef9f5;
  color: #17624f;
}

.membership-status[data-state="active"]::before { background: #15946f; }

.membership-status[data-state="locked"],
.membership-status[data-state="error"] {
  border-color: #efcf9e;
  background: #fff8ea;
  color: #8b5713;
}

.membership-status[data-state="locked"]::before,
.membership-status[data-state="error"]::before { background: #d78a1f; }

.membership-dialog {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 42, 61, .42);
  backdrop-filter: blur(5px);
}

.membership-dialog[hidden] { display: none; }

.membership-dialog__card {
  width: min(420px, 100%);
  border: 1px solid #d8e6f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 42, 67, .22);
  padding: 22px;
}

.membership-dialog__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff3da;
  color: #9a6117;
  font-size: 20px;
  font-weight: 900;
}

.membership-dialog h2 {
  margin: 16px 0 8px;
  color: #102a43;
  font-size: 21px;
  line-height: 1.3;
}

.membership-dialog p {
  margin: 0;
  color: #607586;
  font-size: 14px;
  line-height: 1.75;
}

.membership-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
  margin-top: 20px;
}

.membership-dialog__actions button,
.membership-dialog__actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.membership-dialog__actions button {
  border: 1px solid #d8e6f0;
  background: #fff;
  color: #43586c;
}

.membership-dialog__actions a {
  border: 1px solid #1d527a;
  background: #1d527a;
  color: #fff;
}

body[data-membership-state="locked"] .resource-card {
  position: relative;
}

body[data-membership-state="locked"] .resource-card::after {
  content: "会员";
  position: absolute;
  top: 9px;
  right: 44px;
  border-radius: 999px;
  background: rgba(255, 248, 234, .96);
  color: #8b5713;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 900;
}

@media (max-width: 700px) {
  .membership-status {
    width: 100%;
    min-height: 40px;
  }

  .membership-dialog__actions { grid-template-columns: 1fr; }
}
