/* Membership cards (built by membership.js). Loaded after ui-v2.css; every rule
   sits under html.ui-v2 like the rest of the v2 design. Gold marks membership,
   so it reads apart from the lime used for actions and the invite card. */
html.ui-v2 {
  --v2-gold: #ffd27a;
  --v2-gold-ink: #241a05;
  --v2-gold-soft: rgba(255, 210, 122, .12);
  --v2-gold-line: rgba(255, 210, 122, .34);
}

/* ----- entry: banner in the top-up panel, card on the account page ----- */
html.ui-v2 .v2-member-entry { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border: 1px solid var(--v2-gold-line); border-radius: 16px; background: linear-gradient(135deg, rgba(255, 210, 122, .16), rgba(255, 210, 122, .03) 62%); color: var(--v2-text); font: inherit; text-align: left; cursor: pointer; transition: transform .16s ease, border-color .16s ease; }
html.ui-v2 .v2-member-entry[hidden] { display: none; }
html.ui-v2 .v2-member-entry:hover { border-color: var(--v2-gold); }
html.ui-v2 .v2-member-entry:active { transform: scale(.98); }
html.ui-v2 .v2-member-entry:focus-visible { outline: 2px solid var(--v2-gold); outline-offset: 2px; }
html.ui-v2 .v2-member-entry-icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--v2-gold-soft); color: var(--v2-gold); }
html.ui-v2 .v2-member-entry-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.ui-v2 .v2-member-entry-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
html.ui-v2 .v2-member-entry-title { font-size: 15px; font-weight: 600; }
html.ui-v2 .v2-member-entry-sub { font-size: 12px; line-height: 1.45; color: var(--v2-muted); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
html.ui-v2 .v2-member-entry-cta { flex: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: 999px; background: var(--v2-gold); color: var(--v2-gold-ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
html.ui-v2 .v2-member-entry.is-member .v2-member-entry-title { color: var(--v2-gold); }
html.ui-v2 .v2-member-entry.is-member .v2-member-entry-cta { background: transparent; border: 1px solid var(--v2-gold-line); color: var(--v2-gold); }
html.ui-v2 .v2-member-banner { margin: 0 0 4px; }
/* A member's price on a top-up tier: the old price struck through under it
   (on its own line: "¥158.4 ¥198" does not fit side by side on a phone). */
html.ui-v2 .pay-tiers .pay-tier-was { display: block; margin-top: 2px; color: var(--v2-muted); font-size: 12px; font-weight: 400; line-height: 1.2; text-align: center; }

/* ----- the sheet ----- */
html.ui-v2 #v2MemberSheet .v2-sheet-body { display: flex; flex-direction: column; gap: 14px; }
/* The body scrolls; nothing in it may be squeezed to fit instead. */
html.ui-v2 #v2MemberSheet .v2-sheet-body > * { flex: none; }
html.ui-v2 .v2-member-intro { margin: 0; font-size: 14px; line-height: 1.6; color: var(--v2-muted); }
html.ui-v2 .v2-member-empty { margin: 32px 0; text-align: center; font-size: 14px; color: var(--v2-muted); }

html.ui-v2 .v2-member-status { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--v2-gold-line); border-radius: 14px; background: var(--v2-gold-soft); }
html.ui-v2 .v2-member-status > b { font-size: 16px; font-weight: 600; color: var(--v2-gold); }
html.ui-v2 .v2-member-status > b small { font-size: 13px; font-weight: 400; color: var(--v2-text); }
html.ui-v2 .v2-member-status ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
html.ui-v2 .v2-member-status li { min-height: 26px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 8px; background: rgba(0, 0, 0, .24); font-size: 12px; color: var(--v2-text); }
html.ui-v2 .v2-member-status li.is-done { color: var(--v2-accent); }

/* Tabs follow the swipe on phones; on wide screens all three cards show at once. */
html.ui-v2 .v2-member-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--v2-bg); }
html.ui-v2 .v2-member-tabs button { min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--v2-muted); font: inherit; font-size: 14px; cursor: pointer; }
html.ui-v2 .v2-member-tabs button[aria-selected="true"] { background: var(--v2-raised); color: var(--v2-text); font-weight: 600; }

html.ui-v2 .v2-member-tiers { display: flex; gap: 12px; margin: 0 -20px; padding: 4px 20px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
html.ui-v2 .v2-member-tiers::-webkit-scrollbar { display: none; }
html.ui-v2 .v2-member-tier { flex: 0 0 84%; scroll-snap-align: center; display: flex; flex-direction: column; gap: 14px; padding: 18px 16px 16px; border: 1px solid var(--v2-line); border-radius: 18px; background: var(--v2-bg); }
html.ui-v2 .v2-member-tier.is-pro { border-color: var(--v2-gold-line); background: linear-gradient(180deg, rgba(255, 210, 122, .08), var(--v2-bg) 46%); }
html.ui-v2 .v2-member-tier.is-pro_plus { border-color: rgba(216, 255, 79, .3); background: linear-gradient(180deg, rgba(216, 255, 79, .07), var(--v2-bg) 46%); }
html.ui-v2 .v2-member-tier.is-current { box-shadow: 0 0 0 1px var(--v2-gold); border-color: var(--v2-gold); }
html.ui-v2 .v2-member-tier-head { display: flex; flex-direction: column; gap: 6px; }
html.ui-v2 .v2-member-tier-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; letter-spacing: .01em; }
html.ui-v2 .v2-member-tag { display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px; border-radius: 6px; background: var(--v2-gold-soft); color: var(--v2-gold); font-size: 11px; font-weight: 600; }
html.ui-v2 .v2-member-tag.is-hot { background: var(--v2-gold); color: var(--v2-gold-ink); }
html.ui-v2 .v2-member-price { margin: 0; display: flex; align-items: baseline; gap: 2px; color: var(--v2-text); }
html.ui-v2 .v2-member-price span { font-size: 16px; font-weight: 600; }
html.ui-v2 .v2-member-price b { font: 700 36px/1 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
html.ui-v2 .v2-member-price small { margin-left: 4px; font-size: 13px; color: var(--v2-muted); }
html.ui-v2 .v2-member-worth { margin: 0; font-size: 13px; color: var(--v2-muted); }
html.ui-v2 .v2-member-worth em { font-style: normal; font-weight: 600; color: var(--v2-gold); }
html.ui-v2 .v2-member-perks { flex: 1 1 auto; margin: 0; padding: 12px 0 0; list-style: none; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--v2-line); }
html.ui-v2 .v2-member-perks li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--v2-muted); }
html.ui-v2 .v2-member-perks li b { color: var(--v2-text); font-weight: 600; }
html.ui-v2 .v2-member-perks i { flex: none; width: 18px; height: 21px; display: grid; place-items: center; color: var(--v2-accent); }
html.ui-v2 .v2-member-perks svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
html.ui-v2 .v2-member-tier > button { width: 100%; }
html.ui-v2 .v2-member-tier > button:disabled { opacity: .5; cursor: not-allowed; }
html.ui-v2 .v2-member-tier.is-pro > .v2-primary-button { background: var(--v2-gold); color: var(--v2-gold-ink); }

html.ui-v2 .v2-member-channels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
html.ui-v2 .v2-member-channels .pay-channel { min-height: 44px; border: 1px solid var(--v2-line); border-radius: 12px; background: transparent; color: var(--v2-muted); font: inherit; font-size: 14px; cursor: pointer; }
html.ui-v2 .v2-member-channels .pay-channel[aria-checked="true"] { border-color: var(--v2-accent); color: var(--v2-text); font-weight: 600; }
html.ui-v2 .v2-member-notice { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 109, 122, .1); color: var(--v2-danger-text); font-size: 13px; line-height: 1.5; }

html.ui-v2 .v2-member-rules { border: 1px solid var(--v2-line); border-radius: 12px; padding: 0 12px; }
html.ui-v2 .v2-member-rules summary { min-height: 44px; display: flex; align-items: center; font-size: 13px; color: var(--v2-muted); cursor: pointer; }
html.ui-v2 .v2-member-rules ul { margin: 0 0 12px; padding-left: 18px; font-size: 13px; line-height: 1.7; color: var(--v2-muted); }
html.ui-v2 .v2-member-rules a { color: var(--v2-accent); }

@media (min-width: 860px) {
  html.ui-v2 #v2MemberSheet { width: min(960px, calc(100vw - 32px)); }
  html.ui-v2 .v2-member-tabs { display: none; }
  html.ui-v2 .v2-member-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 4px 0; overflow: visible; }
  html.ui-v2 .v2-member-tier { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  html.ui-v2 .v2-member-entry { transition: none; }
}
