/* ===================== 基础 ===================== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #07c160;      /* 微信绿 */
  --primary-d: #06ad56;
  --danger: #fa5151;
  --bg: #f2f3f5;
  --card: #ffffff;
  --text: #1f1f1f;
  --sub: #8a8a8a;
  --line: #ececec;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
.hidden { display: none !important; }
.view { min-height: 100vh; }

/* ===================== 按钮 ===================== */
.btn {
  display: inline-block; border: none; border-radius: 24px; padding: 12px 20px;
  font-size: 16px; font-weight: 600; cursor: pointer; width: 100%;
}
.btn-wechat { background: var(--primary); color: #fff; }
.btn-wechat:active { background: var(--primary-d); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-ghost { background: #f2f3f5; color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { width: auto; padding: 8px 16px; font-size: 14px; border-radius: 18px; margin-top: 10px; }
.link-btn { background: none; border: none; color: var(--sub); font-size: 12px; margin-top: 14px; text-decoration: underline; cursor: pointer; }

/* ===================== 登录 ===================== */
.login-view { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--card); border-radius: 16px; padding: 40px 24px; width: 100%; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,.05); }
.brand { font-size: 26px; font-weight: 700; }
.brand-sub { color: var(--sub); margin: 8px 0 28px; font-size: 13px; }
.login-card .btn-wechat { margin-top: 8px; }
.hint { color: var(--sub); font-size: 12px; margin-top: 16px; }

/* ===================== 顶栏 ===================== */
.topbar { height: 48px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; position: sticky; top: 0; z-index: 10; }

/* ===================== 卡片 ===================== */
.card { background: var(--card); border-radius: 12px; margin: 12px; padding: 14px; }

/* ===================== 日历 ===================== */
.calendar { }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { font-weight: 600; font-size: 16px; }
.cal-nav { width: 34px; height: 34px; border: none; background: #f2f3f5; border-radius: 50%; font-size: 20px; color: var(--text); cursor: pointer; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); text-align: center; color: var(--sub); font-size: 12px; margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-cell { aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 14px; position: relative; cursor: pointer; }
.cal-cell.empty { cursor: default; }
.cal-cell.disabled { color: #ccc; cursor: not-allowed; }
.cal-cell.has-slots { background: #eafaf0; color: var(--primary-d); font-weight: 600; }
.cal-cell.has-slots::after { content: ''; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.cal-cell.today { outline: 1px solid var(--primary); }
.cal-cell.selected { background: var(--primary); color: #fff; }
.cal-cell.selected::after { background: #fff; }
.cal-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--sub); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot-has { background: var(--primary); }
.dot-none { background: #ccc; }

/* ===================== 时段 ===================== */
.slots-panel { margin: 0 12px 80px; }
.slots-date { font-weight: 600; margin: 6px 4px 10px; font-size: 14px; }
.mentor-slots { background: var(--card); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.mentor-head { font-weight: 600; margin-bottom: 8px; }
.rating { color: #ff9f00; font-size: 13px; font-weight: 400; margin-left: 6px; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-chip { border: 1px solid var(--primary); color: var(--primary-d); background: #fff; border-radius: 18px; padding: 7px 14px; font-size: 14px; cursor: pointer; }
.slot-chip:active { background: var(--primary); color: #fff; }

/* ===================== 我的课程 ===================== */
.lessons-list { margin: 12px 12px 80px; }
.lesson-card { background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 10px; border-left: 4px solid var(--primary); }
.lesson-card.canceled { border-left-color: #ccc; opacity: .7; }
.lc-top { display: flex; justify-content: space-between; align-items: center; }
.lc-teacher { font-weight: 600; }
.lc-status { font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.st-approved { background: #eafaf0; color: var(--primary-d); }
.st-canceled { background: #f2f3f5; color: var(--sub); }
.lc-time { color: var(--text); margin: 6px 0; font-size: 14px; }
.lc-meeting { font-size: 13px; color: var(--sub); }
.lc-meeting a { color: var(--primary); text-decoration: none; }

/* ===================== Tab 栏 ===================== */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 56px; background: #fff; border-top: 1px solid var(--line); display: flex; }
.tab { flex: 1; border: none; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--sub); font-size: 12px; cursor: pointer; }
.tab .tab-ico { font-size: 20px; }
.tab.active { color: var(--primary); }

/* ===================== 弹窗 ===================== */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal-box { position: relative; background: #fff; width: 86%; max-width: 360px; border-radius: 14px; padding: 20px; }
.modal-box h3 { margin-bottom: 14px; }
.modal-tip { color: var(--sub); font-size: 13px; margin-bottom: 12px; }
.field { display: block; margin-bottom: 14px; font-size: 13px; color: var(--sub); }
.field > span { display: block; margin-bottom: 6px; }
.field select, .field input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; color: var(--text); }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #f2f3f5; padding: 6px 10px; border-radius: 16px; font-size: 13px; color: var(--text); }
.booking-detail p { margin: 6px 0; font-size: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { margin: 0; }

/* ===================== 杂项 ===================== */
.loading, .empty-tip { text-align: center; color: var(--sub); padding: 30px 0; font-size: 14px; }
.toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 100; max-width: 80%; text-align: center; }
