.mem-wrap, .mem-form {
  --mem-ink: #272724;
  --mem-muted: #6d6a63;
  --mem-red: #902c27;
  --mem-line: #dfdcd4;
  --mem-serif: "Songti SC", "Noto Serif CJK SC", "STSong", SimSun, Georgia, serif;
  color: var(--mem-ink);
}
.mem-wrap { max-width: 1320px; margin: auto; padding: 54px clamp(20px, 4.5vw, 72px) 88px; }
.mem-wrap *, .mem-form * { box-sizing: border-box; }
.mem-wrap button, .mem-form button, .mem-wrap input, .mem-form input { font: inherit; }
.mem-wrap h1, .mem-wrap h2, .mem-wrap p, .mem-form p { margin: 0; }
.mem-wrap button, .mem-form button { cursor: pointer; }
.mem-wrap button:focus-visible, .mem-form button:focus-visible, .mem-form input:focus-visible, .mem-wrap input:focus-visible {
  outline: 2px solid #a64032; outline-offset: 3px;
}
.mem-wrap button:disabled, .mem-form button:disabled { cursor: default; opacity: .45; }
.mem-page-heading, .mem-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.mem-page-heading { min-height: 86px; margin-bottom: 30px; }
.mem-page-heading h1 { font: 650 clamp(33px, 4.2vw, 54px)/1.16 var(--mem-serif); letter-spacing: .04em; }
.mem-page-heading p { margin-top: 12px; color: var(--mem-muted); font-size: 15px; line-height: 1.6; }
.mem-tabs { display: flex; gap: 32px; border-bottom: 1px solid var(--mem-line); margin-bottom: 28px; }
.mem-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 10px 0 14px; color: var(--mem-muted); white-space: nowrap; }
.mem-tabs button[aria-pressed=true] { border-color: var(--mem-red); color: var(--mem-red); font-weight: 650; }
.mem-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none; min-height: 40px; padding: 9px 19px; border: 1px solid transparent; border-radius: 5px; font-size: 14px !important; font-weight: 600 !important; line-height: 1.45; }
.mem-btn-primary { background: var(--mem-red); color: #fff; }
.mem-btn-primary:hover:enabled { background: #75221d; }
.mem-btn-light { background: #fffaf2; color: #61231f; }
.mem-btn-outline { color: var(--mem-red); border-color: #c9a69b; background: transparent; }
.mem-btn-outline:hover:enabled { background: #f4e9e3; }
.mem-btn-ghost { color: #fffaf2; background: transparent; border-color: #d5aca0; }
.mem-full { width: 100%; }
.mem-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 9px; }
.mem-section { margin-top: 34px; }
.mem-section-heading { margin-bottom: 16px; }
.mem-section h2, .mem-input-card h2 { font: 650 clamp(22px, 2.5vw, 30px)/1.3 var(--mem-serif); }
.mem-subtle, .mem-note, .mem-empty { font-size: 14px; line-height: 1.65; color: var(--mem-muted); }
.mem-empty { padding: 28px 20px; background: #fffdf9; border: 1px dashed var(--mem-line); border-radius: 6px; text-align: center; }
.mem-wallet { display: grid; grid-template-columns: minmax(250px,.92fr) minmax(400px,1.4fr); gap: 16px; }
.mem-wallet-hero, .mem-invite-card { position: relative; overflow: hidden; color: #fff9ef; background: radial-gradient(ellipse at top right, #a1493e, transparent 62%), #712b26; border-radius: 8px; }
.mem-wallet-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: clamp(20px, 2.4vw, 34px); }
.mem-hero-label, .mem-point-balance span { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mem-balance { display: flex; align-items: baseline; gap: 6px; font: 500 clamp(34px, 3.2vw, 48px)/1.3 Georgia, "Times New Roman", serif; padding: 14px 0 7px; }
.mem-balance small, .mem-metric strong small { font-size: .53em; }
.mem-wallet-hero p, .mem-invite-card p { color: #f1dcd2; font-size: 13px; line-height: 1.65; }
.mem-metrics, .mem-queue-overview, .mem-input-card, .mem-point-balance { border: 1px solid var(--mem-line); background: #fffdf8; border-radius: 8px; }
.mem-metrics { display: grid; align-items: stretch; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 24px 12px; }
.mem-metric { padding: 8px clamp(10px, 1.6vw, 24px); min-width: 0; }
.mem-metric + .mem-metric { border-left: 1px solid var(--mem-line); }
.mem-metric > span, .mem-metric > small, .mem-order-top, .mem-order-title span, .mem-order-total small, .mem-progress div, .mem-progress small { font-size: 14px; color: var(--mem-muted); }
.mem-metric strong { display: block; font: 500 clamp(23px, 2.4vw, 35px)/1.4 Georgia, serif; margin: 6px 0 2px; overflow-wrap: anywhere; }
.mem-link { border: 0; background: transparent; color: var(--mem-red); text-decoration: underline; text-underline-offset: 3px; font-size: 14px !important; padding: 0; }
.mem-table-scroll { overflow-x: auto; background: #fffdf8; border: 1px solid var(--mem-line); border-radius: 6px; }
.mem-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; white-space: nowrap; }
.mem-table th, .mem-table td { padding: 14px 18px; border-bottom: 1px solid var(--mem-line); }
.mem-table th { color: var(--mem-muted); font-weight: 500; background: #f2efe9; }
.mem-table tbody tr:last-child td { border-bottom: 0; }
.mem-queue-overview { display: flex; align-items: center; justify-content: space-between; gap: clamp(16px,4vw,60px); padding: 24px clamp(20px,3vw,40px); }
.mem-queue-number { display: flex; align-items: baseline; gap: 6px; color: var(--mem-red); font: 550 42px/1.25 Georgia, serif; margin-top: 5px; }
.mem-queue-number small { font: 500 14px/1.5 sans-serif; }
.mem-progress { flex: 1; max-width: 700px; }
.mem-progress div { display: flex; justify-content: space-between; }
.mem-progress progress { display: block; width: 100%; height: 6px; background: #eee7dd; border: 0; border-radius: 9px; overflow: hidden; margin: 10px 0 6px; appearance: none; }
.mem-progress progress::-webkit-progress-bar { background: #eee7dd; }
.mem-progress progress::-webkit-progress-value { background: #953a2e; border-radius: 9px; }
.mem-progress progress::-moz-progress-bar { background: #953a2e; border-radius: 9px; }
.mem-note { margin-top: 14px !important; }
.mem-rank { font: 550 20px/1 Georgia, serif; }
.mem-rank.self, .mem-order-top b { color: var(--mem-red); }
.mem-order { border: 1px solid var(--mem-line); border-radius: 6px; background: #fffdf8; margin-bottom: 14px; }
.mem-order-top, .mem-order-content { display: flex; align-items: center; gap: 18px; padding: 12px 18px; }
.mem-order-top { border-bottom: 1px solid var(--mem-line); flex-wrap: wrap; }
.mem-order-top b { margin-left: auto; font-weight: 550; }
.mem-order-photo { width: 64px; height: 70px; object-fit: cover; border-radius: 4px; }
.mem-order-title { display: grid; gap: 8px; }
.mem-order-total { margin-left: auto; display: grid; text-align: right; gap: 6px; }
.mem-order-total strong { font: 550 22px/1.2 Georgia, serif; }
.mem-invite-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.mem-invite-card, .mem-input-card { padding: clamp(22px, 3vw, 40px); }
.mem-code { font: 500 clamp(36px, 4vw, 56px)/1.25 Georgia, serif; letter-spacing: .05em; margin: 18px 0 10px; overflow-wrap: anywhere; }
.mem-invite-card .mem-actions { margin-top: 20px; justify-content: flex-start; }
.mem-input-card p, .mem-form p { color: var(--mem-muted); font-size: 15px; line-height: 1.7; }
.mem-input-card p { margin: 12px 0 18px; }
.mem-input-card form { display: grid; align-items: center; grid-template-columns: minmax(120px,1fr) auto; gap: 8px; }
.mem-input-card form label, .mem-input-card form small { grid-column: 1/-1; font-size: 13px; color: var(--mem-muted); }
.mem-input-card form input, .mem-form input { border: 1px solid #c8c1b6; border-radius: 4px; background: white; color: var(--mem-ink); padding: 10px 12px; width: 100%; min-height: 42px; }
.mem-point-balance { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 3px 16px; min-width: 185px; padding: 14px 20px; }
.mem-point-balance span { color: var(--mem-muted); grid-column: 1/-1; }
.mem-point-balance strong { font: 550 31px/1.3 Georgia, serif; color: var(--mem-red); }
.mem-filters { display: flex; gap: 8px; border-top: 1px solid var(--mem-line); padding-top: 23px; margin-bottom: 22px; }
.mem-filters button { background: transparent; color: var(--mem-muted); border: 1px solid var(--mem-line); border-radius: 20px; padding: 6px 18px; font-size: 14px; }
.mem-filters button[aria-pressed=true] { background: var(--mem-ink); color: white; border-color: var(--mem-ink); }
.mem-product-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(210px,100%),1fr)); gap: clamp(12px,1.6vw,24px); }
.mem-product { background: #fffdf8; border: 1px solid var(--mem-line); border-radius: 7px; overflow: hidden; min-width: 0; }
.mem-product-photo { position: relative; overflow: hidden; aspect-ratio: 1.42; background: #ede7db; }
.mem-product-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mem-product-photo span { position: absolute; top: 12px; left: 12px; padding: 4px 9px; border-radius: 3px; color: #fff; background: #573b32; font-size: 12px; }
.mem-product-detail { padding: 16px 18px; }
.mem-product-detail h2 { font: 600 21px/1.4 var(--mem-serif); }
.mem-product-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; }
.mem-product-bottom p { color: var(--mem-red); font-size: 14px; line-height: 1.4; }
.mem-product-bottom p b { font: 600 24px/1.2 Georgia, serif; }
.mem-product-bottom p small { display: inline-block; color: var(--mem-muted); font-size: 14px; }
.mem-product-bottom button { min-height: 35px; padding: 6px 13px; }
.mem-form { display: grid; gap: 15px; }
.mem-form label { margin-bottom: -8px; font-size: 14px; }
.mem-form .mem-form-note { font-size: 13px; }
.mem-breakdown { padding: 14px 16px; background: #f5f1e9; border-radius: 5px; display: grid; gap: 10px; }
.mem-breakdown > div { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; font-size: 14px; }
.mem-breakdown span { color: var(--mem-muted); }
.mem-breakdown strong { color: var(--mem-red); }
.mem-redeem-product { display: flex; align-items: center; gap: 14px; }
.mem-redeem-product img { width: 64px; height: 74px; object-fit: cover; border-radius: 4px; }
.mem-redeem-product strong { font: 600 20px/1.45 var(--mem-serif); }
@media (max-width: 850px) {
  .mem-wallet { grid-template-columns: 1fr; }
  .mem-wallet-hero { align-items: center; }
  .mem-metrics { padding: 12px; }
  .mem-invite-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .mem-wrap { padding: 28px 16px 54px; }
  .mem-page-heading { margin-bottom: 20px; gap: 10px; flex-wrap: wrap; }
  .mem-tabs { gap: 0; justify-content: space-between; margin-bottom: 18px; }
  .mem-tabs button { font-size: 14px; }
  .mem-wallet-hero { padding: 18px; }
  .mem-metrics { padding: 10px 2px; }
  .mem-metric { padding: 2px 8px; }
  .mem-metric > span { font-size: 13px; }
  .mem-metric strong { font-size: 22px; }
  .mem-queue-overview { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .mem-queue-overview .mem-progress { flex: 1; min-width: 170px; }
  .mem-order-top { gap: 3px 12px; font-size: 12px; }
  .mem-order-top span:nth-child(2) { order: 3; width: 100%; }
  .mem-order-top, .mem-order-content { padding: 10px; }
  .mem-order-content { gap: 10px; }
  .mem-order-photo { width: 42px; height: 54px; }
  .mem-order-title strong { font-size: 15px; }
  .mem-order-title span { font-size: 12px; }
  .mem-point-balance { display: flex; width: 100%; min-width: 0; gap: 8px; align-items: center; padding: 9px 12px; }
  .mem-point-balance .mem-link { margin-left: auto; }
  .mem-point-balance strong { font-size: 24px; }
  .mem-product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .mem-product-detail { padding: 10px; }
  .mem-product-detail h2 { font-size: 17px; }
  .mem-product-photo { aspect-ratio: 1; }
  .mem-product-photo span { top: 7px; left: 7px; }
  .mem-product-bottom { flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .mem-product-bottom p b { font-size: 20px; }
  .mem-product-bottom button { padding: 4px 8px; }
}
