/* ============================================================
   彭世会员卡 H5 —— 移动端样式（蓝色主题，卡片化）
   ============================================================ */

:root {
  --primary: #2b6fed;
  --primary-dark: #1f57c9;
  --primary-light: #eaf1ff;
  --bg: #f2f4f8;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-sub: #8a93a6;
  --success: #1bbf72;
  --danger: #f04438;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh;
  padding: 64px 24px 32px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand {
  text-align: center;
  color: #fff;
  margin-bottom: 36px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 34px;
  font-weight: 700;
  line-height: 64px;
}

.brand-title {
  font-size: 22px;
  margin: 0 0 6px;
  font-weight: 600;
}

.brand-sub {
  margin: 0;
  font-size: 13px;
  opacity: 0.85;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.field {
  display: flex;
  align-items: center;
  border: 1px solid #e3e7ef;
  border-radius: 10px;
  padding: 0 12px;
  height: 48px;
  margin-bottom: 14px;
  background: #fff;
}

.field input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
  height: 100%;
}

.phone-field .prefix {
  color: var(--text-sub);
  font-size: 15px;
  margin-right: 10px;
  padding-right: 10px;
  border-right: 1px solid #e3e7ef;
}

.code-field .code-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  white-space: nowrap;
  padding: 0 4px;
}

.code-field .code-btn:disabled {
  color: var(--text-sub);
}

.agreement {
  display: flex;
  align-items: flex-start;
  font-size: 12px;
  color: var(--text-sub);
  margin: 4px 2px 18px;
  line-height: 1.4;
}

.agreement input {
  margin: 2px 6px 0 0;
  flex-shrink: 0;
}

.primary-btn {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 25px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
}

.primary-btn:disabled {
  opacity: 0.7;
}

.tip {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  margin-top: 18px;
}

/* ---------- 会员卡页 ---------- */
.app-page {
  min-height: 100vh;
  padding-bottom: 24px;
}

.user-header {
  display: flex;
  align-items: center;
  padding: 22px 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.user-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  text-align: center;
  line-height: 46px;
  font-size: 20px;
  font-weight: 600;
  margin-right: 12px;
}

.user-meta {
  flex: 1;
}

.user-name {
  font-size: 17px;
  font-weight: 600;
}

.user-phone {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

.logout-btn {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #fff;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 16px;
}

.summary {
  display: flex;
  background: #fff;
  margin: 12px;
  border-radius: var(--radius);
  padding: 16px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.summary-item {
  flex: 1;
  text-align: center;
  position: relative;
}

.summary-item + .summary-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  height: 80%;
  width: 1px;
  background: #eef0f4;
}

.summary-item .num {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.summary-item .label {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 4px;
}

/* 会员卡列表 */
.card-list {
  padding: 0 12px;
}

.member-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--primary);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-name {
  font-size: 17px;
  font-weight: 600;
}

.card-no {
  color: var(--text-sub);
  font-size: 13px;
  margin: 6px 0 12px;
  letter-spacing: 0.5px;
}

.card-info {
  display: flex;
  border-top: 1px dashed #eef0f4;
  padding-top: 12px;
}

.info-item {
  flex: 1;
  text-align: center;
}

.info-item + .info-item {
  border-left: 1px solid #f0f2f6;
}

.info-item .label {
  font-size: 12px;
  color: var(--text-sub);
}

.info-item .value {
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

.card-foot {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  /* 防止 "测试门店" 被截成 "测试门 店"（CJK 不断词） */
  word-break: keep-all;
}

.open-store,
.open-time {
  font-size: 12px;
  color: var(--text-sub);
  /* 店名过长时优雅截断，而不是换行把按钮挤下去 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.consume-btn {
  /* 自适应宽度让按钮显示完整 "消费记录" */
  align-self: flex-end;
  margin-top: 4px;
  border: none;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 16px;
  font-weight: 600;
}

/* 状态角标 */
.badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.badge-on {
  background: rgba(27, 191, 114, 0.12);
  color: var(--success);
}

.badge-off {
  background: rgba(240, 68, 56, 0.12);
  color: var(--danger);
}

/* 弹层 */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal-panel {
  position: relative;
  width: 100%;
  background: #fff;
  border-radius: 16px 16px 0 0;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #f0f2f6;
  font-weight: 600;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--text-sub);
}

.modal-body {
  padding: 8px 18px 20px;
  overflow-y: auto;
}

.consume-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f4f6fa;
}

.consume-main .consume-type {
  font-size: 15px;
  font-weight: 500;
}

.consume-main .consume-store {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 3px;
}

/* ⑤ 消费具体内容（非遗修脚/普通足浴/局部按摩/3TO/抗菌液…），品牌蓝高亮 */
.consume-main .consume-content {
  font-size: 13px;
  font-weight: 500;
  color: #005EC4;
  margin-top: 4px;
  line-height: 1.4;
  word-break: break-all;
}

.consume-right {
  text-align: right;
}

.consume-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.consume-time {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 3px;
}

.loading,
.empty {
  text-align: center;
  color: var(--text-sub);
  padding: 40px 0;
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 100;
  max-width: 80%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
