/* ===== v9.3 家长端 ===== */
#parentApp {
  --p-bg: #f4f7fb;
  --p-card: #ffffff;
  --p-primary: #0f766e;
  --p-primary-dark: #115e59;
  --p-primary-soft: #ccfbf1;
  --p-blue: #2563eb;
  --p-blue-soft: #dbeafe;
  --p-warn: #b45309;
  --p-warn-soft: #fef3c7;
  --p-danger: #b91c1c;
  --p-danger-soft: #fee2e2;
  --p-text: #0f172a;
  --p-muted: #64748b;
  --p-border: #e2e8f0;
  min-height: 100vh;
  background: var(--p-bg);
  color: var(--p-text);
  padding-bottom: 88px;
}

.p-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: #ecfeff;
  padding: 18px 18px 16px;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 10px 28px rgba(15, 118, 110, .22);
}
.p-top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.p-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.p-brand img { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; background: #fff; }
.p-brand b { display: block; font-size: 17px; line-height: 1.2; }
.p-brand span { display: block; font-size: 12px; opacity: .82; margin-top: 2px; }
.p-icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12); color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.p-icon-btn svg { width: 20px; height: 20px; }
.p-greeting { margin-top: 18px; }
.p-greeting h1 { font-size: 23px; line-height: 1.25; margin: 0 0 4px; }
.p-greeting p { margin: 0; font-size: 13px; opacity: .86; }

.p-content { max-width: 720px; margin: 0 auto; padding: 16px 14px 0; }
.p-section { margin-bottom: 16px; }
.p-section-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 10px; }
.p-section-head h2 { font-size: 16px; margin: 0; }
.p-section-head button { border: none; background: transparent; color: var(--p-primary); font-size: 13px; padding: 4px; }

.p-child-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.p-child-scroll::-webkit-scrollbar { display: none; }
.p-child-chip {
  flex: 0 0 auto; min-width: 104px; border: 1px solid var(--p-border); background: #fff; color: var(--p-text);
  border-radius: 16px; padding: 11px 12px; display: flex; align-items: center; gap: 9px; text-align: left;
}
.p-child-chip.active { border-color: var(--p-primary); background: var(--p-primary-soft); color: var(--p-primary-dark); }
.p-child-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #e0f2fe; color: #0369a1;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0;
}
.p-child-chip.active .p-child-avatar { background: #fff; }
.p-child-chip b { display: block; font-size: 14px; line-height: 1.2; }
.p-child-chip span { display: block; font-size: 11px; color: var(--p-muted); margin-top: 2px; }

.p-card {
  background: var(--p-card); border: 1px solid rgba(226,232,240,.85); border-radius: 18px;
  padding: 16px; box-shadow: 0 8px 22px rgba(15,23,42,.055);
}
.p-hero { color: #ecfeff; border: none; background: linear-gradient(145deg, #0f766e, #164e63); box-shadow: 0 14px 30px rgba(15,118,110,.22); }
.p-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.p-hero-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.p-hero-avatar {
  width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800;
}
.p-hero-title b { display: block; font-size: 19px; }
.p-hero-title span { display: block; font-size: 12px; opacity: .84; margin-top: 2px; }
.p-hero-status { border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.14); color: #fff; border-radius: 999px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.p-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.p-metric { background: rgba(255,255,255,.12); border-radius: 14px; padding: 12px 10px; text-align: center; }
.p-metric b { display: block; font-size: 21px; line-height: 1.1; }
.p-metric span { display: block; font-size: 11px; opacity: .82; margin-top: 5px; }

.p-quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.p-quick-btn {
  min-height: 62px; border: 1px solid var(--p-border); background: #fff; border-radius: 16px; padding: 12px;
  display: flex; align-items: center; gap: 10px; color: var(--p-text); text-align: left;
}
.p-quick-btn svg { width: 22px; height: 22px; color: var(--p-primary); flex-shrink: 0; }
.p-quick-btn b { display: block; font-size: 14px; }
.p-quick-btn span { display: block; font-size: 11px; color: var(--p-muted); margin-top: 2px; }

.p-notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid #f1f5f9; }
.p-notice:last-child { border-bottom: none; padding-bottom: 0; }
.p-notice:first-child { padding-top: 0; }
.p-notice-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; }
.p-notice.warn .p-notice-dot { background: var(--p-warn); }
.p-notice.danger .p-notice-dot { background: var(--p-danger); }
.p-notice.info .p-notice-dot { background: var(--p-blue); }
.p-notice b { display: block; font-size: 13px; }
.p-notice span { display: block; font-size: 12px; color: var(--p-muted); margin-top: 2px; }

.p-class-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.p-class-item:last-child { border-bottom: none; }
.p-date-badge {
  width: 54px; height: 54px; border-radius: 15px; background: var(--p-primary-soft); color: var(--p-primary-dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
}
.p-date-badge b { font-size: 16px; line-height: 1; }
.p-date-badge span { font-size: 10px; margin-top: 3px; }
.p-class-main { flex: 1; min-width: 0; }
.p-class-main b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-class-main span { display: block; font-size: 12px; color: var(--p-muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-time { font-size: 13px; color: var(--p-primary); font-weight: 700; white-space: nowrap; }

.p-tabs { display: flex; gap: 6px; background: #e2e8f0; border-radius: 13px; padding: 4px; margin-bottom: 12px; overflow-x: auto; }
.p-tab { flex: 1; min-width: 76px; border: none; background: transparent; border-radius: 10px; padding: 9px 8px; color: var(--p-muted); font-size: 13px; }
.p-tab.active { background: #fff; color: var(--p-primary); font-weight: 700; box-shadow: 0 2px 8px rgba(15,23,42,.08); }
.p-record { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f1f5f9; }
.p-record:last-child { border-bottom: none; }
.p-record-icon {
  width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.p-record-icon svg { width: 19px; height: 19px; }
.p-record-icon.teal { background: var(--p-primary-soft); color: var(--p-primary-dark); }
.p-record-icon.blue { background: var(--p-blue-soft); color: var(--p-blue); }
.p-record-icon.gold { background: var(--p-warn-soft); color: var(--p-warn); }
.p-record-main { flex: 1; min-width: 0; }
.p-record-main b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-record-main span { display: block; font-size: 11px; color: var(--p-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-record-amount { font-size: 14px; font-weight: 800; color: var(--p-warn); white-space: nowrap; }

.p-info-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f1f5f9; }
.p-info-row:last-child { border-bottom: none; }
.p-info-row span { color: var(--p-muted); font-size: 13px; }
.p-info-row b { font-size: 13px; text-align: right; }
.p-menu-btn { width: 100%; border: 1px solid var(--p-border); background: #fff; border-radius: 15px; padding: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 11px; color: var(--p-text); text-align: left; }
.p-menu-btn svg { width: 20px; height: 20px; color: var(--p-primary); }
.p-menu-btn.danger svg { color: var(--p-danger); }

.p-bottom-nav {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 720px;
  background: rgba(255,255,255,.96); border-top: 1px solid var(--p-border); display: grid; grid-template-columns: repeat(4,1fr);
  z-index: 40; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.p-nav-item { border: none; background: transparent; color: var(--p-muted); border-radius: 13px; padding: 7px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; }
.p-nav-item svg { width: 21px; height: 21px; }
.p-nav-item.active { color: var(--p-primary); background: var(--p-primary-soft); font-weight: 700; }

.p-empty { text-align: center; color: var(--p-muted); padding: 42px 20px; }
.p-empty svg { width: 48px; height: 48px; margin-bottom: 10px; opacity: .55; }
.p-empty b { display: block; font-size: 14px; }
.p-empty span { display: block; font-size: 12px; margin-top: 5px; }

@media (min-width: 640px) {
  .p-topbar { padding: 20px 22px 18px; }
  .p-content { padding-top: 20px; }
  .p-quick-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== v9.6.2 新增：通知红点与「全部」链接按钮 ===== */
.p-icon-btn { position: relative; }
.p-badge {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9);
}
.p-link-btn {
  border: none; background: transparent; color: var(--p-primary);
  font-size: 13px; cursor: pointer; padding: 4px 6px; border-radius: 8px;
}
.p-link-btn:active { background: var(--p-primary-soft); }
