/* R81 作业辅导预约 H5 */
:root {
  --color-primary: #FF8C42;
  --color-primary-dark: #E07630;
  --color-secondary: #FFD166;
  --color-accent: #06D6A0;
  --color-surface: #FFF8F0;
  --color-gradient: linear-gradient(135deg, #FF8C42, #FF6B35);
  --text-primary: #2D3436;
  --text-secondary: #636E72;
  --text-hint: #B2BEC3;
  --color-success: #06D6A0;
  --color-warning: #FDCB6E;
  --color-error: #E17055;
  --color-white: #fff;
  --color-border: #DFE6E9;
  --color-bg: #F8F9FA;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --header-height: 52px;
  --contact-footer-h: 58px;
  --font: -apple-system, 'PingFang SC', 'Helvetica Neue', sans-serif;
  --transition: 300ms ease;
}

[data-theme="teacher"] {
  --color-primary: #4A90D9;
  --color-primary-dark: #3A7BC8;
  --color-secondary: #7C5CFC;
  --color-accent: #34D399;
  --color-surface: #F0F7FF;
  --color-gradient: linear-gradient(135deg, #4A90D9, #3B82F6);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom, 0));
}
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

#app { min-height: 100vh; }
.page-root { min-height: 60vh; }

/* Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--space-md);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.top-header__brand { font-weight: 700; font-size: 16px; }
.top-header__brand span { margin-right: 6px; }
.top-header__actions { display: flex; gap: 8px; }
.icon-btn {
  border: 0;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  padding: var(--space-lg) var(--space-md) var(--space-md);
  background: var(--color-gradient);
  color: #fff;
  overflow: hidden;
}
.hero__illus {
  position: absolute;
  right: -10px;
  top: 10px;
  font-size: 72px;
  opacity: .35;
  transform: translateY(var(--hero-parallax, 0));
  transition: transform .1s linear;
}
.hero h1 { margin: 0 0 6px; font-size: 22px; }
.hero p { margin: 0; opacity: .92; font-size: 14px; }

/* Search */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: var(--space-md);
  padding: 10px 14px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.search-bar span { color: var(--text-hint); font-size: 14px; }

/* Dual Tab */
.dual-tab {
  display: flex;
  margin: 0 var(--space-md);
  background: var(--color-white);
  border-radius: var(--radius-full);
  padding: 4px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: var(--header-height);
  z-index: 40;
}
.dual-tab__btn {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 8px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}
.dual-tab__btn.is-active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.tab-panel {
  padding: var(--space-md);
  transition: opacity var(--transition), transform var(--transition);
}
.tab-panel.is-entering { opacity: 0; transform: translateX(12px); }

/* Tutoring cards */
.tutoring-grid { display: grid; gap: var(--space-md); }
.tutoring-card {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
  border: 2px solid transparent;
  cursor: pointer;
}
.tutoring-card.is-popular { border-color: var(--color-primary); }
.tutoring-card__tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.tutoring-card__icon { font-size: 32px; margin-bottom: 8px; }
.tutoring-card h3 { margin: 0 0 4px; }
.tutoring-card__time, .tutoring-card__price { margin: 4px 0; font-size: 13px; color: var(--text-secondary); }
.tutoring-card__price { color: var(--color-primary); font-weight: 700; font-size: 16px; }
.tutoring-card__features { margin: 8px 0 12px; padding-left: 18px; font-size: 13px; color: var(--text-secondary); }

/* Subject grid */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: var(--space-md);
}
.subject-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  cursor: pointer;
}
.subject-item:active { transform: scale(.98); }

/* Teacher cards */
.teacher-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.teacher-scroll .teacher-card { min-width: 260px; scroll-snap-align: start; }
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  padding: var(--space-md);
}
.teacher-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  animation: cardIn .4s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}
.teacher-card__top { display: flex; gap: 12px; }
.teacher-card__avatar { font-size: 36px; }
.teacher-card__info h3 { margin: 0 0 4px; font-size: 15px; }
.teacher-card__info p { margin: 0; font-size: 12px; color: var(--text-secondary); }
.teacher-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}
.teacher-card__price { font-weight: 700; color: var(--color-primary); }

/* Trust wall */
.trust-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: var(--space-md);
  background: var(--color-surface);
  margin: var(--space-md);
  border-radius: var(--radius-md);
}
.trust-stat { text-align: center; font-size: 11px; }
.trust-stat strong { display: block; font-size: 16px; color: var(--color-primary); }
.testimonial-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 var(--space-md) var(--space-md);
}
.testimonial-card {
  min-width: 260px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
}
.testimonial-card p { margin: 8px 0 0; color: var(--text-secondary); }

/* Chips / badges */
.chip-row, .filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .filter-chip {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  font-size: 13px;
  cursor: pointer;
}
.chip.is-active, .filter-chip.is-active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.chip--muted { background: var(--color-bg); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-primary-dark);
  font-size: 11px;
  margin-right: 4px;
}
.badge--sm { font-size: 10px; }
.online-tag.is-online { color: var(--color-success); font-size: 12px; }

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-md);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.page-header h1 { margin: 0; font-size: 17px; flex: 1; }
.btn-back {
  border: 0;
  background: var(--color-surface);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 18px;
}

/* Weekly grid */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  font-size: 14px;
}
.week-nav button {
  border: 1px solid var(--color-border);
  background: var(--color-white);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
}
.time-grid-wrap { padding: 0 var(--space-md) 100px; overflow-x: auto; }
.time-grid {
  display: grid;
  grid-template-columns: 72px repeat(5, 1fr);
  gap: 6px;
  min-width: 320px;
}
.time-grid__head {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 4px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
}
.time-grid__label {
  font-size: 11px;
  padding: 8px 4px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}
.time-slot {
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.time-slot:hover:not(.slot-booked) { transform: scale(1.06); box-shadow: var(--shadow-md); }
.time-slot.slot-selected {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  font-weight: 700;
}
.time-slot.slot-booked {
  background: #eee;
  color: var(--text-hint);
  cursor: not-allowed;
  pointer-events: none;
}

.slot-summary {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom, 0));
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  padding: var(--space-md);
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  z-index: 60;
}
.slot-summary p { margin: 0 0 8px; font-size: 13px; color: var(--text-secondary); }
.slot-summary__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.slot-summary__price { font-weight: 700; color: var(--color-primary); font-size: 18px; }

/* Booking wizard */
.wizard-progress {
  display: flex;
  padding: var(--space-md);
  gap: 4px;
  background: var(--color-white);
}
.wizard-step {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--text-hint);
  position: relative;
}
.wizard-step::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  margin: 0 auto 4px;
}
.wizard-step.is-done::before, .wizard-step.is-active::before { background: var(--color-primary); }
.wizard-step.is-active { color: var(--color-primary); font-weight: 600; }
.wizard-body { padding: var(--space-md) var(--space-md) 120px; }
.wizard-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom, 0));
  display: flex;
  gap: 12px;
  padding: var(--space-md);
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  z-index: 60;
}
.service-pick, .provider-pick {
  display: grid;
  gap: 12px;
}
.pick-card {
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  cursor: pointer;
  text-align: center;
  font-size: 16px;
}
.pick-card.is-selected { border-color: var(--color-primary); background: var(--color-surface); }
.booking-summary {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  font-size: 14px;
}
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--text-secondary); }
.form-group input, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

/* Success */
.success-page {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  min-height: 70vh;
}
.success-icon {
  font-size: 64px;
  animation: popIn .5s ease;
}
@keyframes popIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.success-page h2 { margin: 16px 0 8px; }
.success-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-lg) 0;
  text-align: left;
  font-size: 14px;
}
.success-actions { display: flex; flex-direction: column; gap: 10px; }

/* Profile */
.profile-header {
  padding: var(--space-lg) var(--space-md);
  background: var(--color-gradient);
  color: #fff;
}
.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: var(--space-md);
}
.stat-box {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.booking-list { padding: 0 var(--space-md) var(--space-md); }
.booking-item {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.booking-item__status { color: var(--color-primary); font-weight: 600; }

/* Pricing */
.pricing-grid {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-md);
}
.pricing-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
  border: 2px solid transparent;
}
.pricing-card.is-popular { border-color: var(--color-primary); }
.pricing-card h3 { margin: 0 0 8px; }
.pricing-card__price { font-size: 28px; font-weight: 700; color: var(--color-primary); }
.pricing-card ul { padding-left: 18px; font-size: 13px; color: var(--text-secondary); }

/* Detail */
.detail-hero-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-white);
}
.detail-avatar { font-size: 56px; }
.detail-section { padding: var(--space-md); background: var(--color-white); margin-bottom: 8px; }
.detail-section h3 { margin: 0 0 8px; font-size: 15px; }
.detail-cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom, 0));
  display: flex;
  gap: 10px;
  padding: var(--space-md);
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  z-index: 60;
}
.page-detail { padding-bottom: 80px; }
.review-card {
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
.review-card__meta { font-size: 11px; color: var(--text-hint); }

/* Buttons */
.btn {
  border: 0;
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--outline { background: var(--color-white); color: var(--color-primary); border: 2px solid var(--color-primary); }
.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--block { width: 100%; }
.btn--sm { padding: 6px 12px; font-size: 12px; }
.btn--lg { padding: 12px 24px; font-size: 16px; }

/* Float CTA */
.float-cta {
  position: fixed;
  right: 16px;
  bottom: calc(var(--contact-footer-h) + 72px + env(safe-area-inset-bottom, 0));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: var(--color-gradient);
  color: #fff;
  font-size: 22px;
  box-shadow: var(--shadow-lg);
  z-index: 55;
  cursor: pointer;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.float-cta[hidden] { display: none !important; }

/* Trial modal */
.trial-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.trial-sheet[hidden] { display: none !important; }
.trial-sheet__mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.trial-sheet__panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: var(--space-lg) var(--space-md);
}
.trial-sheet h3 { margin: 0 0 8px; }
.trial-sheet p { font-size: 13px; color: var(--text-secondary); }

/* Stars */
.star--full { color: #FFB800; }
.star--empty { color: #ddd; }

/* Misc */
.empty-state { text-align: center; padding: 40px 16px; color: var(--text-hint); }
.hint-text { color: var(--text-hint); font-size: 13px; }
.link-more {
  display: block;
  text-align: center;
  padding: 12px;
  color: var(--color-primary);
  font-weight: 600;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--contact-footer-h) + 24px);
  transform: translateX(-50%);
  background: rgba(0,0,0,.78);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 300;
}
.toast.is-show { opacity: 1; }
.loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 400;
}
.loading-mask[hidden] { display: none !important; }
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-surface);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Contact footer */
.contact-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: rgba(255,255,255,.98);
  border-top: 1px solid var(--color-border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.contact-footer__btns {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px 4px;
}
.contact-footer__cta, .contact-footer__btn {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: var(--radius-full);
  font-size: 12px;
}
.contact-footer__cta { background: var(--color-primary); color: #fff; font-weight: 600; }
.contact-footer__btn { background: var(--color-bg); border: 1px solid var(--color-border); color: var(--text-primary); }
.contact-footer__brand { margin: 0; padding: 0 12px 6px; text-align: center; font-size: 10px; color: var(--text-hint); }

/* P1 · 签到 / 日报 / 通知 / 邀请 */
.profile-menu {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 var(--space-md) var(--space-md);
}
.profile-menu__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  font-size: 12px;
  cursor: pointer;
}
.profile-menu__item span:first-child { font-size: 22px; }
.menu-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--color-error);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.checkin-page { padding: var(--space-md); text-align: center; }
.checkin-date { font-size: 15px; margin-bottom: var(--space-lg); }
.checkin-btns { display: flex; justify-content: center; gap: var(--space-lg); margin-bottom: var(--space-xl); }
.checkin-btn {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-primary);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
}
.checkin-btn.is-pulse { animation: checkinPulse 2s ease-in-out infinite; }
@keyframes checkinPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,140,66,.4); }
  50% { box-shadow: 0 0 0 12px rgba(255,140,66,0); }
}
.checkin-btn.is-done { opacity: .55; border-color: var(--color-border); cursor: default; }
.checkin-btn:disabled { opacity: .45; cursor: not-allowed; }
.checkin-btn strong { font-size: 18px; color: var(--color-primary); }
.checkin-week { text-align: left; margin-bottom: var(--space-lg); }
.progress-bar {
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar__fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width .3s ease;
}
.checkin-log { text-align: left; }
.checkin-log-item {
  padding: 10px 12px;
  background: var(--color-white);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}

.report-page { padding: var(--space-md); }
.report-page h2 { margin: 0 0 4px; font-size: 18px; }
.report-date { color: var(--text-secondary); font-size: 14px; margin-bottom: var(--space-md); }
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: var(--space-md);
}
.metric-cell {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.metric-cell__icon { font-size: 28px; display: block; margin-bottom: 4px; }
.report-comment {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}
.report-comment h3 { margin: 0 0 8px; font-size: 15px; }
.report-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}
.trend-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 100px;
  padding: var(--space-md);
  background: var(--color-white);
  border-radius: var(--radius-md);
}
.trend-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}
.trend-bar__fill {
  width: 20px;
  background: var(--color-primary);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}
.trend-bar span { font-size: 11px; color: var(--text-hint); }

.notif-page { padding: var(--space-md); }
.notif-prefs {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 14px;
}
.notif-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.btn-text {
  border: 0;
  background: none;
  color: var(--color-primary);
  font-size: 13px;
  cursor: pointer;
}
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
}
.notif-item.is-unread { border-left: 3px solid var(--color-primary); }
.notif-item__icon { font-size: 24px; }
.notif-item p { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); }

.invite-page { padding: var(--space-md); }
.invite-hero {
  background: var(--color-gradient);
  color: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  margin-bottom: var(--space-md);
}
.invite-code { font-size: 28px; letter-spacing: 4px; }
.invite-actions { display: flex; gap: 10px; margin-bottom: 12px; }
.invite-actions .btn { flex: 1; }
.invite-url { font-size: 11px; color: var(--text-hint); word-break: break-all; }
.invite-poster-wrap { margin: 16px 0; text-align: center; }
.invite-poster-wrap canvas { max-width: 100%; border-radius: 8px; box-shadow: var(--shadow-md); }
.leaderboard { margin-top: var(--space-lg); }
.leader-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--color-white);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 14px;
}
.leader-row.is-me { border: 1px solid var(--color-primary); background: var(--color-surface); }
.leader-rank { width: 24px; color: var(--text-hint); }
.leader-row span:nth-child(2) { flex: 1; }

/* Editor mode */
body.has-contact-footer .em-entry-btn {
  bottom: calc(var(--contact-footer-h) + 14px + env(safe-area-inset-bottom, 0));
}
body.editor-mode-active.has-contact-footer {
  padding-bottom: calc(var(--contact-footer-h) + 52px + env(safe-area-inset-bottom, 0));
}

@media (max-width: 374px) {
  .teacher-grid { grid-template-columns: 1fr; }
  .trust-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  #app, .contact-footer, .slot-summary, .wizard-nav, .detail-cta-bar {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  .contact-footer, .slot-summary, .wizard-nav, .detail-cta-bar { left: 50%; right: auto; width: 100%; transform: translateX(-50%); }
}
