/* fitcoach 学员端样式 —— 公开页 /s/{token} 专用
   亮色主题（浅底深字）· 移动端优先 · 零 CDN（无 @import、无外链字体） */

:root {
  --bg:        #f4f6f8;
  --card:      #ffffff;
  --ink:       #1b1f24;
  --ink-2:     #4a5560;
  --muted:     #79838f;
  --line:      #e3e8ee;
  --brand:     #0f7b6c;
  --brand-bg:  #e8f5f2;
  --warn:      #a15c00;
  --warn-bg:   #fdf3e2;
  --bad:       #a32020;
  --bad-bg:    #fdeded;
  --gray-bg:   #f0f2f5;
  --radius:    14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.pub {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  padding: 0 0 32px;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 0;
}

/* ---------- 页头 ---------- */
.hdr { margin: 4px 0 16px; }
.hdr .who {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
}
.hdr .sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 14px;
}
.card > h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .5px;
}

/* ---------- 大字余额 ---------- */
.balance { text-align: center; padding-top: 22px; }
.big { line-height: 1; }
.big .num {
  font-size: 68px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}
.big .unit {
  font-size: 22px;
  font-weight: 600;
  color: var(--brand);
  margin-left: 4px;
}
.big-cap {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 2px;
}

/* ---------- 表格（多属性内容一律表格） ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 9px 6px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
tbody tr:last-child th,
tbody tr:last-child td { border-bottom: 0; }
td.n, th.n {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
tfoot td, tfoot th {
  border-top: 2px solid var(--line);
  border-bottom: 0;
  font-weight: 700;
  padding-top: 10px;
}

.pkg-table { margin-top: 16px; text-align: left; }

/* ---------- 提示行 ---------- */
.msg {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
}
.msg-dim { background: var(--gray-bg); color: var(--muted); }
.msg-warn   { background: var(--bad-bg);  color: var(--bad); }
.msg-quiet  { background: var(--gray-bg); color: var(--muted); margin: 0; }

/* ---------- 下次课 ---------- */
.next-when {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.next-date { font-size: 19px; font-weight: 700; }
.next-time {
  font-size: 19px;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--brand-bg);
  color: var(--brand);
}
.kv th {
  width: 4.5em;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- 历史（窄屏卡片式表格：th 左列 + td 右列） ---------- */
.hist th.when {
  width: 4.6em;
  padding-right: 10px;
  white-space: nowrap;
  font-weight: 600;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.hist .d1 { display: block; }
.hist .d2 { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.hist td.what { width: auto; }
.hist .row1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2px;
}
.hist .time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hist .text { line-height: 1.45; }
.hist .place { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-completed { background: var(--brand-bg); color: var(--brand); }
.badge-no_show   { background: var(--warn-bg);  color: var(--warn); }
.badge-cancelled { background: var(--gray-bg);  color: var(--muted); }
/* 过了时间但教练还没记状态的课 —— 学员看得见才叫争议防线 */
.badge-scheduled { background: var(--gray-bg);  color: var(--muted); }
.st-hint { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------- 页脚 ---------- */
.foot {
  max-width: 560px;
  margin: 18px auto 0;
  padding: 0 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* ---------- 404 ---------- */
.center-page { text-align: center; padding-top: 48px; }
.center-page h1 { font-size: 20px; margin: 0 0 8px; }
.center-page p { color: var(--muted); font-size: 14px; margin: 0; }

@media (min-width: 480px) {
  .wrap { padding-top: 28px; }
  .big .num { font-size: 76px; }
}
