/* ─── 本地字体（App 化：不依赖 Google Fonts CDN）───
   Cormorant Garamond 是可变字重字体，一个文件覆盖 400–700，
   只留 latin / latin-ext 两个子集（共约 71KB）。

   中文（Noto Sans SC）刻意「不」打包：Android 系统内置 Noto Sans CJK SC，
   iOS 内置 PingFang SC，直接落到系统字体即可 —— 打包 Noto Sans SC 全字重
   要多背 6MB+，视觉上却几乎看不出差别。
   ────────────────────────────────────────────── */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/cormorant-garamond-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/cormorant-garamond-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ─── Design Tokens ─── */
:root {
  --blush:        #F0F7FF;
  --card:         #FFFFFF;
  --plum:         #0369A1;
  --plum-mid:     #0284C7;
  --plum-lt:      #E0F2FE;
  --champagne:    #D97706;
  --champ-lt:     #FEF3C7;
  --champ-glow:   rgba(245, 158, 11, 0.16);
  --rose:         #F43F5E;
  --sage:         #10B981;
  --text:         #0F172A;
  --text-mid:     #334155;
  --text-muted:   #64748B;
  --shadow:       0 6px 24px rgba(2, 132, 199, 0.08);
  --shadow-sm:    0 2px 12px rgba(2, 132, 199, 0.05);
  --radius:       20px;

  /* 中文字体栈：先用系统内置 CJK（Android=Noto Sans CJK SC，iOS=PingFang SC），
     'Noto Sans SC' 留在最前面只是为了照顾本机装了该字体的桌面浏览器。 */
  --font-cjk: 'Noto Sans SC', 'Noto Sans CJK SC', -apple-system, BlinkMacSystemFont,
              'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Source Han Sans SC', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-cjk);
  background: var(--blush);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ─── Loading Screen ─── */
#loading-screen {
  position: fixed; inset: 0;
  background: linear-gradient(155deg, var(--plum) 0%, #4A1848 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}

.loader-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: white;
}

.loader-logo { font-size: 52px; animation: pulse 2s ease-in-out infinite; }
.loader-brand { font-size: 18px; font-weight: 900; color: var(--champ-lt); letter-spacing: 0.04em; }
.loader-sub { font-size: 12px; color: rgba(237,216,160,0.5); margin-bottom: 8px; }

.loader-spinner {
  width: 28px; height: 28px;
  border: 2.5px solid rgba(237,216,160,0.2);
  border-top-color: var(--champagne);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ─── Login Screen ─── */
#login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(155deg, var(--plum) 0%, #4A1848 60%, #3A0C3E 100%);
}

.login-card {
  background: white;
  border-radius: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 32px 64px rgba(0,0,0,0.35);
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 纯垂直上滑。登录卡片 + ProfileView 三个弹窗都用它，那些元素靠 flex 居中，
   动画里【绝不能】带 translateX/-50%，否则开场会横着飞。
   ⚠️ 加新动画前先 grep 有没有同名的：@keyframes 同名是全局覆盖，不报错。 */
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

.login-header {
  background: linear-gradient(155deg, var(--plum), #4A1848);
  padding: 32px 28px 24px;
  text-align: center;
  position: relative;
}

.login-header::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 0%, rgba(192,152,56,0.18) 0%, transparent 65%);
  pointer-events: none;
}

.login-icon { font-size: 40px; margin-bottom: 10px; display: block; }

.login-header h1 {
  font-size: 20px; font-weight: 900;
  color: #FDF6FF; letter-spacing: 0.02em;
  position: relative; z-index: 1;
}

.login-header p {
  font-size: 11px; color: var(--champ-lt); opacity: 0.6;
  margin-top: 4px; letter-spacing: 0.08em;
  position: relative; z-index: 1;
}

.login-body { padding: 28px; display: flex; flex-direction: column; gap: 16px; }

.login-error {
  background: #fef2f2; border: 1px solid #fca5a5;
  color: #b91c1c; font-size: 13px; font-weight: 600;
  padding: 10px 14px; border-radius: 10px;
}

.form-field { display: flex; flex-direction: column; gap: 6px; }

.form-field label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-muted); text-transform: uppercase;
}

.form-field input {
  padding: 12px 14px;
  border: 1.5px solid var(--plum-lt);
  border-radius: 12px;
  font-size: 14px; font-weight: 600;
  font-family: var(--font-cjk);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--blush);
}

.form-field input:focus {
  border-color: var(--plum-mid);
  box-shadow: 0 0 0 3px rgba(92,40,96,0.10);
  background: white;
}

#login-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--plum), var(--plum-mid));
  color: white; font-weight: 900; font-size: 14px;
  border: none; border-radius: 12px;
  cursor: pointer; letter-spacing: 0.03em;
  box-shadow: 0 6px 20px rgba(42,14,46,0.25);
  transition: opacity 0.2s, transform 0.1s;
}

#login-btn:hover { opacity: 0.92; }
#login-btn:active { transform: scale(0.98); }
#login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.login-footer {
  padding: 16px 28px;
  font-size: 11px; color: var(--text-muted);
  text-align: center; border-top: 1px solid var(--plum-lt);
  background: #FBF5FF;
}

/* ─── Sibling Switcher Bar ─── */
#sibling-bar {
  background: var(--card);
  border-bottom: 1px solid var(--plum-lt);
  padding: 10px 16px;
  position: sticky;
  top: 74px;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(42,14,46,0.06);
}

#sibling-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#sibling-pills::-webkit-scrollbar { display: none; }

.sibling-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 8px;
  border-radius: 24px;
  border: 1.5px solid var(--plum-lt);
  background: white;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-cjk);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.sibling-pill:hover {
  border-color: var(--plum-mid);
  transform: translateY(-1px);
}

.sibling-pill.active {
  background: linear-gradient(135deg, var(--plum), #4A1848);
  border-color: var(--plum);
  color: var(--champ-lt);
  box-shadow: 0 4px 12px rgba(42,14,46,0.22);
}

.pill-check {
  font-size: 10px;
  font-weight: 900;
  color: var(--champ-lt);
  margin-left: 1px;
}

.pill-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--plum-lt);
  color: var(--plum-mid);
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 中文名末字：方块字比拉丁字母占位大，缩一号并收紧字距才不顶到圆边 */
.pill-avatar.is-zh {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.sibling-pill.active .pill-avatar {
  background: rgba(255,255,255,0.15);
  color: var(--champ-lt);
}

/* ─── Child Dropdown Menu ─── */
.child-dropdown-arrow {
  font-size: 12px;
  color: var(--champ-lt);
  transition: transform 0.25s ease;
  display: inline-block;
}

.child-dropdown-menu {
  position: absolute;
  top: 70px;
  left: 16px;
  width: 260px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(42,14,46,0.22);
  border: 1px solid rgba(92,40,96,0.12);
  padding: 14px;
  z-index: 1000;
  animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.child-dropdown-header {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  padding-left: 4px;
}

.child-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.child-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #F1F5F9;
  background: #F8FAFC;
  cursor: pointer;
  transition: all 0.18s;
}

.child-dropdown-item:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

.child-dropdown-item.active {
  background: #FDF4FF;
  border-color: #F0ABFC;
}

.dropdown-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--plum);
  color: var(--champ-lt);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-avatar.is-zh {
  font-size: 15px;
  font-weight: 700;
}

.dropdown-info {
  flex: 1;
  min-width: 0;
}

.dropdown-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-active-badge {
  font-size: 9px;
  font-weight: 800;
  background: #FAE8FF;
  color: #C026D3;
  padding: 1px 6px;
  border-radius: 8px;
}

.dropdown-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-check {
  font-size: 13px;
  font-weight: 900;
  color: #C026D3;
}

/* ─── Main App ─── */
#parent-app {
  max-width: 500px; margin: 0 auto;
  min-height: 100vh; position: relative;
  padding-bottom: 88px;
}

/* ─── Header ─── */
.top-bar {
  background: linear-gradient(135deg, #240C28 0%, #3D1342 50%, #541B59 100%);
  /* 顶部安全区：底部导航早就写了 safe-area-inset-bottom，顶栏一直没配。
     没开 viewport-fit=cover 时 env() 返回 0，所以加了也不影响现有网页版；
     将来 App 走 edge-to-edge 时顶栏才不会被状态栏压住。 */
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 14px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 6px 24px rgba(36, 12, 40, 0.35);
  border-bottom: 1px solid rgba(245, 232, 200, 0.12);
}

.top-bar::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 85% 0%, rgba(245, 232, 200, 0.15) 0%, transparent 65%);
  pointer-events: none;
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative; z-index: 1;
}

/* 第 1 层：校区徽标 (左) + 快捷微工具 (右) */
.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.center-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(245, 232, 200, 0.15);
  border-radius: 20px;
  padding: 3px 10px 3px 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--champ-lt);
  letter-spacing: 0.03em;
  backdrop-filter: blur(6px);
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.top-util-btn {
  height: 28px;
  min-width: 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--champ-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  box-sizing: border-box;
  padding: 0 8px;
  margin: 0;
  font-size: 11px;
  font-weight: 800;
}

/* 身份切换按钮：老师兼家长专用，文字比图标按钮宽，用琥珀色跟其他工具键区分 */
.top-util-btn.mode-switch-btn {
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: rgba(245, 232, 200, 0.18);
  border-color: rgba(245, 232, 200, 0.35);
}

.top-util-btn.lang-btn {
  padding: 0;
  width: 28px;
  border-radius: 50%;
}

.top-util-btn.noti-btn {
  padding: 0;
  width: 28px;
  border-radius: 50%;
}

.top-util-btn.logout-btn {
  padding: 0;
  width: 28px;
  border-radius: 50%;
  color: #FDA4AF;
}

.top-util-btn:active {
  transform: scale(0.90);
  background: rgba(255, 255, 255, 0.25);
}

/* 第 2 层：学员名片 (左) + 档案按钮 (右) */
.header-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 8px 12px 8px 8px;
  backdrop-filter: blur(8px);
}

.child-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}

.avatar-ring {
  width: 44px; height: 44px; border-radius: 50%;
  overflow: hidden; border: 2px solid var(--champagne);
  box-shadow: 0 0 0 3px rgba(192, 152, 56, 0.22);
  flex-shrink: 0;
  background: linear-gradient(135deg, #5C2860, #2A0E2E);
  display: flex; align-items: center; justify-content: center;
}

.avatar-initial {
  font-family: var(--font-cjk);
  font-size: 19px; font-weight: 800;
  color: var(--champ-lt);
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

.child-text {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.child-greet {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--champ-lt);
  opacity: 0.80;
  line-height: 1;
}

.child-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.child-name {
  font-size: 16.5px;
  font-weight: 900;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.enroll-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}

.enroll-badge.status-active {
  background: rgba(46, 122, 96, 0.35);
  border: 1px solid #34D399;
  color: #A7F3D0;
}

.child-dropdown-arrow {
  color: var(--champ-lt);
  font-size: 12px;
  font-weight: 900;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
  opacity: 0.85;
}

.header-profile-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 20px;
  padding: 6px 12px;
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  backdrop-filter: blur(6px);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.header-profile-btn:hover {
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.header-profile-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.28);
}

/* ─── Pages ─── */
.content { padding: 16px; }

.page { display: none; }
.page.active { display: block; }

.page-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 0;
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--plum-lt);
  border-top-color: var(--plum-mid);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ─── Cards ─── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

/* ─── Profile Tab ─── */
.profile-hero {
  background: linear-gradient(135deg, #2A0E2E 0%, #48154F 60%, #602268 100%);
  border-radius: var(--radius);
  padding: 32px 24px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-bottom: 14px;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 28px rgba(42, 14, 46, 0.25);
  border: 1px solid rgba(245, 232, 200, 0.15);
}

.profile-hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 0%, rgba(254, 243, 199, 0.20) 0%, transparent 65%);
  pointer-events: none;
}

.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 2.5px solid var(--champagne);
  box-shadow: 0 0 0 4px rgba(192,152,56,0.18);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 700;
  color: var(--champ-lt);
  position: relative; z-index: 1;
}

.profile-name {
  font-size: 22px; font-weight: 900; color: #FDF6FF;
  letter-spacing: 0.02em;
  position: relative; z-index: 1;
}

.profile-name-zh {
  font-size: 16px; font-weight: 700; color: var(--champ-lt); opacity: 0.85;
  position: relative; z-index: 1;
}

.profile-badges {
  display: flex; gap: 8px; align-items: center;
  position: relative; z-index: 1;
}

.enroll-badge {
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
}

.status-active  { background: rgba(46,122,96,0.3);  color: #7ED4B0; }
.status-warn    { background: rgba(200,60,88,0.3);   color: #F4A0B0; }
.status-muted   { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.5); }

.vip-badge {
  display: flex; align-items: center; gap: 8px;
  background: rgba(192,152,56,0.18); border: 1px solid rgba(192,152,56,0.30);
  border-radius: 20px; padding: 5px 14px;
  font-size: 11px; font-weight: 700; color: var(--champ-lt);
  position: relative; z-index: 1;
}

.vip-expiry { opacity: 0.65; font-weight: 500; }

.regular-badge {
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.4);
  position: relative; z-index: 1;
}

/* Info Card */
.info-card { padding: 4px 0; }

.info-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid #F5EEF8;
}

.info-row:last-child { border-bottom: none; }

.info-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.info-label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); width: 72px; flex-shrink: 0; }
.info-value { font-size: 13.5px; font-weight: 600; color: var(--text); flex: 1; }

/* ─── Monthly Fee Calendar (学费目录) ─── */
.fee-cal-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px 20px;
  margin-bottom: 14px;
}

.fee-cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

.fee-cal-title {
  font-size: 14.5px; font-weight: 900; color: var(--plum);
  display: flex; align-items: center; gap: 6px;
}

.fee-cal-legend { display: flex; gap: 10px; }
.fee-legend-item { display: flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; color: var(--text-muted); }
.fee-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fee-legend-dot.paid   { background: var(--sage); }
.fee-legend-dot.unpaid { background: var(--rose); }

.fee-month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.fee-month-cell {
  border: 1.5px solid var(--plum-lt);
  border-radius: 12px;
  padding: 10px 6px 9px;
  text-align: center;
  background: #FBF7FC;
}

.fee-month-cell.future { opacity: 0.5; }

.fee-month-name {
  font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 5px;
}

.fee-month-status {
  font-size: 10.5px; font-weight: 800; line-height: 1.3;
}

.fee-month-amount {
  font-size: 10px; color: var(--text-muted); margin-top: 2px; font-weight: 600;
}

.fee-month-cell.paid {
  background: rgba(46,122,96,0.10);
  border-color: rgba(46,122,96,0.30);
}
.fee-month-cell.paid .fee-month-status { color: var(--sage); }

.fee-month-cell.unpaid {
  background: rgba(200,60,88,0.08);
  border-color: rgba(200,60,88,0.30);
}
.fee-month-cell.unpaid .fee-month-status { color: var(--rose); }

.fee-month-cell.none .fee-month-status { color: var(--text-muted); }

/* ─── Records Tab ─── */
.records-summary {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; align-items: stretch;
  margin-bottom: 14px;
  overflow: hidden;
}

.summary-cell {
  flex: 1; padding: 20px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}

.summary-divider { width: 1px; background: var(--plum-lt); margin: 16px 0; }

.summary-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  color: var(--text-muted); text-transform: uppercase;
}

.summary-amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 700;
}

.summary-amount.paid   { color: var(--sage); }
.summary-amount.unpaid { color: var(--rose); }

.filter-bar {
  display: flex; gap: 8px;
  margin-bottom: 14px;
}

.filter-btn {
  flex: 1;
  padding: 8px 0;
  border: 1.5px solid var(--plum-lt);
  border-radius: 50px;
  background: var(--card);
  color: var(--text-mid);
  font-size: 13px; font-weight: 700;
  font-family: var(--font-cjk);
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-btn.active {
  background: var(--plum-mid);
  border-color: var(--plum-mid);
  color: #fff;
  box-shadow: 0 3px 10px rgba(92,40,96,0.25);
}

.invoice-list { display: flex; flex-direction: column; gap: 10px; }

.invoice-row {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: stretch;
  overflow: hidden;
  animation: fadeUp 0.3s ease both;
  transition: all 0.25s ease;
  border: 1px solid rgba(42, 14, 46, 0.05);
}

.invoice-row.highlighted {
  border-color: var(--plum-mid);
  box-shadow: 0 0 0 4px rgba(92, 40, 96, 0.18), var(--shadow);
  transform: scale(1.02);
}

.inv-status-bar { width: 4px; flex-shrink: 0; }
.bar-paid   { background: var(--sage); }
.bar-unpaid { background: var(--rose); }
.bar-pending { background: #F59E0B; }

.inv-body { flex: 1; min-width: 0; padding: 13px 14px; display: flex; flex-direction: column; gap: 5px; }

.inv-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.inv-number {
  font-family: monospace; font-size: 11.5px; font-weight: 700;
  color: var(--text-muted); white-space: nowrap;
}

.inv-badge {
  font-size: 10.5px; font-weight: 800;
  padding: 3px 9px; border-radius: 12px;
  white-space: nowrap;
}

.badge-paid   { background: rgba(46,122,96,0.12);  color: var(--sage); }
.badge-unpaid { background: rgba(200,60,88,0.10);   color: var(--rose); }
.badge-pending { background: rgba(245,158,11,0.14); color: #B45309; border: 1px solid rgba(245,158,11,0.3); }

.inv-desc { font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.45; }

.inv-bottom {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; margin-top: 2px;
}

.inv-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.inv-amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 700; color: var(--champagne);
  white-space: nowrap; letter-spacing: 0.2px;
}

/* 操作按钮独占一行（靠右），避免窄屏时挤压卡片正文导致金额/徽章折行 */
.inv-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

.inv-view-btn {
  padding: 9px 18px;
  background: var(--plum-lt); color: var(--plum-mid);
  border: none; border-radius: 10px;
  font-size: 12px; font-weight: 800;
  cursor: pointer; white-space: nowrap;
  flex-shrink: 0;
}

.inv-view-btn.btn-pay {
  background: var(--rose); color: #fff;
  box-shadow: 0 3px 10px rgba(200,60,88,0.28);
}

.inv-view-btn.btn-pending {
  background: rgba(245,158,11,0.14); color: #B45309;
}

.inv-view-btn:active { background: #DDD0E8; }
.inv-view-btn.btn-pay:active { background: #A83048; }
.inv-view-btn.btn-pending:active { background: rgba(245,158,11,0.26); }

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 48px 0; color: var(--text-muted); font-size: 14px; font-weight: 600;
}

.empty-icon { font-size: 40px; opacity: 0.4; }

/* ─── Friendly empty-state card (no invoices at all) ─── */
.empty-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px 38px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: fadeUp 0.3s ease both;
}
.empty-card-icon {
  font-size: 40px;
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--plum-lt);
  margin-bottom: 4px;
}
.empty-card-title {
  font-size: 15px; font-weight: 900; color: var(--plum);
}
.empty-card-sub {
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  line-height: 1.55; max-width: 260px;
}

/* ─── "All settled" summary variant (invoices exist, nothing due) ─── */
.records-summary.all-clear {
  background: rgba(46,122,96,0.08);
  border: 1.5px solid rgba(46,122,96,0.22);
  box-shadow: none;
}
.records-summary.all-clear .summary-cell { padding: 16px 16px; gap: 3px; }
.all-clear-title {
  font-size: 16px; font-weight: 900; color: var(--sage);
}
.all-clear-sub {
  font-size: 11.5px; font-weight: 700; color: var(--text-muted);
}

/* ─── Bottom Nav ─── */
/* ─── Bottom Nav ─── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 500px;
  height: calc(72px + env(safe-area-inset-bottom, 0px));
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)) 4px;
  background: rgba(253, 248, 245, 0.96);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(92, 40, 96, 0.08);
  display: flex; justify-content: space-between; align-items: center;
  z-index: 200;
  box-shadow: 0 -4px 24px rgba(42,14,46,0.08);
  box-sizing: border-box;
}

.nav-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--text-muted); cursor: pointer;
  background: none; border: none;
  padding: 6px 1px;
  position: relative;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 12px;
  user-select: none;
}

.nav-item:active { transform: scale(0.92); }
.nav-item.active { color: var(--plum); }

.nav-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fay-nav-sticker {
  width: 24px;
  height: 24px;
  display: block;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.active .fay-nav-sticker {
  transform: scale(1.15) translateY(-2px);
}

.nav-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
  transition: all 0.2s;
}

.nav-item.active .nav-label {
  font-weight: 900;
  color: var(--plum);
}

.nav-indicator {
  position: absolute; bottom: 1px; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 18px; height: 3px;
  background: var(--plum); border-radius: 3px;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.active .nav-indicator { transform: translateX(-50%) scaleX(1); }

/* ─── Animations ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Calendar ─── */
.calendar-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 16px 24px;
  margin: 0 0 16px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--plum);
}

.cal-nav-btn {
  background: var(--plum-lt);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  color: var(--plum);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cal-nav-btn:active { opacity: 0.7; }

.calendar-grid-weekdays,
.calendar-grid-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-grid-weekdays {
  margin-bottom: 6px;
}

.calendar-grid-weekdays > div {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}

.cal-day {
  text-align: center;
  padding: 5px 2px 4px 2px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  background: #ffffff;
  border: 1px solid rgba(42, 14, 46, 0.06);
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative !important;
  user-select: none;
}

.cal-day:hover {
  background: #FFFBF8;
  border-color: var(--plum-mid);
}

.cal-day:active { transform: scale(0.96); }
.cal-day.empty  { 
  cursor: default; 
  background: transparent; 
  border-color: transparent; 
}

.cal-day.has-class {
  background: rgba(107, 43, 86, 0.04);
  border: 1px dashed rgba(107, 43, 86, 0.22);
}

.cal-day.today {
  border: 1.5px solid var(--champagne);
  background: rgba(192, 152, 56, 0.08);
}
.cal-day.today .day-num-text {
  background: var(--champagne);
  color: #fff;
  padding: 1px 5px;
  border-radius: 6px;
  font-weight: 800;
}

.cal-day.selected-day {
  border: 1.5px solid var(--plum);
  background: rgba(42, 14, 46, 0.08);
  box-shadow: 0 4px 12px rgba(42, 14, 46, 0.12);
}
.cal-day.selected-day .day-num-text {
  background: var(--plum);
  color: #fff;
  padding: 1px 5px;
  border-radius: 6px;
  font-weight: 800;
}

.day-num-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mid);
  line-height: 1.2;
  margin-bottom: 2px;
}

/* ─── SVG Stickers & Slots ─── */
.cal-sticker-slot {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
}

.cal-empty-slot {
  flex: 1;
  width: 100%;
}

.fay-sticker {
  width: 28px;
  height: 28px;
  display: block;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cal-day:hover .fay-sticker,
.cal-day:active .fay-sticker {
  transform: scale(1.22) rotate(0deg) !important;
}

.rot-1 { transform: rotate(-6deg); }
.rot-2 { transform: rotate(5deg); }
.rot-3 { transform: rotate(-3deg); }
.rot-4 { transform: rotate(4deg); }
.sticker-class-subtle { opacity: 0.72; transform: scale(0.88); }

.detail-sticker-badge {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-sticker-badge .fay-sticker {
  width: 40px;
  height: 40px;
}

/* ─── Malaysia Public Holidays (auto) ─── */
.cal-day.public-holiday {
  background: rgba(200, 60, 88, 0.05);
}
.cal-day.public-holiday .day-num-text { color: var(--rose); }
.cal-day.today.public-holiday .day-num-text,
.cal-day.selected-day.public-holiday .day-num-text { color: #fff; }

.cal-holiday-flag {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 8px;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
}

/* day detail */
.schedule-list-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--plum);
  margin: 16px 0 10px;
}

.schedule-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--plum-lt);
  border-radius: 14px;
  padding: 14px 16px;
}

.schedule-time-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
}

.schedule-date-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--plum);
  line-height: 1;
}

.schedule-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schedule-class-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--plum);
}

.schedule-time-range {
  font-size: 13px;
  color: var(--text-mid);
}

/* ─── Notification System Styles ─── */
.noti-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--rose);
  color: white;
  font-size: 10px;
  font-weight: 900;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(200,60,88,0.4);
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.noti-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.noti-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.noti-drawer {
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--blush);
  box-shadow: -10px 0 40px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  /* 整屏高的面板，App 走 edge-to-edge 后顶部会被状态栏压住、
     底部被手势条盖住，所以两头都要让开安全区。 */
  padding: calc(20px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
}

.noti-overlay:not(.hidden) .noti-drawer {
  transform: translateX(0);
}

.noti-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1.5px solid var(--plum-lt);
  padding-bottom: 12px;
}

.noti-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.noti-drawer-title h2 {
  font-size: 18px;
  font-weight: 900;
  color: var(--plum);
}

.noti-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.noti-clear-btn:hover {
  background: var(--plum-lt);
}

.noti-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.noti-close-btn:hover {
  color: var(--plum);
}

.noti-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.noti-filter-bar::-webkit-scrollbar {
  display: none;
}

.noti-filter-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--plum-lt);
  border-radius: 50px;
  background: var(--card);
  color: var(--text-mid);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.noti-filter-btn.active {
  background: var(--plum-mid);
  border-color: var(--plum-mid);
  color: white;
  box-shadow: var(--shadow-sm);
}

.noti-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.noti-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  border-left: 4px solid var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeUp 0.3s ease both;
}

.noti-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.noti-card.unread {
  background: rgba(92, 40, 96, 0.03);
}

.noti-card.unread::after {
  content: '';
  position: absolute;
  top: 14px;
  right: 14px;
  width: 6px;
  height: 6px;
  background: var(--rose);
  border-radius: 50%;
}

.noti-card.type-attendance { border-left-color: var(--sage); }
.noti-card.type-invoice { border-left-color: var(--rose); }
.noti-card.type-makeup { border-left-color: var(--champagne); }
.noti-card.type-holiday { border-left-color: var(--text-mid); }
.noti-card.type-announcement { border-left-color: var(--plum-mid); }

.noti-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.noti-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--plum);
  display: flex;
  align-items: center;
  gap: 6px;
}

.noti-card-time {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.noti-card-content {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.5;
  font-weight: 600;
  white-space: pre-wrap;
}

.noti-card-footer {
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px dashed rgba(92, 40, 96, 0.1);
  padding-top: 6px;
  margin-top: 2px;
}

/* Teacher Attendance View Styles */
.status-btn {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid #cbd5e1;
  background: white;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}
.status-btn.active.val-present { background: #e6fffa; border-color: #319795; color: #007766; }
.status-btn.active.val-late { background: #fffbeb; border-color: #fcd34d; color: #b45309; }
.status-btn.active.val-leave { background: #faf5ff; border-color: #d8b4fe; color: #6b21a8; }
.status-btn.active.val-absent { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* ─── Skeleton Screen Loader ─── */
.skeleton-box {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 37%, #F1F5F9 63%);
  background-size: 400% 100%;
  animation: skeletonLoading 1.4s ease infinite;
  border-radius: 12px;
}
@keyframes skeletonLoading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ─── Toast Notifications ─── */
.fay-toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10005;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.fay-toast {
  background: rgba(15, 23, 42, 0.90);
  color: white;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  animation: toastFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}
@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
  background: var(--plum-lt);
}

.noti-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.noti-close-btn:hover {
  color: var(--plum);
}

.noti-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.noti-filter-bar::-webkit-scrollbar {
  display: none;
}

.noti-filter-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--plum-lt);
  border-radius: 50px;
  background: var(--card);
  color: var(--text-mid);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.noti-filter-btn.active {
  background: var(--plum-mid);
  border-color: var(--plum-mid);
  color: white;
  box-shadow: var(--shadow-sm);
}

.noti-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.noti-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  border-left: 4px solid var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeUp 0.3s ease both;
}

.noti-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.noti-card.unread {
  background: rgba(92, 40, 96, 0.03);
}

.noti-card.unread::after {
  content: '';
  position: absolute;
  top: 14px;
  right: 14px;
  width: 6px;
  height: 6px;
  background: var(--rose);
  border-radius: 50%;
}

.noti-card.type-attendance { border-left-color: var(--sage); }
.noti-card.type-invoice { border-left-color: var(--rose); }
.noti-card.type-makeup { border-left-color: var(--champagne); }
.noti-card.type-holiday { border-left-color: var(--text-mid); }
.noti-card.type-announcement { border-left-color: var(--plum-mid); }

.noti-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.noti-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--plum);
  display: flex;
  align-items: center;
  gap: 6px;
}

.noti-card-time {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.noti-card-content {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.5;
  font-weight: 600;
  white-space: pre-wrap;
}

.noti-card-footer {
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px dashed rgba(92, 40, 96, 0.1);
  padding-top: 6px;
  margin-top: 2px;
}

/* Teacher Attendance View Styles */
.status-btn {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid #cbd5e1;
  background: white;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}
.status-btn.active.val-present { background: #e6fffa; border-color: #319795; color: #007766; }
.status-btn.active.val-late { background: #fffbeb; border-color: #fcd34d; color: #b45309; }
.status-btn.active.val-leave { background: #faf5ff; border-color: #d8b4fe; color: #6b21a8; }
.status-btn.active.val-absent { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* ─── Skeleton Screen Loader ─── */
.skeleton-box {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 37%, #F1F5F9 63%);
  background-size: 400% 100%;
  animation: skeletonLoading 1.4s ease infinite;
  border-radius: 12px;
}
@keyframes skeletonLoading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ─── Toast Notifications ─── */
.fay-toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10005;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.fay-toast {
  background: rgba(15, 23, 42, 0.90);
  color: white;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  animation: toastFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}
@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Records Subtabs ─── */
.records-subtabs {
  display: flex;
  gap: 6px;
  background: rgba(92, 40, 96, 0.08);
  padding: 4px;
  border-radius: 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(92, 40, 96, 0.10);
}

.records-subtab-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: inherit;
}

.records-subtab-btn.active {
  background: white;
  color: var(--plum);
  box-shadow: 0 3px 10px rgba(42, 14, 46, 0.12);
}

.records-subtab-btn:active {
  transform: scale(0.96);
}

/* ─── Filter Pills (Student Switchers) ─── */
.filter-pill {
  padding: 6px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--plum-lt);
  background: white;
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.filter-pill.active {
  background: var(--plum-mid);
  border-color: var(--plum-mid);
  color: white;
  box-shadow: 0 2px 8px rgba(92, 40, 96, 0.2);
}

.filter-pill:active {
  transform: scale(0.94);
}

/* ─── Sticky Bottom Batch Payment Bar ─── */
.batch-pay-bar {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 480px;
  background: var(--plum);
  color: white;
  padding: 12px 16px;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(42, 14, 46, 0.35);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 990;
  animation: slideUpCentered 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ⚠️ 这份必须叫 slideUpCentered，不能叫 slideUp。
   它带 translate(-50%) 是因为 .batch-pay-bar 用 left:50% 定位，要靠 -50% 拉回中间。
   同名 @keyframes 是【全局】的、后定义覆盖前定义 —— 曾经它叫 slideUp，
   把第 109 行那份纯垂直的覆盖掉，导致登录卡片和三个弹窗（档案 / 考级 / 准考证）
   开场时先偏左 190px 再弹回中间。家长实际反馈「登录画面从左边飞到中间」。 */
@keyframes slideUpCentered {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.batch-pay-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.batch-pay-count {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
}

.batch-pay-total {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 900;
  color: #FBBF24;
  line-height: 1;
}

.batch-pay-btn {
  padding: 10px 20px;
  background: var(--rose);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(200, 60, 88, 0.4);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.batch-pay-btn:active {
  transform: scale(0.95);
}

/* ─── Slip Upload & Pay Modal ─── */
.pay-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@media (min-width: 600px) {
  .pay-modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

.pay-modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

@media (min-width: 600px) {
  .pay-modal-card {
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  }
}

.copy-badge-btn {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-badge-btn:active {
  transform: scale(0.92);
  background: #DBEAFE;
}

/* ─── 离线横幅（App 化：断网时给家长明确反馈，而不是永远转圈）─── */
.fay-offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 7px) 14px 7px;
  background: #B45309;
  color: #FFF7ED;
  font-family: var(--font-cjk);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.fay-offline-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #FCD34D;
  flex: 0 0 auto;
  animation: fay-offline-pulse 1.4s ease-in-out infinite;
}
@keyframes fay-offline-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}
/* 横幅出现时把整个 App 往下推，避免盖住顶栏 / toast。
   ⚠️ 光加 padding 不够：.top-bar 和 #sibling-bar 是 sticky，
   sticky 的 top 是相对视口算的，不吃父元素的 padding —— 一滚动就钻到横幅底下。
   所以这三个偏移量必须一起改。--fay-offline-h 是横幅实际高度（约 33px，取 34 留余量）。 */
body.is-offline { --fay-offline-h: calc(env(safe-area-inset-top, 0px) + 34px); }
body.is-offline #parent-app,
body.is-offline #login-screen  { padding-top: var(--fay-offline-h); }
body.is-offline .top-bar       { top: var(--fay-offline-h); }
body.is-offline #sibling-bar   { top: calc(var(--fay-offline-h) + 74px); }
body.is-offline .fay-toast-container { top: calc(var(--fay-offline-h) + 24px); }
