/* R38 摊主会员/积分卡 · 13色板 · 10模块 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); transition: background .35s, color .35s; }
body.showcase-back-active { padding-top: calc(44px + env(safe-area-inset-top, 0)); }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }

body[data-theme='warmorange'] { --primary:#FF6B35; --primary-light:#FFF3E0; --accent:#E65100; --bg:#FFF8F3; --bg-card:#FFF; --text:#3E2723; --text-light:#8D6E63; --border:#FFCCBC; }
body[data-theme='coffee'] { --primary:#8D6E63; --primary-light:#EFEBE9; --accent:#4E342E; --bg:#FAF8F6; --bg-card:#FFF; --text:#3E2723; --text-light:#795548; --border:#D7CCC8; }
body[data-theme='mint'] { --primary:#26A69A; --primary-light:#E0F2F1; --accent:#00695C; --bg:#F0FAF9; --bg-card:#FFF; --text:#004D40; --text-light:#00796B; --border:#B2DFDB; }
body[data-theme='sakura'] { --primary:#EC407A; --primary-light:#FCE4EC; --accent:#AD1457; --bg:#FFF5F8; --bg-card:#FFF; --text:#880E4F; --text-light:#C2185B; --border:#F8BBD0; }
body[data-theme='darkgold'] { --primary:#FFD700; --primary-light:#212121; --accent:#FFA000; --bg:#121212; --bg-card:#1E1E1E; --text:#FAFAFA; --text-light:#BDBDBD; --border:#424242; }
body[data-theme='vibrant'] { --primary:#FF9800; --primary-light:#FFF8E1; --accent:#E65100; --bg:#FFFBF0; --bg-card:#FFF; --text:#E65100; --text-light:#F57C00; --border:#FFE0B2; }
body[data-theme='klein'] { --primary:#1565C0; --primary-light:#E3F2FD; --accent:#0D47A1; --bg:#F5F9FF; --bg-card:#FFF; --text:#0D47A1; --text-light:#1976D2; --border:#BBDEFB; }
body[data-theme='forest'] { --primary:#43A047; --primary-light:#E8F5E9; --accent:#1B5E20; --bg:#F1F8F2; --bg-card:#FFF; --text:#1B5E20; --text-light:#388E3C; --border:#C8E6C9; }
body[data-theme='purple'] { --primary:#7B1FA2; --primary-light:#F3E5F5; --accent:#4A148C; --bg:#FAF5FC; --bg-card:#FFF; --text:#4A148C; --text-light:#7B1FA2; --border:#E1BEE7; }
body[data-theme='minimal'] { --primary:#212121; --primary-light:#FAFAFA; --accent:#424242; --bg:#FAFAFA; --bg-card:#FFF; --text:#212121; --text-light:#757575; --border:#E0E0E0; }
body[data-theme='coralwarm'] { --primary:#FF7043; --primary-light:#FBE9E7; --accent:#BF360C; --bg:#FFF5F2; --bg-card:#FFF; --text:#BF360C; --text-light:#E64A19; --border:#FFCCBC; }
body[data-theme='bluegray'] { --primary:#546E7A; --primary-light:#ECEFF1; --accent:#263238; --bg:#F5F7F8; --bg-card:#FFF; --text:#263238; --text-light:#546E7A; --border:#CFD8DC; }
body[data-theme='vintage'] { --primary:#A1887F; --primary-light:#F5F0EB; --accent:#5D4037; --bg:#FAF7F4; --bg-card:#FFFDF7; --text:#4E342E; --text-light:#795548; --border:#D7CCC8; }

.glass-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 0 4px 20px rgba(0,0,0,.05); }
.section { max-width: 480px; margin: 0 auto; padding: 1.5rem 1rem; scroll-margin-top: 1rem; }
.section__title { font-size: 1.1rem; font-weight: 800; margin-bottom: .75rem; color: var(--primary); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .6rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .85rem; border: none; cursor: pointer; background: var(--primary); color: #fff; }
.btn-sm { padding: .4rem .75rem; font-size: .75rem; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }

.app-header { background: linear-gradient(160deg, var(--primary), var(--accent)); color: #fff; padding: 1.25rem 1rem 1.5rem; border-radius: 0 0 1.5rem 1.5rem; }
.app-header__vendor { font-size: .78rem; opacity: .9; }
.app-header__name { font-size: 1rem; font-weight: 700; }

.dash { text-align: center; padding: .5rem 0 1rem; }
.dash__ring-wrap { position: relative; width: 140px; height: 140px; margin: 0 auto .75rem; }
.dash__ring { transform: rotate(-90deg); }
.dash__ring-bg { fill: none; stroke: rgba(255,255,255,.25); stroke-width: 8; }
.dash__ring-fill { fill: none; stroke: #fff; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1.2s ease; }
.dash__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dash__points { font-size: 2rem; font-weight: 900; line-height: 1; }
.dash__unit { font-size: .72rem; opacity: .9; }
.dash__next { font-size: .72rem; opacity: .85; margin-top: .25rem; }
.dash__tier { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; background: rgba(255,255,255,.2); border-radius: 999px; font-size: .78rem; font-weight: 700; margin-bottom: .75rem; }
.dash__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.dash__stat { padding: .65rem .35rem; background: rgba(255,255,255,.15); border-radius: .65rem; text-align: center; }
.dash__stat-val { font-size: 1rem; font-weight: 800; }
.dash__stat-lbl { font-size: .62rem; opacity: .85; }
.dash__quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.dash__quick-item { padding: .65rem .25rem; background: var(--bg-card); color: var(--text); border-radius: .75rem; text-align: center; font-size: .68rem; font-weight: 600; cursor: pointer; border: none; }
.dash__quick-item span { display: block; font-size: 1.25rem; margin-bottom: .2rem; }

.punch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; max-width: 280px; margin: 0 auto 1rem; }
.punch-slot { aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.75rem; border: 2px dashed var(--border); background: var(--bg); transition: transform .3s, background .3s; }
.punch-slot.filled { border-style: solid; border-color: var(--primary); background: var(--primary-light); transform: scale(1.05); animation: punchPop .4s ease; }
.punch-slot.reward-center { grid-column: 2; grid-row: 2; font-size: .65rem; font-weight: 800; color: var(--primary); border-radius: .75rem; aspect-ratio: auto; padding: .5rem; }
@keyframes punchPop { 0% { transform: scale(.8); } 60% { transform: scale(1.1); } 100% { transform: scale(1.05); } }
.punch-reward { text-align: center; padding: 1rem; background: var(--primary-light); border-radius: 1rem; font-weight: 800; color: var(--primary); display: none; }
.punch-reward.show { display: block; animation: fadeUp .5s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.reward-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; }
.reward-card { overflow: hidden; cursor: pointer; }
.reward-card img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.reward-card__body { padding: .65rem; }
.reward-card__tag { font-size: .6rem; padding: .15rem .4rem; background: var(--primary); color: #fff; border-radius: .2rem; display: inline-block; margin-bottom: .25rem; }
.reward-card__name { font-size: .82rem; font-weight: 700; }
.reward-card__pts { font-size: .78rem; color: var(--primary); font-weight: 800; }
.reward-card__price { font-size: .68rem; color: var(--text-light); text-decoration: line-through; }
.expire-warn { padding: .65rem .85rem; background: #FEE2E2; color: #B91C1C; border-radius: .65rem; font-size: .75rem; margin-bottom: .75rem; }

.tier-stack { perspective: 800px; height: 200px; position: relative; margin: 1rem 0 1.5rem; }
.tier-card-3d { position: absolute; left: 50%; width: 85%; max-width: 300px; padding: 1.25rem; border-radius: 1rem; color: #fff; cursor: pointer; transition: transform .4s, z-index .4s; transform-origin: center bottom; }
.tier-card-3d[data-tier='bronze'] { background: linear-gradient(135deg, #CD7F32, #8B4513); transform: translateX(-50%) translateY(40px) scale(.88); z-index: 1; }
.tier-card-3d[data-tier='silver'] { background: linear-gradient(135deg, #C0C0C0, #808080); transform: translateX(-50%) translateY(20px) scale(.94); z-index: 2; }
.tier-card-3d[data-tier='gold'] { background: linear-gradient(135deg, #FFD700, #FFA000); transform: translateX(-50%) translateY(0) scale(1); z-index: 3; color: #3E2723; }
.tier-card-3d.active { transform: translateX(-50%) translateY(-10px) scale(1.05) !important; z-index: 10 !important; }
.tier-card-3d__name { font-size: 1.1rem; font-weight: 900; }
.tier-card-3d__min { font-size: .72rem; opacity: .9; margin-top: .25rem; }
.tier-perks { margin-top: 1rem; font-size: .82rem; }
.tier-perks li { padding: .35rem 0; border-bottom: 1px dashed var(--border); list-style: none; }
.tier-perks li::before { content: '✓ '; color: var(--primary); font-weight: 700; }
.tier-table { width: 100%; border-collapse: collapse; font-size: .72rem; margin-top: 1rem; }
.tier-table th, .tier-table td { padding: .45rem .35rem; border: 1px solid var(--border); text-align: center; }

.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.cal-streak { display: flex; align-items: center; gap: .35rem; font-weight: 800; color: var(--primary); font-size: .9rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; text-align: center; font-size: .72rem; }
.cal-day { padding: .45rem .2rem; border-radius: .45rem; background: var(--bg); }
.cal-day.checked { background: var(--primary); color: #fff; font-weight: 700; }
.cal-day.today { box-shadow: 0 0 0 2px var(--accent); }
.cal-day.empty { background: transparent; }
.cal-weekday { font-weight: 700; color: var(--text-light); font-size: .65rem; }

.coupon-scroll { display: flex; gap: .65rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory; }
.coupon-scroll::-webkit-scrollbar { display: none; }
.coupon-card { flex: 0 0 85%; max-width: 280px; scroll-snap-align: start; padding: 1rem; position: relative; border-left: 4px solid var(--primary); }
.coupon-card.expired { opacity: .5; filter: grayscale(.8); }
.coupon-card.urgent { border-left-color: #EF4444; }
.coupon-card__type { font-size: .62rem; color: var(--primary); font-weight: 700; }
.coupon-card__title { font-size: 1rem; font-weight: 900; margin: .25rem 0; }
.coupon-card__expire { font-size: .68rem; color: var(--text-light); }
.coupon-card__urgent { color: #EF4444; font-weight: 700; }

.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.ach-badge { padding: .85rem .5rem; text-align: center; border-radius: .75rem; }
.ach-badge.locked { opacity: .45; filter: grayscale(1); }
.ach-badge__icon { font-size: 1.75rem; }
.ach-badge__name { font-size: .65rem; font-weight: 700; margin-top: .25rem; }
.ach-badge__prog { font-size: .58rem; color: var(--text-light); }

.card-flip-wrap { perspective: 1000px; max-width: 320px; margin: 0 auto; }
.card-flip { position: relative; width: 100%; aspect-ratio: 1.586; transition: transform .6s; transform-style: preserve-3d; cursor: pointer; }
.card-flip.flipped { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 1rem; padding: 1.25rem; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 8px 32px rgba(0,0,0,.15); }
.card-face--back { transform: rotateY(180deg); align-items: center; justify-content: center; text-align: center; }
.card-face.theme-warm { background: linear-gradient(135deg, #FF6B35, #E65100); color: #fff; }
.card-face.theme-dark { background: linear-gradient(135deg, #212121, #FFD700); color: #fff; }
.card-face.theme-mint { background: linear-gradient(135deg, #26A69A, #00695C); color: #fff; }
.card-face.theme-vintage { background: linear-gradient(135deg, #A1887F, #5D4037); color: #fff; }
.card-face__brand { font-size: .78rem; opacity: .9; }
.card-face__name { font-size: 1.25rem; font-weight: 900; }
.card-face__tier { font-size: .82rem; margin-top: .25rem; }
.card-face__pts { font-size: 1.5rem; font-weight: 900; margin-top: auto; }
.card-qr { width: 8rem; height: 8rem; background: #fff; border-radius: .5rem; padding: .35rem; margin: 0 auto .5rem; }
.card-qr canvas, .card-qr img { width: 100% !important; height: 100% !important; }
.card-theme-row { display: flex; gap: .5rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.card-theme-btn { width: 2rem; height: 2rem; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.card-theme-btn.active { border-color: var(--primary); }

.history-filter { display: flex; gap: .4rem; margin-bottom: .75rem; flex-wrap: wrap; }
.history-filter button { padding: .35rem .65rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); font-size: .72rem; cursor: pointer; }
.history-filter button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.history-list { display: grid; gap: .5rem; }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: .75rem; font-size: .82rem; }
.history-item__change--plus { color: #059669; font-weight: 800; }
.history-item__change--minus { color: #DC2626; font-weight: 800; }
.history-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1rem; text-align: center; font-size: .72rem; }
.history-summary strong { display: block; font-size: 1rem; color: var(--primary); }

.annual-slides { display: flex; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .5rem 0; }
.annual-slide { flex: 0 0 85%; max-width: 300px; scroll-snap-align: center; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5rem; background: linear-gradient(160deg, var(--primary), var(--accent)); color: #fff; border-radius: 1rem; }
.annual-slide__stat { font-size: 2.5rem; font-weight: 900; line-height: 1; }
.annual-slide__label { font-size: 1rem; font-weight: 700; margin: .5rem 0 .25rem; }
.annual-slide__sub { font-size: .78rem; opacity: .9; }

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.modal__box { position: relative; background: var(--bg-card); border-radius: 1rem; padding: 1.25rem; max-width: 340px; width: 100%; text-align: center; }

.scene-panel, .theme-panel { position: fixed; z-index: 50; }
.scene-panel { bottom: calc(5rem + env(safe-area-inset-bottom)); left: 1rem; }
.theme-panel { bottom: calc(5rem + env(safe-area-inset-bottom)); right: 1rem; }
.scene-panel__toggle, .theme-panel__toggle { width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border); box-shadow: 0 4px 16px rgba(0,0,0,.12); font-size: 1.25rem; cursor: pointer; }
.scene-panel__list, .theme-panel__list { position: absolute; bottom: calc(100% + .5rem); background: var(--bg-card); border: 1px solid var(--border); border-radius: .75rem; padding: .5rem; min-width: 9rem; max-height: 50vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.15); }
.theme-panel__list { right: 0; left: auto; }
.scene-panel__list button, .theme-panel__list button { display: block; width: 100%; text-align: left; padding: .4rem .6rem; border-radius: .35rem; font-size: .8rem; color: var(--text); background: none; border: none; cursor: pointer; }
.scene-panel__list button.active, .theme-panel__list button.active, .scene-panel__list button:hover, .theme-panel__list button:hover { background: var(--primary); color: #fff; }

.inquiry-float { position: fixed; bottom: calc(4.5rem + env(safe-area-inset-bottom)); right: 1rem; z-index: 48; width: 3rem; height: 3rem; border-radius: 50%; background: var(--primary); color: #fff; font-size: 1.25rem; border: none; cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.site-footer { text-align: center; padding: 1.5rem 1rem; font-size: .72rem; color: var(--text-light); }
.contact-footer { position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; padding: .55rem 1rem calc(.55rem + env(safe-area-inset-bottom)); background: rgba(0,0,0,.82); color: #fff; text-align: center; }
.contact-footer__btns { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-bottom: .25rem; }
.contact-footer__cta { padding: .4rem .9rem; border-radius: 999px; background: var(--primary, #FF6B35); color: #fff; font-size: .78rem; font-weight: 600; }
.contact-footer__btn { padding: .4rem .75rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); color: #fff; background: transparent; font-size: .78rem; cursor: pointer; }
.contact-footer__brand { font-size: .65rem; opacity: .65; }
html.has-contact-footer body { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
body.share-page { padding-bottom: 2rem; }
