:root {
  --brand: #FF6B35;
  --brand-2: #FF9A5A;
  --brand-dark: #E14B18;
  --warm-bg: #FFF6EF;
  --card: #FFFFFF;
  --text: #2B2B2B;
  --text-2: #7A7A7A;
  --line: #F0E6DE;
  --gold: #B8860B;
  --ok: #2BA84A;
  --shadow: 0 6px 20px rgba(255, 107, 53, .12);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--warm-bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4,p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }

/* 顶部栏 */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(135deg, #FF6B35 0%, #FF8E4A 55%, #FFA05A 100%);
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: rgba(255,255,255,.22);
  display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 15px;
  border: 1px solid rgba(255,255,255,.45);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: #fff; font-size: 14.5px; letter-spacing: .3px; }
.brand-text em {
  font-style: normal; color: rgba(255,255,255,.86); font-size: 11px;
  display: flex; align-items: center; gap: 3px;
}
.brand-text em::after { content: "▾"; font-size: 9px; }
.topbar-actions { display: flex; gap: 6px; }
.icon-btn {
  position: relative; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.2); font-size: 15px; color: #fff;
  display: grid; place-items: center;
}
.icon-btn .dot {
  position: absolute; top: 6px; right: 7px; width: 7px; height: 7px;
  background: #FFE08A; border-radius: 50%; display: none;
}
.icon-btn .dot.show { display: block; }

/* 会员卡 */
.member-card {
  margin: -18px 14px 0;
  background: linear-gradient(135deg, #FFF9E8 0%, #FFF3D6 45%, #FFE9C4 100%);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  position: relative; z-index: 5;
  border: 1px solid #FFE9C4;
}
.mc-head { display: flex; align-items: center; justify-content: space-between; }
.mc-label { font-size: 13px; color: #8A6A2B; font-weight: 600; }
.mc-tag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 20px;
  background: linear-gradient(135deg, #E3B23C, #C99429); color: #fff; font-weight: 600;
}
.mc-body { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 6px; }
.mc-tip { font-size: 11.5px; color: #A98A4B; }
.mc-count { font-size: 34px; font-weight: 800; color: #C4942F; line-height: 1.05; }
.mc-btn {
  background: linear-gradient(135deg, #7A5B22, #5E4415); color: #FFE9A8;
  font-size: 12px; padding: 7px 14px; border-radius: 18px; font-weight: 600;
}
.mc-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: 12px; padding-top: 11px; border-top: 1px dashed #E7CFA0;
}
.mc-stats div { text-align: center; }
.mc-stats b { display: block; font-size: 17px; color: #8A6A2B; }
.mc-stats span { font-size: 11px; color: #A98A4B; }

/* Banner */
.banner {
  margin: 14px 14px 0; height: 118px; border-radius: 14px;
  background: linear-gradient(120deg, #FF5F2E 0%, #FF7B3C 50%, #FF9147 100%);
  color: #fff; display: flex; align-items: center; padding: 0 18px;
  position: relative; overflow: hidden;
}
.banner::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.banner::before {
  content: ""; position: absolute; right: 26px; bottom: -46px;
  width: 90px; height: 90px; border-radius: 50%;
  background: rgba(255,255,255,.09);
}
.banner-txt { position: relative; z-index: 2; }
.banner h3 { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.banner p { font-size: 12px; opacity: .95; margin-top: 6px; }

/* 快捷入口 */
.quick {
  margin: 14px 14px 0; background: var(--card); border-radius: 14px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 14px 6px; box-shadow: 0 3px 12px rgba(0,0,0,.04);
}
.quick-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; }
.qi-ico {
  width: 34px; height: 34px; border-radius: 11px; font-size: 16px;
  background: linear-gradient(135deg, #FFF1E7, #FFE3D2);
  display: grid; place-items: center;
}

/* 区块 */
.block { margin: 18px 14px 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.block-head h2 { font-size: 15.5px; font-weight: 700; }
.more { font-size: 12px; color: var(--text-2); }

/* 分类网格 */
.cat-grid {
  background: var(--card); border-radius: 14px; padding: 14px 6px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 0;
  box-shadow: 0 3px 12px rgba(0,0,0,.04);
}
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; }
.cat-ico {
  width: 40px; height: 40px; border-radius: 13px; font-size: 18px;
  display: grid; place-items: center;
}
.cat-item:nth-child(1) .cat-ico { background: linear-gradient(135deg,#FFE9DE,#FFD6C2); }
.cat-item:nth-child(2) .cat-ico { background: linear-gradient(135deg,#E3EEFF,#CFE1FF); }
.cat-item:nth-child(3) .cat-ico { background: linear-gradient(135deg,#FFEDE0,#FFDDBE); }
.cat-item:nth-child(4) .cat-ico { background: linear-gradient(135deg,#FFE6E6,#FFD0D0); }
.cat-item:nth-child(5) .cat-ico { background: linear-gradient(135deg,#FFF6D9,#FFE9B0); }
.cat-item:nth-child(6) .cat-ico { background: linear-gradient(135deg,#F0E9FF,#DFD1FF); }
.cat-item:nth-child(7) .cat-ico { background: linear-gradient(135deg,#E4F8EE,#C9F0DC); }
.cat-item:nth-child(8) .cat-ico { background: linear-gradient(135deg,#FFEAEF,#FFD2DE); }

/* 课程卡片 */
.course-list { display: flex; flex-direction: column; gap: 10px; }
.course-card {
  background: var(--card); border-radius: 14px; padding: 10px;
  display: flex; gap: 11px; box-shadow: 0 3px 12px rgba(0,0,0,.04);
}
.cc-cover {
  width: 84px; height: 84px; border-radius: 11px; flex: 0 0 84px;
  object-fit: cover; background: #F3EAE3;
}
.cc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cc-title { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-meta { font-size: 11.5px; color: var(--text-2); margin-top: 4px; }
.cc-tags { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.tag {
  font-size: 10px; padding: 2px 7px; border-radius: 5px;
  background: #FFF1E7; color: var(--brand-dark); border: .5px solid #FFD9C4;
}
.cc-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; }
.price { color: var(--brand); font-weight: 800; font-size: 17px; }
.price small { font-size: 11px; font-weight: 600; }
.price del { color: #C9C0BA; font-size: 11px; font-weight: 400; margin-left: 5px; }
.btn-book {
  background: linear-gradient(135deg, #FF7A45, #FF5A2E); color: #fff;
  font-size: 12px; padding: 6px 14px; border-radius: 16px; font-weight: 600;
  box-shadow: 0 3px 10px rgba(255,90,46,.32);
}

/* 教练 */
.coach-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.coach-scroll::-webkit-scrollbar { display: none; }
.coach-card {
  flex: 0 0 108px; background: var(--card); border-radius: 13px; padding: 12px 8px;
  text-align: center; box-shadow: 0 3px 12px rgba(0,0,0,.04);
}
.coach-card img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.coach-card b { display: block; font-size: 13px; margin-top: 7px; }
.coach-card span { font-size: 11px; color: var(--text-2); }

.foot { text-align: center; color: #B9ADA4; font-size: 11px; padding: 26px 0 84px; }

/* 底部 tab */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 480px; z-index: 40;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 7px 0 calc(7px + var(--safe-b));
  border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text-2); }
.tab span { font-size: 18px; line-height: 1; }
.tab.active { color: var(--brand); font-weight: 600; }

/* 弹层 */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-mask[hidden] { display: none; }
.sheet {
  background: #fff; width: 100%; max-width: 480px;
  border-radius: 18px 18px 0 0; max-height: 86vh; overflow-y: auto;
  padding: 16px 16px calc(20px + var(--safe-b));
  animation: up .24s ease;
}
@keyframes up { from { transform: translateY(30px); opacity: .4 } to { transform: none; opacity: 1 } }
.sheet-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.sheet-close { font-size: 20px; color: var(--text-2); line-height: 1; }

/* 搜索 */
.search-sheet { max-height: 100vh; height: 100vh; border-radius: 0; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.search-bar { display: flex; align-items: center; gap: 10px; }
.search-bar input {
  flex: 1; border: none; background: #F5F1EE; border-radius: 18px;
  padding: 9px 14px; font-size: 13.5px; outline: none;
}
.search-bar button { color: var(--text-2); font-size: 13.5px; }
.search-hot { margin-top: 18px; }
.search-hot h4 { font-size: 13px; margin-bottom: 10px; }
.tag-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-wrap span { background: #F7F3F0; color: #6B6259; padding: 5px 12px; border-radius: 16px; font-size: 12px; }
.search-result { margin-top: 18px; }

/* 详情 */
.detail-cover { width: 100%; height: 172px; object-fit: cover; border-radius: 12px; }
.detail-price { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 6px; }
.detail-price .price { font-size: 25px; }
.detail-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.slot-group { margin-top: 16px; }
.slot-group h4 { font-size: 13.5px; margin-bottom: 9px; display: flex; justify-content: space-between; }
.slot-list { display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px;
  font-size: 12.5px; background: #fff; text-align: center; line-height: 1.4;
}
.slot b { display: block; font-size: 13px; }
.slot small { color: var(--text-2); font-size: 10.5px; }
.slot.disabled { opacity: .42; }
.slot.active { border-color: var(--brand); background: #FFF3EC; color: var(--brand-dark); }
.slot.full small { color: var(--brand); }

/* 表单 */
.form-row { margin-bottom: 13px; }
.form-row label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13.5px; outline: none; font-family: inherit;
  background: #FCFAF9;
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--brand); background: #fff; }
.form-row textarea { resize: vertical; min-height: 62px; }
.submit-btn {
  width: 100%; margin-top: 6px; padding: 12px; border-radius: 24px; color: #fff;
  background: linear-gradient(135deg, #FF7A45, #FF5A2E); font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(255,90,46,.3);
}
.submit-btn:disabled { opacity: .5; }

/* 订单卡 */
.order-card {
  background: #fff; border-radius: 13px; padding: 12px; margin-bottom: 10px;
  box-shadow: 0 3px 12px rgba(0,0,0,.04);
}
.oc-head { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--text-2); }
.oc-title { font-size: 14.5px; font-weight: 700; margin: 7px 0 4px; }
.oc-meta { font-size: 12px; color: var(--text-2); }
.oc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 20px; }
.badge.pending { background: #FFF3E0; color: #E08A00; }
.badge.confirmed { background: #E4F6E9; color: #2BA84A; }
.badge.completed { background: #E9EEF5; color: #5A6B80; }
.badge.canceled { background: #F3F0EE; color: #A79C94; }
.link-btn { font-size: 12px; color: var(--text-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px; }

.empty { text-align: center; color: var(--text-2); font-size: 13px; padding: 60px 0; }
.empty div { font-size: 42px; margin-bottom: 10px; }

.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto; padding: 6px 14px; border-radius: 18px; font-size: 12.5px;
  background: #fff; color: var(--text-2); border: 1px solid var(--line);
}
.filter-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.list-page { display: none; }
.list-page.active { display: block; }
.home-page.hidden { display: none; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 13.5px; z-index: 90; max-width: 78%; text-align: center;
}
.toast[hidden] { display: none; }

.coach-item {
  display: flex; gap: 12px; background: #fff; border-radius: 13px; padding: 12px;
  margin-bottom: 10px; box-shadow: 0 3px 12px rgba(0,0,0,.04);
}
.coach-item img { width: 62px; height: 62px; border-radius: 12px; object-fit: cover; }

/* 二级页面头部 */
.list-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
  background: linear-gradient(135deg, #FF7A45, #FF9A5A);
  color: #fff;
}
.list-head h2 { font-size: 16px; font-weight: 700; }
.back-btn {
  width: 28px; height: 28px; border-radius: 50%; font-size: 19px;
  background: rgba(255,255,255,.22); color: #fff; line-height: 1;
}
.list-head + #listBody { padding: 14px 14px 96px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 12px; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto; padding: 6px 14px; border-radius: 18px; font-size: 12.5px;
  background: #fff; color: var(--text-2); border: 1px solid var(--line);
}
.filter-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.coach-chip {
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px;
  background: #fff; text-align: center; line-height: 1.4; min-width: 88px;
}
.coach-chip b { display: block; font-size: 13px; }
.coach-chip small { color: var(--text-2); font-size: 10.5px; }
