/* 私教预约 H5 · 全局样式（自适应）· v1.3：组件统一（门店标签 / 下拉框 / 筛选栏 / 列表项） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f6fa; color: #23262f; }

/* ---------- 表单控件：输入框 / 下拉框统一 ---------- */
input, select {
  width: 100%; height: 46px; border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 0 14px; font-size: 15px; margin-bottom: 12px; background: #fff; color: #23262f;
  font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: #1d7b47; }
input::placeholder { color: #b3b7bf; }

/* ---------- 按钮 ---------- */
.btn { border: none; border-radius: 10px; padding: 12px 18px; font-size: 15px; cursor: pointer; background: #1d7b47; color: #fff; transition: opacity .15s; font-family: inherit; }
.btn:active { opacity: .8; }
.btn-block { width: 100%; margin-top: 8px; }
.btn.link { background: none; color: #1d7b47; }
.btn.ghost { background: #e6f2ec; color: #1d7b47; }
.btn.danger { background: #ef4444; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 登录 / 注册 ---------- */
.page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 32px 24px; box-shadow: 0 4px 24px rgba(0,0,0,.06); }
.login-box .logo { display: block; width: 84px; height: 84px; object-fit: contain; margin: 0 auto 12px; }
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 6px; color: #222; }
.login-box .sub { text-align: center; color: #888; margin-bottom: 24px; }
.login-box .tip { text-align: center; color: #999; font-size: 13px; margin-bottom: 16px; }

/* ---------- 顶部栏 ---------- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #1d7b47; color: #fff; }
.topbar .avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #1d7b47; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: 0 0 auto; }
.topbar .view { flex: 1; font-size: 15px; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0; }
.topbar .btn { background: transparent; color: #fff; padding: 4px 8px; }
.topbar .logout { color: #fff; text-decoration: none; font-size: 14px; opacity: .95; flex: 0 0 auto; }

/* ---------- 门店标签（统一组件；顶栏内反白） ---------- */
.shop-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; line-height: 1.5;
  color: #1d7b47; background: #e6f2ec; border: 1px solid #cbe5d8; border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
.shop-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; flex: 0 0 auto; }
.shop-tag.all { color: #6b4ee6; background: #f0ecfd; border-color: #ddd4fb; }
.topbar .shop-tag { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.38); color: #fff; }

/* ---------- 课时包小标签（会员列表灰字行：课程类型 + 节数 + 有效期） ---------- */
.pack-list-sub { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; }
.meta-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #334155;
  background: #eef2f7; border: 1px solid #e2e8f0; border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
.meta-chip b { color: #1d7b47; }
.meta-chip.muted { color: #9aa3af; background: #f7f8fa; }

/* ---------- 顶栏返回按钮 ---------- */
.topbar .tb-back { color: #fff; text-decoration: none; font-size: 16px; line-height: 1;
  padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,.18); flex: 0 0 auto; cursor: pointer; }
.topbar .tb-back:active { opacity: .8; }

/* ---------- 筛选栏（统一组件） ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: #fff;
  border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.filter-bar .field { flex: 1 1 160px; }
.filter-bar input, .filter-bar select { margin-bottom: 0; }
.filter-bar .filter-note { flex: 0 0 100%; font-size: 12px; color: #8a8f99; }
.filter-bar .btn { flex: 0 0 auto; }

/* ---------- 通用块 ---------- */
.view { padding: 16px; }
.view-title { font-size: 18px; margin-bottom: 14px; }
.card { background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.card-title { font-weight: 600; margin-bottom: 10px; }
.hint { font-size: 12px; color: #999; margin-top: 10px; line-height: 1.6; }
.empty { text-align: center; color: #999; padding: 32px 0; font-size: 14px; }

/* ---------- 课时卡 ---------- */
.balance-card { background: linear-gradient(135deg, #1d7b47, #145c36); color: #fff; border-radius: 16px; padding: 24px; margin-bottom: 14px; }
.b-label { font-size: 14px; opacity: .85; }
.b-num { font-size: 42px; font-weight: 700; line-height: 1.2; margin: 4px 0; }
.b-sub { font-size: 13px; opacity: .85; }

/* ---------- 列表项（统一结构：.li-body 在左，.r 在右；灰字始终左对齐） ---------- */
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.list-item:last-child { border-bottom: none; }
.list-item .li-body { flex: 1 1 auto; min-width: 0; }
.list-item .l-main { font-size: 15px; font-weight: 600; }
.list-item .l-sub { font-size: 12px; color: #8a8f99; margin-top: 5px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.list-item .r { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }
.list-item .r .num { font-size: 16px; font-weight: 600; color: #1d7b47; }

/* ---------- 徽标 ---------- */
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 20px; background: #e6f2ec; color: #1d7b47; white-space: nowrap; }
.badge.warn { background: #fef3c7; color: #b45309; }
.badge.ok { background: #d1fae5; color: #047857; }
.badge.gray { background: #f1f1f1; color: #666; }

/* ---------- 预约流 ---------- */
.step { background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.step-title { font-weight: 600; margin-bottom: 10px; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.strip .day { min-width: 58px; flex: 0 0 auto; text-align: center; padding: 8px 6px; border-radius: 10px; background: #f5f6fa; cursor: pointer; }
.strip .day.active { background: #1d7b47; color: #fff; }
.strip .day .d { font-size: 13px; }
.strip .day .w { font-size: 11px; opacity: .8; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { padding: 8px 14px; border-radius: 20px; background: #f5f6fa; font-size: 14px; cursor: pointer; }
.chips .chip.active { background: #1d7b47; color: #fff; }
.chips .chip.disabled { opacity: .5; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin-top: 10px; }
.grid .cell { padding: 10px 6px; text-align: center; border-radius: 8px; border: 1px solid #e0e0e0; font-size: 13px; cursor: pointer; background: #fff; }
.grid .cell.busy { background: #f3f4f6; color: #bbb; cursor: not-allowed; border-color: #eee; }
.grid .cell.active { background: #1d7b47; color: #fff; border-color: #1d7b47; }

.summary { background: #fff; border-radius: 14px; padding: 16px; margin-top: 12px; }
.summary .tip { font-size: 12px; color: #888; margin: 8px 0; }

.seg { display: flex; gap: 8px; margin-bottom: 12px; }
.seg-btn { flex: 1; padding: 10px; border: none; border-radius: 10px; background: #f1f1f1; color: #666; font-family: inherit; font-size: 14px; cursor: pointer; }
.seg-btn.active { background: #1d7b47; color: #fff; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 88%; max-width: 340px; }
.modal h3 { margin-bottom: 12px; }
.modal p { font-size: 14px; color: #555; line-height: 1.6; }
.modal .m-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal .m-actions .btn { flex: 1; }

/* ---------- 教练端日历 ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-size: 15px; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: 12px; color: #999; text-align: center; margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell { min-height: 48px; border-radius: 8px; padding: 4px 2px; text-align: center; background: #f6f7f9; cursor: pointer; user-select: none; }
.cal-cell.empty { background: transparent; cursor: default; }
.cal-cell.today { box-shadow: inset 0 0 0 2px #1d7b47; }
.cal-cell.active { background: #1d7b47; color: #fff; }
.cal-cell .d { font-size: 14px; font-weight: 600; }
.cal-cell .c { font-size: 11px; color: #1d7b47; margin-top: 2px; }
.cal-cell.active .c { color: #fff; }
.cal-cell.past { color: #ccc; background: #fafafa; cursor: default; }

/* ---------- 桌面适配 ---------- */
@media (min-width: 768px) {
  .view { max-width: 720px; margin: 0 auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
