.membership-page {
  min-height: 100vh;
  background: #f7f4f0;
}

.membership-page .site-header {
  height: 86px;
}

.membership-page .nav-shell {
  width: min(calc(100% - 48px), 1320px);
}

.membership-main {
  padding: 42px 24px 100px;
}

.membership-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 44px;
  width: min(1320px, 100%);
  margin: 0 auto;
}

.membership-sidebar {
  position: sticky;
  top: 108px;
  align-self: start;
  padding: 18px 10px;
  border: 1px solid rgba(121, 99, 85, 0.12);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.78);
  min-width: 0;
}

.membership-sidebar-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 19px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
}

.membership-sidebar-dot,
.membership-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 107, 93, 0.12);
}

.membership-side-nav {
  display: grid;
  gap: 3px;
  padding: 16px 0;
  min-width: 0;
}

.membership-side-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  transition: color 180ms ease, background-color 180ms ease;
}

.membership-side-nav a:hover,
.membership-side-nav a.is-active {
  background: rgba(232, 107, 93, 0.1);
  color: var(--accent-deep);
}

.membership-sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 4px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 12px;
}

.membership-status-dot {
  width: 7px;
  height: 7px;
  flex-basis: 7px;
  background: #66a878;
  box-shadow: 0 0 0 4px rgba(102, 168, 120, 0.12);
}

.membership-content {
  min-width: 0;
}

.membership-page-heading,
.membership-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.membership-page-heading {
  align-items: center;
  margin-bottom: 30px;
}

.membership-eyebrow {
  margin: 0 0 8px;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.membership-page-heading h1,
.membership-section-heading h2,
.benefits-panel h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.membership-page-heading h1 {
  font-size: clamp(2rem, 3vw, 2.6rem);
}

.membership-page-heading p:not(.membership-eyebrow),
.membership-section-heading > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.membership-demo-badge,
.status-badge,
.pricing-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(232, 107, 93, 0.1);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.membership-status-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 30px;
  margin-bottom: 54px;
  padding: 28px 30px;
  border: 1px solid rgba(232, 107, 93, 0.18);
  border-radius: 16px;
  background: linear-gradient(135deg, #fffaf7 0%, #fff1e9 100%);
  box-shadow: 0 18px 44px rgba(83, 61, 48, 0.08);
}

.status-card-label {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
}

.status-card-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.status-card-title-row h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  letter-spacing: -0.03em;
}

.status-card-detail {
  margin: 17px 0 3px;
  color: var(--accent-deep);
  font-size: 1.05rem;
  font-weight: 600;
}

.status-card-expiry {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.status-card-expiry strong {
  margin-left: 6px;
  color: var(--ink);
  font-weight: 600;
}

.status-card-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 30px;
  border-left: 1px solid rgba(232, 107, 93, 0.16);
}

.status-progress {
  height: 7px;
  margin-bottom: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(232, 107, 93, 0.15);
}

.status-progress span {
  display: block;
  width: 68%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.status-card-side p {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.button-small {
  align-self: flex-start;
  min-height: 42px;
  padding: 10px 16px;
  font-size: 14px;
}

.membership-section {
  margin-bottom: 50px;
}

.membership-section-heading {
  align-items: end;
  margin-bottom: 20px;
}

.membership-section-heading > p {
  margin: 0 0 3px;
  text-align: right;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.pricing-loading,
.pricing-error {
  grid-column: 1 / -1;
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.pricing-card {
  position: relative;
  display: flex;
  min-height: 320px;
  flex-direction: column;
  padding: 24px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 250, 0.88);
  box-shadow: 0 10px 30px rgba(83, 61, 48, 0.045);
  transition: border-color 180ms ease, box-shadow 220ms ease, transform 220ms var(--ease-out);
}

.pricing-card:hover {
  border-color: rgba(232, 107, 93, 0.35);
  box-shadow: 0 18px 42px rgba(83, 61, 48, 0.1);
  transform: translateY(-3px);
}

.pricing-card.is-recommended {
  border: 1.5px solid rgba(232, 107, 93, 0.62);
  box-shadow: 0 16px 36px rgba(232, 107, 93, 0.11);
}

.pricing-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--accent);
  color: #fff;
}

.pricing-card h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.pricing-card-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 28px 0 2px;
}

.pricing-price strong {
  color: var(--ink);
  font-size: 2.2rem;
  letter-spacing: -0.05em;
}

.pricing-price span,
.pricing-per-month {
  color: var(--muted);
  font-size: 12px;
}

.pricing-per-month {
  min-height: 18px;
  margin: 0 0 17px;
}

.pricing-benefits {
  display: grid;
  gap: 7px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.pricing-benefits li::before,
.benefits-list li::before {
  margin-right: 7px;
  color: var(--accent);
  content: "✓";
  font-weight: 700;
}

.pricing-card .button {
  width: 100%;
  margin-top: auto;
}

.benefits-panel,
.orders-panel {
  margin-bottom: 46px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 250, 0.68);
}

.benefits-panel {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.benefits-intro {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.benefits-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 24px;
  margin: 0;
  padding: 4px 0 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
}

.membership-note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.7;
}

.orders-panel {
  margin-bottom: 0;
}

.orders-count {
  color: var(--quiet);
  font-size: 13px;
}

.orders-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.orders-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  color: var(--muted);
  font-size: 13px;
}

.orders-table th,
.orders-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.orders-table th {
  background: rgba(244, 238, 230, 0.65);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.orders-table tr:last-child td {
  border-bottom: 0;
}

.order-status {
  color: #4e9664;
  font-weight: 600;
}

.orders-empty {
  padding: 34px 16px !important;
  color: var(--quiet);
  text-align: center !important;
}

.payment-modal[hidden] {
  display: none;
}

.payment-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.payment-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 41, 38, 0.34);
  backdrop-filter: blur(5px);
}

.payment-dialog {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow-y: auto;
  padding: 30px;
  border: 1px solid rgba(121, 99, 85, 0.16);
  border-radius: 18px;
  background: #fffdfa;
  box-shadow: 0 28px 80px rgba(43, 34, 28, 0.22);
}

.payment-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.payment-close:hover {
  background: var(--surface-deep);
  color: var(--ink);
}

.payment-step h2 {
  margin: 0 0 22px;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.payment-plan-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 11px;
  background: var(--surface-warm);
}

.payment-plan-summary strong {
  color: var(--ink);
}

.payment-plan-summary span {
  color: var(--muted);
  font-size: 13px;
}

.payment-plan-summary b {
  color: var(--ink);
}

.payment-amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 21px 0;
  color: var(--muted);
  font-size: 14px;
}

.payment-amount-row strong {
  color: var(--accent-deep);
  font-size: 1.5rem;
}

.payment-methods {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.payment-methods legend {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.payment-methods label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
}

.payment-methods label:has(input:checked) {
  border-color: rgba(232, 107, 93, 0.45);
  background: rgba(232, 107, 93, 0.06);
  color: var(--ink);
}

.payment-method-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.payment-method-wechat {
  background: #d9f4df;
  color: #238343;
}

.payment-method-alipay {
  background: #dff1ff;
  color: #1977b7;
}

.payment-confirm {
  width: 100%;
  min-height: 52px;
}

.payment-disclaimer,
.payment-expiry {
  margin: 14px 0 0;
  color: var(--quiet);
  font-size: 12px;
  text-align: center;
}

.payment-status-copy {
  margin: -8px 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.mock-qr {
  position: relative;
  display: grid;
  width: 168px;
  height: 168px;
  margin: 16px auto;
  place-items: center;
  border: 8px solid #fff;
  outline: 1px solid var(--line);
  background: repeating-conic-gradient(#2b2926 0 25%, #fff 0 50%) 0 0 / 18px 18px;
}

.mock-qr::before,
.mock-qr::after,
.mock-qr span,
.mock-qr i,
.mock-qr b {
  position: absolute;
  width: 38px;
  height: 38px;
  border: 7px solid #2b2926;
  background: #fff;
  content: "";
}

.mock-qr::before {
  top: 0;
  left: 0;
}

.mock-qr::after {
  top: 0;
  right: 0;
}

.mock-qr span {
  bottom: 0;
  left: 0;
}

.mock-qr i {
  width: 17px;
  height: 17px;
  border-width: 4px;
  background: #2b2926;
}

.mock-qr b {
  right: 14px;
  bottom: 14px;
  width: 15px;
  height: 15px;
  border: 0;
  background: #2b2926;
}

.payment-success-mark {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 4px 0 18px;
  place-items: center;
  border-radius: 50%;
  background: #e6f5e8;
  color: #4e9664;
  font-size: 30px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .membership-shell {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .membership-sidebar {
    position: static;
    padding: 10px;
  }

  .membership-sidebar-heading,
  .membership-sidebar-footer {
    display: none;
  }

  .membership-side-nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 0;
    scrollbar-width: none;
  }

  .membership-side-nav::-webkit-scrollbar {
    display: none;
  }

  .membership-side-nav a {
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
  }
}

@media (max-width: 700px) {
  .membership-page .site-header {
    height: 78px;
  }

  .membership-page .nav-shell {
    width: calc(100% - 24px);
  }

  .membership-main {
    padding: 28px 16px 72px;
  }

  .membership-page-heading,
  .membership-section-heading {
    display: block;
  }

  .membership-page-heading {
    margin-bottom: 24px;
  }

  .membership-demo-badge {
    margin-top: 14px;
  }

  .membership-status-card {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 42px;
    padding: 22px 20px;
  }

  .status-card-side {
    padding: 20px 0 0;
    border-top: 1px solid rgba(232, 107, 93, 0.16);
    border-left: 0;
  }

  .membership-section-heading > p {
    margin-top: 8px;
    text-align: left;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    min-height: 0;
  }

  .benefits-panel,
  .orders-panel {
    padding: 22px 18px;
  }

  .benefits-panel {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .benefits-list {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .payment-modal {
    align-items: end;
    padding: 12px;
  }

  .payment-dialog {
    max-height: calc(100vh - 24px);
    padding: 26px 20px 22px;
    border-radius: 18px 18px 12px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pricing-card {
    transition: none;
  }
}
