:root {
  --bg: #f0f7fb;
  --bg-soft: #f8fbfd;
  --card: #ffffff;
  --primary: #3b82f6;
  --primary-2: #60a5fa;
  --accent: #fb923c;
  --accent-2: #fdba74;
  --teal: #2dd4bf;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --danger: #ef4444;
  --ok: #22c55e;
  --shadow: 0 8px 24px rgba(59, 130, 246, 0.08);
  --radius: 18px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
body { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; border: none; outline: none; background: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

#app {
  max-width: 430px;
  margin: 0 auto;
  height: 100%;
  position: relative;
  background: linear-gradient(180deg, #dbeafe 0%, var(--bg) 28%, var(--bg-soft) 100%);
  box-shadow: 0 0 40px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.page {
  height: 100%;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.page.active { display: flex; }

.scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px calc(var(--nav-h) + var(--safe-b) + 16px);
}
.scroll.no-nav { padding-bottom: 24px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}
.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #60a5fa, #fb923c, #34d399, #60a5fa);
  position: relative;
  flex-shrink: 0;
}
.brand-logo::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
}
.search {
  flex: 1;
  height: 36px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 13px;
  box-shadow: var(--shadow);
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  color: var(--muted);
  cursor: pointer;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #93c5fd, #fdba74);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 10px;
  font-size: 15px;
  font-weight: 700;
}
.section-title .more {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

.pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
}
.pill-tabs::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
}
.pill.active {
  background: #fff;
  color: var(--primary);
  border-color: #bfdbfe;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.grid-icons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
  margin-top: 4px;
}
.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}
.grid-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 6px 14px rgba(59,130,246,0.18);
}
.g1 { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.g2 { background: linear-gradient(135deg, #fdba74, #fb923c); }
.g3 { background: linear-gradient(135deg, #5eead4, #14b8a6); }
.g4 { background: linear-gradient(135deg, #c4b5fd, #8b5cf6); }
.g5 { background: linear-gradient(135deg, #f9a8d4, #ec4899); }
.g6 { background: linear-gradient(135deg, #93c5fd, #38bdf8); }
.g7 { background: linear-gradient(135deg, #fcd34d, #f59e0b); }
.g8 { background: linear-gradient(135deg, #86efac, #22c55e); }

.banner {
  border-radius: 20px;
  padding: 18px 16px;
  background: linear-gradient(135deg, #93c5fd 0%, #bfdbfe 45%, #fed7aa 100%);
  color: #0f172a;
  position: relative;
  overflow: hidden;
  min-height: 110px;
}
.banner h2 { font-size: 18px; margin-bottom: 6px; }
.banner p { font-size: 12px; color: #334155; line-height: 1.5; max-width: 70%; }
.banner .mascot {
  position: absolute;
  right: 10px;
  bottom: 0;
  width: 88px;
  height: 88px;
  border-radius: 50% 50% 18px 18px;
  background: radial-gradient(circle at 30% 30%, #fff7ed, #fb923c);
  opacity: 0.95;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px 10px;
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.stat-card .value { font-size: 18px; font-weight: 700; color: var(--primary); }
.stat-card .sub { font-size: 11px; color: var(--accent); margin-top: 4px; }
.progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--teal));
  border-radius: 999px;
}

.case-item, .list-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.case-item:last-child, .list-item:last-child { border-bottom: none; }
.case-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #bfdbfe, #fed7aa);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #1d4ed8;
  flex-shrink: 0;
}
.case-meta { flex: 1; min-width: 0; }
.case-meta .name { font-weight: 600; font-size: 14px; }
.case-meta .desc { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #eff6ff;
  color: var(--primary);
}
.tag.warn { background: #fff7ed; color: #ea580c; }
.tag.ok { background: #ecfdf5; color: #059669; }
.tag.danger { background: #fef2f2; color: #dc2626; }

.bottom-nav {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(8px + var(--safe-b));
  height: var(--nav-h);
  background: rgba(255,255,255,0.96);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  z-index: 20;
  backdrop-filter: blur(10px);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 0;
}
.nav-item.active { color: var(--primary); font-weight: 600; }
.nav-item .ni {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.nav-center {
  width: 48px;
  height: 48px;
  margin-top: -22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #fb923c);
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(59,130,246,0.35);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 4px;
}
.page-head h1 {
  font-size: 18px;
  font-weight: 700;
}
.back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(90deg, #fb923c, #a78bfa);
  color: #fff;
  box-shadow: 0 8px 16px rgba(251,146,60,0.25);
}
.btn-blue {
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  color: #fff;
}
.btn-ghost {
  background: #eff6ff;
  color: var(--primary);
}
.btn-block { width: 100%; }
.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

/* login */
.login-page {
  background: linear-gradient(180deg, #7c8cff 0%, #a5b4fc 35%, #dbeafe 70%, #eff6ff 100%);
  padding: 48px 24px 32px;
}
.login-page .title {
  color: #fff;
  text-align: center;
  margin-bottom: 28px;
}
.login-page .title h1 {
  font-size: 36px;
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.login-page .title p {
  font-size: 13px;
  opacity: 0.92;
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}
.login-card {
  background: #fff;
  border-radius: 22px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
}
.field {
  display: flex;
  align-items: center;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  margin-bottom: 12px;
  background: #f8fafc;
}
.field label {
  width: 48px;
  color: var(--muted);
  font-size: 14px;
}
.field input { flex: 1; font-size: 14px; }
.role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.role-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 13px;
}
.role-card.active { border-color: var(--primary); background: #eff6ff; }
.role-card .ri {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
}

.chart-box {
  height: 180px;
  position: relative;
  margin-top: 8px;
}
.chart-box canvas { width: 100% !important; height: 100% !important; }

.radar-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}
.goal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.goal-item:last-child { border-bottom: none; }
.goal-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.goal-body { flex: 1; min-width: 0; }
.goal-body .t { font-size: 13px; font-weight: 600; }
.goal-body .p { font-size: 11px; color: var(--muted); margin: 4px 0; }

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.plan-card {
  border-radius: 16px;
  padding: 12px;
  background: #eff6ff;
  min-height: 110px;
}
.plan-card.y { background: #fff7ed; }
.plan-card.g { background: #ecfdf5; }
.plan-card h4 { font-size: 13px; margin-bottom: 8px; }
.plan-card li {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  list-style: disc;
  margin-left: 14px;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.k-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.k-cover {
  height: 88px;
  background: linear-gradient(135deg, #bfdbfe, #fed7aa);
}
.k-cover.c2 { background: linear-gradient(135deg, #c4b5fd, #93c5fd); }
.k-cover.c3 { background: linear-gradient(135deg, #86efac, #67e8f9); }
.k-cover.c4 { background: linear-gradient(135deg, #fdba74, #f9a8d4); }
.k-body { padding: 10px; }
.k-body h4 { font-size: 13px; line-height: 1.4; margin-bottom: 6px; }
.k-body p { font-size: 11px; color: var(--muted); }

.toast {
  position: absolute;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15,23,42,0.88);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 50;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.static-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 30;
  background: rgba(15,23,42,0.55);
  color: #fff;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 999px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 13px;
}

.banner.line-youth {
  background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 40%, #fbcfe8 100%);
}
.banner.line-adult {
  background: linear-gradient(135deg, #5eead4 0%, #67e8f9 45%, #a5b4fc 100%);
}
.banner.line-special {
  background: linear-gradient(135deg, #fcd34d 0%, #86efac 45%, #7dd3fc 100%);
}

.step-list, .plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
}
.quote-bubble {
  background: #f0fdfa;
  border-left: 3px solid var(--teal, #14b8a6);
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
  font-size: 13px;
  color: #0f766e;
  margin-bottom: 8px;
}
.timeline {
  position: relative;
  padding: 8px 0 20px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(#93c5fd, #86efac);
  transform: translateX(-50%);
}
.tl-item {
  position: relative;
  width: 50%;
  padding: 0 14px 22px;
  box-sizing: border-box;
}
.tl-item.left { margin-right: 50%; text-align: right; }
.tl-item.right { margin-left: 50%; text-align: left; }
.tl-dot {
  position: absolute;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #93c5fd;
}
.tl-item.left .tl-dot { right: -7px; }
.tl-item.right .tl-dot { left: -7px; }
.tl-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: inline-block;
  text-align: left;
  max-width: 100%;
}
.tl-date { font-size: 11px; color: var(--muted); }
.tl-title { font-size: 14px; font-weight: 700; margin: 4px 0; }
.tl-note { font-size: 12px; color: #475569; line-height: 1.5; }

.sleep-hero .sleep-times {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 12px;
  text-align: center;
}
.sleep-hero .label { font-size: 12px; color: var(--muted); }
.sleep-hero .value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.sleep-moon { font-size: 28px; }
.sleep-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.note-area {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-illu {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.empty-state h3 { font-size: 17px; margin-bottom: 8px; }
.empty-state p { font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }

.focus-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.focus-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.focus-card .case-avatar { margin: 0 auto 8px; }
.focus-card .name { font-size: 13px; font-weight: 600; }
.focus-card .desc { font-size: 11px; color: var(--muted); margin: 4px 0 8px; }

.btn-teal {
  background: linear-gradient(90deg, #2dd4bf, #14b8a6);
  color: #fff;
  box-shadow: 0 8px 16px rgba(20, 184, 166, 0.25);
}

.adult-profile .risk-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d1fae5;
  color: #059669;
  display: grid;
  place-items: center;
  margin-left: auto;
  margin-top: 8px;
}

.menu-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-top: 12px;
}
.menu-tiles .tile {
  background: #fff;
  border-radius: 12px;
  padding: 14px 12px;
  text-align: left;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-left: 4px solid var(--teal);
}
.menu-tiles .tile.wide {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gauge-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.gauge {
  background: #fff;
  border-radius: 14px;
  padding: 12px 6px;
  text-align: center;
  box-shadow: var(--shadow);
}
.gauge b {
  display: block;
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 4px;
}
.gauge span { font-size: 11px; color: var(--muted); }

.ai-box {
  background: #ecfdf5 !important;
  color: #065f46;
  font-size: 13px;
  line-height: 1.7;
}

.quiz-opts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.quiz-opts .opt {
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: 12px;
  cursor: pointer;
}
.quiz-opts .opt.active {
  background: #ecfdf5;
  border-color: #5eead4;
  color: #0f766e;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.f {
  margin-bottom: 10px;
}
.f label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.f input {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 0 10px;
  font-size: 14px;
}

.bottom-nav.adult-theme {
  grid-template-columns: repeat(4, 1fr);
}

.seg-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.seg {
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.seg.on {
  background: linear-gradient(90deg, #2dd4bf, #34d399);
  color: #fff;
  border-color: transparent;
}
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.filter-row .chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.filter-row .chip.on {
  background: #ecfeff;
  color: #0f766e;
  border-color: #99f6e4;
  font-weight: 600;
}
.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: 70px;
}
.case-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.case-card .cc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.case-card .name { font-weight: 700; font-size: 14px; }
.batch-bar {
  position: sticky;
  bottom: 70px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 8px;
}
.batch-bar .btn { height: 42px; font-size: 13px; }
.fb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fb {
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #eff6ff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.fb:nth-child(2) { background: #fff7ed; }
.fb:nth-child(3) { background: #ecfeff; }
.fb:nth-child(4) { background: #ecfdf5; }
.fb.on { outline: 2px solid #2dd4bf; }
.chat-box { max-height: 55vh; overflow-y: auto; }
.chat-item { margin-bottom: 12px; }
.chat-item.me { text-align: right; }
.chat-meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.chat-bubble {
  display: inline-block;
  max-width: 85%;
  text-align: left;
  background: #eff6ff;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
}
.chat-item.me .chat-bubble { background: #ecfdf5; }
.chat-input {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  position: sticky;
  bottom: 0;
}
.chat-input input {
  flex: 1;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: #fff;
}
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  display: inline-block;
}
.switch input { display: none; }
.switch i {
  position: absolute; inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: .2s;
}
.switch i::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: .2s;
}
.switch input:checked + i { background: #2dd4bf; }
.switch input:checked + i::after { left: 21px; }
#app.night {
  filter: saturate(0.75) brightness(0.92);
}

.role-tip {
  margin-top: 10px;
  font-size: 12px;
  color: #1d4ed8;
  background: rgba(255,255,255,.75);
  border-radius: 999px;
  padding: 6px 12px;
  display: none;
}
  position: absolute;
  top: 6px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  display: none;
}
.search { cursor: pointer; }
.search-box {
  margin-bottom: 10px;
}
.search-box input {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 16px;
  box-shadow: var(--shadow);
  font-size: 14px;
}
.msg-card.unread {
  border: 1px solid #bfdbfe;
  background: #f8fbff;
}
.academy-path {
  margin-top: 16px;
  position: relative;
  padding-left: 8px;
}
.academy-path::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, #2dd4bf, #60a5fa, #fdba74);
}
.academy-node {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  position: relative;
}
.academy-node .node-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #2dd4bf;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
  z-index: 1;
  flex-shrink: 0;
}
.academy-node.blue .node-dot { border-color: #3b82f6; color: #1d4ed8; }
.academy-node.orange .node-dot { border-color: #fb923c; color: #c2410c; }
.academy-card { flex: 1; }
.academy-card .ac-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 14px;
}
.academy-card ul {
  padding-left: 16px;
}
.academy-card li {
  list-style: disc;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.privacy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}
.privacy-grid .pg {
  background: #eff6ff;
  border-radius: 12px;
  padding: 12px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin: 10px 0;
  color: #334155;
}
.prep-avatar {
  width: 72px;
  height: 72px;
  margin: 12px auto;
  border-radius: 18px;
  background: #dbeafe;
  display: grid;
  place-items: center;
  font-size: 34px;
}
.prep-item {
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
}
.prep-item.y { background: #fff7ed; color: #9a3412; }
.prep-item.g { background: #ecfdf5; color: #065f46; }
.mood-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.mood {
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 18px;
  cursor: pointer;
}
.mood span { font-size: 10px; color: var(--muted); }
.mood.active { background: #ecfdf5; border-color: #5eead4; }
.relax-screen {
  height: 100%;
  background:
    radial-gradient(circle at 50% 20%, rgba(125,211,252,.35), transparent 40%),
    linear-gradient(180deg, #0c4a6e 0%, #082f49 45%, #022c22 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.relax-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 2;
}
.relax-timer {
  font-size: 28px;
  font-weight: 700;
  text-shadow: 0 0 18px rgba(251,146,60,.45);
}
.relax-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 2;
}
.jelly {
  width: 120px;
  height: 120px;
  border-radius: 50% 50% 42% 42%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.85), rgba(125,211,252,.2) 55%, transparent 70%);
  box-shadow: 0 0 40px rgba(56,189,248,.35);
  margin-bottom: 18px;
  animation: floaty 3s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.relax-mid p { margin-bottom: 14px; opacity: .9; }
.relax-bar {
  width: 70%;
  height: 4px;
  background: rgba(255,255,255,.25);
  border-radius: 99px;
  overflow: hidden;
}
.relax-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #fdba74, #67e8f9);
}
.relax-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  z-index: 2;
  margin-bottom: 8px;
}
.relax-actions button {
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  border-radius: 16px;
  padding: 14px 8px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.relax-actions button span { font-size: 18px; }

@media (min-width: 768px) {
  body { background: #cbd5e1; }
}
