/* ============ 移动端公共样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #4f6ef7;
  --primary-dark: #3b5bdb;
  --primary-light: #eef1fe;
  --success: #12b76a;
  --warning: #f79009;
  --danger: #f04438;
  --gray-1: #f7f8fa;
  --gray-2: #ebedf0;
  --gray-3: #969799;
  --gray-4: #323233;
  --radius: 12px;
}
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #f2f4f8;
  color: var(--gray-4);
  min-height: 100vh;
}
.page { max-width: 520px; margin: 0 auto; min-height: 100vh; background: #f2f4f8; padding-bottom: 84px; }

/* 顶部 */
.hero {
  background: linear-gradient(135deg, #4f6ef7 0%, #7048e8 100%);
  color: #fff; padding: 28px 20px 52px; border-radius: 0 0 24px 24px;
}
.hero h1 { font-size: 21px; font-weight: 700; }
.hero p { font-size: 13px; opacity: .85; margin-top: 6px; }

/* 公告 */
.notice {
  margin: -32px 16px 12px; background: #fffbe8; border: 1px solid #ffe58f;
  border-radius: var(--radius); padding: 10px 14px; font-size: 13px; color: #874d00;
  display: flex; gap: 8px; line-height: 1.6;
}
.notice .icon { flex-shrink: 0; }

/* 卡片 */
.card {
  background: #fff; border-radius: var(--radius); margin: 12px 16px;
  padding: 16px; box-shadow: 0 1px 4px rgba(30, 41, 59, .05);
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.card-title::before { content: ''; width: 4px; height: 15px; background: var(--primary); border-radius: 2px; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--gray-3); margin-bottom: 6px; }
.field label .req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%; height: 44px; border: 1px solid var(--gray-2); border-radius: 10px;
  padding: 0 12px; font-size: 15px; background: var(--gray-1); outline: none;
  transition: border-color .2s, background .2s;
}
.field textarea { height: auto; padding: 10px 12px; resize: none; }
.field input:focus, .field textarea:focus { border-color: var(--primary); background: #fff; }

/* 按钮 */
.btn {
  display: block; width: 100%; height: 46px; border: none; border-radius: 23px;
  background: linear-gradient(135deg, #4f6ef7, #7048e8); color: #fff;
  font-size: 16px; font-weight: 600; cursor: pointer; transition: opacity .2s;
}
.btn:active { opacity: .8; }
.btn:disabled { background: #c3c9d9; cursor: not-allowed; }
.btn-sm {
  display: inline-block; width: auto; height: 32px; padding: 0 14px; line-height: 32px;
  border-radius: 16px; font-size: 13px; font-weight: 500;
}
.btn-plain { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-danger-plain { background: #fff; color: var(--danger); border: 1px solid var(--danger); }

/* 底部 Tab */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; background: #fff; display: flex;
  border-top: 1px solid var(--gray-2); padding: 6px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}
.tabbar .tab {
  flex: 1; text-align: center; font-size: 12px; color: var(--gray-3); cursor: pointer; padding-top: 4px;
}
.tabbar .tab .ticon { font-size: 22px; display: block; line-height: 1.2; }
.tabbar .tab.active { color: var(--primary); font-weight: 600; }

/* 日期横向滚动 */
.date-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.date-scroll::-webkit-scrollbar { display: none; }
.date-chip {
  flex-shrink: 0; width: 64px; padding: 10px 0; border-radius: 12px; text-align: center;
  background: var(--gray-1); border: 1.5px solid transparent; cursor: pointer; user-select: none;
}
.date-chip .wd { font-size: 12px; color: var(--gray-3); }
.date-chip .d { font-size: 16px; font-weight: 700; margin: 3px 0; }
.date-chip .left { font-size: 11px; color: var(--success); }
.date-chip .left.none { color: var(--gray-3); }
.date-chip.active { background: var(--primary-light); border-color: var(--primary); }
.date-chip.active .d { color: var(--primary); }
.date-chip.disabled { opacity: .45; pointer-events: none; }

/* 时段网格 */
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot {
  padding: 10px 0; text-align: center; border-radius: 10px; font-size: 14px;
  background: var(--gray-1); border: 1.5px solid transparent; cursor: pointer; user-select: none;
}
.slot .sub { font-size: 11px; color: var(--gray-3); margin-top: 2px; }
.slot.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.slot.full { opacity: .4; pointer-events: none; text-decoration: line-through; }

/* 预约卡片 */
.appt-card {
  background: #fff; border-radius: var(--radius); margin: 10px 16px; padding: 14px;
  box-shadow: 0 1px 4px rgba(30,41,59,.05);
}
.appt-card .row1 { display: flex; justify-content: space-between; align-items: center; }
.appt-card .time { font-size: 17px; font-weight: 700; }
.appt-card .meta { font-size: 13px; color: var(--gray-3); margin-top: 8px; line-height: 1.7; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.badge.pending { background: #e6f4ff; color: #1677ff; }
.badge.checked_in { background: #fff7e6; color: #d46b08; }
.badge.done { background: #f6ffed; color: #389e0d; }
.badge.canceled { background: #f5f5f5; color: #8c8c8c; }
.badge.no_show { background: #fff1f0; color: #cf1322; }
.badge.source { background: var(--primary-light); color: var(--primary-dark); margin-left: 6px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 340px; padding: 26px 22px; text-align: center;
}
.modal .m-icon { font-size: 44px; line-height: 1; }
.modal h3 { font-size: 17px; margin: 12px 0 8px; }
.modal p { font-size: 13px; color: var(--gray-3); line-height: 1.7; }
.modal .m-btns { margin-top: 18px; display: flex; gap: 10px; }
.modal .m-btns .btn { height: 40px; font-size: 14px; border-radius: 20px; }
.modal .m-detail {
  background: var(--gray-1); border-radius: 10px; padding: 12px; margin-top: 12px;
  font-size: 14px; text-align: left; line-height: 1.9;
}

/* Toast */
.toast {
  position: fixed; top: 45%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.78); color: #fff; font-size: 14px; padding: 12px 20px;
  border-radius: 10px; z-index: 200; max-width: 80vw; text-align: center; pointer-events: none;
}

.empty { text-align: center; color: var(--gray-3); font-size: 14px; padding: 40px 0; }
.empty .eicon { font-size: 40px; display: block; margin-bottom: 10px; opacity: .6; }
.hidden { display: none !important; }
.link { color: var(--primary); cursor: pointer; }
.muted { color: var(--gray-3); font-size: 12px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }

/* 项目选择 */
.proj-list { display: flex; flex-direction: column; gap: 8px; }
.proj-item { border: 1.5px solid var(--gray-2); border-radius: 10px; padding: 10px 14px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.proj-item .pname { font-weight: 600; font-size: 14px; }
.proj-item .pdesc { font-size: 12px; color: var(--gray-3); margin-top: 2px; }
.proj-item.active { border-color: var(--primary); background: var(--primary-light); }
.proj-item.active .pname { color: var(--primary); }
.roster-tip { font-size: 12.5px; margin-top: 6px; min-height: 14px; }
.roster-tip.err { color: var(--danger); }
.roster-tip.ok { color: var(--success); }
