:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --ink: #101217;
  --muted: #6f7580;
  --line: #e2e5ea;
  --blue: #1769e0;
  --blue-soft: #eaf2ff;
  --green: #168a4a;
  --amber: #b96b08;
  --red: #c83d4b;
  --shadow: 0 12px 34px rgba(20, 31, 51, .09);
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { min-width: 0; background: var(--bg); }
body { min-width: 0; min-height: 100vh; margin: 0; padding-bottom: calc(104px + env(safe-area-inset-bottom)); background: var(--bg); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.skip { position: fixed; top: -80px; left: 12px; z-index: 100; padding: 9px 13px; color: #fff; background: #101217; border-radius: 10px; font-size: 12px; }
.skip:focus { top: 12px; }

main { width: min(100%, 520px); margin: 0 auto; padding: 14px; }
.member-card { display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 18px rgba(20, 31, 51, .04); }
.member-avatar { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 11px; }
.member-avatar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.member-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.member-copy strong { overflow: hidden; font-size: 12px; line-height: 16px; white-space: nowrap; text-overflow: ellipsis; }
.member-copy span { overflow: hidden; color: var(--muted); font-size: 9px; line-height: 13px; white-space: nowrap; text-overflow: ellipsis; }
.member-tier { flex: 0 0 auto; padding: 5px 8px; color: var(--blue); background: var(--blue-soft); border-radius: 999px; font-size: 8px; font-weight: 800; }

.state-card { min-height: 58px; display: flex; align-items: center; gap: 11px; margin-top: 12px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.state-dot { width: 9px; height: 9px; flex: 0 0 auto; background: #9298a2; border-radius: 50%; box-shadow: 0 0 0 4px rgba(146, 152, 162, .12); }
.state-card strong { display: block; font-size: 11px; line-height: 15px; }
.state-card p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 14px; overflow-wrap: anywhere; }
.state-card[data-tone="active"] .state-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(22, 138, 74, .11); }
.state-card[data-tone="warning"] .state-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(185, 107, 8, .12); }

.section { margin-top: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 7px 24px rgba(20, 31, 51, .04); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-title > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
.section-title > div > span { width: 24px; height: 24px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 8px; font-size: 8px; font-weight: 800; }
.section-title h2 { margin: 0; font-size: 13px; line-height: 17px; }
.section-title small { color: var(--muted); font-size: 8px; white-space: nowrap; }

.membership-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.membership-tier { position: relative; min-width: 0; min-height: 108px; display: grid; align-content: start; gap: 4px; padding: 12px; color: var(--ink); text-align: left; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 15px; cursor: pointer; }
.membership-tier:hover { border-color: #b7c8e3; }
.membership-tier:disabled { cursor: not-allowed; opacity: .52; }
.membership-tier > .tier-badge { justify-self: start; max-width: 100%; overflow: hidden; padding: 3px 7px; color: #4e5968; background: #e9ecf1; border-radius: 999px; font-size: 7px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.membership-tier > strong { margin-top: 3px; overflow-wrap: anywhere; font-size: 11px; line-height: 15px; }
.membership-tier > .tier-price { display: flex; align-items: baseline; gap: 3px; font-size: 19px; font-weight: 850; letter-spacing: -.035em; }
.membership-tier > .tier-price small { color: var(--muted); font-size: 7px; font-weight: 500; letter-spacing: 0; }
.membership-tier > .tier-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--muted); font-size: 7px; line-height: 10px; }
.membership-tier > .tier-meta del { color: #9a7e7e; }
.membership-tier > .tier-saving { color: var(--red); font-size: 7px; font-weight: 700; }
.membership-tier.selected { background: #f5f9ff; border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.membership-tier.selected::after { content: "✓"; position: absolute; top: 9px; right: 9px; width: 17px; height: 17px; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 50%; font-size: 10px; font-weight: 900; }
.membership-tier.promotion { background: #fffaf3; border-color: #e8c693; }
.membership-tier.promotion.selected { background: #fff8ed; border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.membership-tier.promotion.selected::after { background: var(--amber); }
.skeleton { min-height: 108px; background: #edf0f4; border-radius: 15px; animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .48; } }

.benefit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.benefit { min-width: 0; min-height: 56px; display: flex; align-items: flex-start; gap: 8px; padding: 10px; background: var(--surface-soft); border: 1px solid #eceef2; border-radius: 13px; }
.benefit b { flex: 0 0 auto; color: var(--blue); font-size: 8px; line-height: 13px; }
.benefit span { overflow-wrap: anywhere; font-size: 9px; line-height: 14px; }

.upgrade-notice { margin-bottom: 11px; padding: 11px; background: #fff8ed; border: 1px solid #efd2a4; border-radius: 14px; }
.upgrade-notice strong { font-size: 10px; }
.upgrade-notice p { margin: 4px 0 9px; color: #805b29; font-size: 8px; line-height: 13px; }
.upgrade-notice label { display: flex; align-items: center; gap: 7px; color: #67471d; font-size: 9px; font-weight: 700; cursor: pointer; }
.upgrade-notice input, .terms-row input { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; accent-color: var(--blue); }
.payment-channels { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; }
.payment-channels legend { width: 100%; margin-bottom: 7px; color: var(--muted); font-size: 8px; }
.payment-channels label { min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.payment-channels label:has(input:checked) { background: #f7faff; border-color: #9abcec; }
.payment-channels input { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; accent-color: var(--blue); }
.payment-channels b { min-width: 0; font-size: 10px; }
.payment-channels i { margin-left: auto; color: var(--muted); font-size: 8px; font-style: normal; }
.pay-icon { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; border-radius: 8px; font-size: 10px; font-weight: 800; }
.pay-icon.alipay { background: #1677ff; }
.pay-icon.wechat { background: #07c160; }
.terms-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; color: var(--muted); font-size: 8px; line-height: 14px; cursor: pointer; }
.terms-row button { padding: 0; color: var(--blue); background: transparent; border: 0; font-size: inherit; cursor: pointer; }
.secure-note { margin: 8px 0 0; color: var(--muted); font-size: 8px; line-height: 13px; }
.actions { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 15px 0 2px; color: #a2a7af; }
.actions button { padding: 3px; color: var(--muted); background: transparent; border: 0; font-size: 8px; cursor: pointer; }

.checkout-bar { position: fixed; z-index: 20; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); width: min(calc(100% - 24px), 496px); min-height: 78px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(145px, 1.1fr); align-items: center; gap: 9px; padding: 10px 11px; background: rgba(255, 255, 255, .97); border: 1px solid #dce1e8; border-radius: 19px; box-shadow: var(--shadow); transform: translateX(-50%); backdrop-filter: blur(14px); }
.checkout-summary { min-width: 0; }
.summary-name { min-width: 0; display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.summary-name strong { min-width: 0; overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.promo-mini { flex: 0 0 auto; padding: 2px 5px; color: #925600; background: #fff0d6; border-radius: 6px; font-size: 7px; font-weight: 700; }
.summary-price { min-width: 0; display: flex; align-items: baseline; gap: 3px; color: var(--ink); }
.summary-price em { font-size: 10px; font-style: normal; }
.summary-price strong { font-size: 22px; letter-spacing: -.04em; }
.summary-price del { margin-left: 3px; overflow: hidden; color: #9c8484; font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.summary-saving { margin-top: 2px; overflow: hidden; color: var(--red); font-size: 7px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.checkout-action { min-width: 0; }
.primary { width: 100%; min-height: 43px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 9px; color: #fff; background: var(--blue); border: 0; border-radius: 13px; font-size: 11px; font-weight: 800; cursor: pointer; }
.primary:disabled { color: #8d939c; background: #e5e8ed; cursor: not-allowed; }
.primary.loading i { width: 12px; height: 12px; display: block; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.checkout-safe { margin-top: 4px; overflow: hidden; color: var(--muted); text-align: center; font-size: 7px; white-space: nowrap; text-overflow: ellipsis; }
.checkout-safe span { color: var(--green); font-weight: 900; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 14, 21, .54); backdrop-filter: blur(4px); }
.modal-card { position: relative; width: 100%; max-width: 360px; max-height: calc(100% - 32px); overflow: auto; padding: 21px; background: var(--surface); border: 1px solid #dce2eb; border-radius: 25px; box-shadow: 0 24px 70px rgba(10, 14, 21, .25); text-align: center; animation: modalIn .22s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-card:focus { outline: none; }
.promotion-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 9px; color: #fff; background: #121722; border: 5px solid #e8f1ff; border-radius: 17px; font-size: 11px; font-weight: 900; letter-spacing: .05em; }
.promotion-mark.ticket { color: var(--blue); background: var(--blue-soft); border-color: #f4f8ff; font-size: 22px; }
.modal-kicker { display: inline-flex; align-items: center; min-height: 23px; padding: 0 9px; color: var(--blue); background: var(--blue-soft); border-radius: 999px; font-size: 8px; font-weight: 800; }
.modal-card h2 { margin: 10px 0 6px; font-size: 21px; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; }
.modal-card p { max-width: 290px; margin: 0 auto; color: var(--muted); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.promotion-price { margin: 15px 0 11px; padding: 12px; color: var(--muted); background: #f6f9fe; border: 1px solid #d8e4f5; border-radius: 16px; }
.promotion-price span { font-size: 9px; }
.promotion-price strong { margin: 0 5px; color: var(--blue); font-size: 27px; letter-spacing: -.04em; }
.promotion-price del { color: #987c7c; font-size: 9px; }
.promotion-countdown { margin: 0 0 12px; color: var(--muted); font-size: 9px; }
.promotion-countdown b { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.promotion-button, .promotion-later { width: 100%; min-height: 43px; border-radius: 13px; cursor: pointer; font-weight: 800; }
.promotion-button { color: #fff; background: var(--blue); border: 0; font-size: 12px; }
.promotion-later { margin-top: 7px; color: var(--muted); background: transparent; border: 0; font-size: 9px; }
.modal-close { position: absolute; top: 13px; right: 13px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; color: #727985; background: #f0f2f5; border: 0; border-radius: 50%; font-size: 19px; cursor: pointer; }

button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(23, 105, 224, .3); outline-offset: 2px; }
.agreement-page { padding-top: max(20px, env(safe-area-inset-top)); }
.agreement-page .plan { display: block; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.agreement-page .plan h1 { margin: 0; font-size: 22px; }
.agreement-page .plan h2 { margin: 24px 0 8px; font-size: 16px; }
.agreement-page .plan p { margin: 0 0 12px; color: var(--muted); line-height: 1.72; }
.agreement-page .plan .agreement-meta { margin: 8px 0 18px; font-size: 9px; }
.agreement-page .plan ul { margin: 0 0 14px; padding-left: 20px; color: var(--muted); }
.agreement-page .plan li { margin: 0 0 8px; line-height: 1.72; }
.agreement-page .plan strong { color: var(--ink); }

@media (max-width: 370px) {
  main { padding: 11px; }
  .member-card { padding: 10px; }
  .section { padding: 12px; }
  .membership-tier { min-height: 105px; padding: 10px; }
  .benefit { padding: 8px; }
  .checkout-bar { width: calc(100% - 16px); grid-template-columns: minmax(0, 1fr) minmax(137px, 1.05fr); padding: 9px; }
}

@media (min-width: 620px) {
  main { padding-top: 18px; }
  .membership-grid { grid-template-columns: repeat(4, 1fr); }
  .benefit-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
