/* ============================================================
   HappyHoliday - 暑假打卡系统 样式
   ============================================================ */

/* ---- 变量 ---- */
:root {
  --purple: #8B5CF6;
  --purple-dark: #7C3AED;
  --purple-light: #EDE9FE;
  --amber: #F59E0B;
  --amber-light: #FEF3C7;
  --green: #10B981;
  --green-light: #D1FAE5;
  --red: #EF4444;
  --red-light: #FEE2E2;
  --blue: #3B82F6;
  --blue-light: #DBEAFE;
  --pink: #EC4899;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --nav-height: 72px;
  --header-height: 56px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', '微软雅黑', 'PingFang SC', sans-serif;
  font-size: 15px;
  color: var(--gray-900);
  background: #EBEBEB;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 15px; }
img { max-width: 100%; }
textarea { resize: vertical; }

/* ---- 应用容器 ---- */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #FBF9FF;
  position: relative;
  overflow: hidden;
}

/* ---- Toast 通知 ---- */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(420px, 90vw);
}
.toast {
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-10px);
  transition: all .25s ease;
  pointer-events: auto;
}
.toast-in { opacity: 1; transform: translateY(0); }
.toast-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.toast-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.toast-info    { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ============================================================
   登录页
   ============================================================ */
.login-page {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: linear-gradient(135deg, #F5F0FF 0%, #FFF9F0 100%);
}
.login-hero { text-align: center; margin-bottom: 40px; }
.login-logo { font-size: 72px; margin-bottom: 16px; animation: bounce 2s infinite; }
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.login-title {
  font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, var(--purple-dark), var(--amber));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.login-subtitle { color: var(--gray-500); font-size: 15px; }
.login-form { width: 100%; max-width: 360px; }
.login-hint { text-align: center; font-size: 12px; color: var(--gray-500); margin-top: 16px; line-height: 1.6; }
.login-filing {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-500);
}
.login-filing a {
  color: inherit;
  text-decoration: none;
}
.login-filing a:hover {
  text-decoration: underline;
}

/* ============================================================
   通用组件
   ============================================================ */

/* 按钮 */
.btn-primary {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  color: white;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(124,58,237,.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.btn-large { width: 100%; padding: 16px; font-size: 16px; border-radius: var(--radius); }

.btn-success { background: var(--green); color: white; border-radius: var(--radius-xs); padding: 8px 16px; font-weight: 600; font-size: 14px; }
.btn-danger  { background: var(--red); color: white; border-radius: var(--radius-xs); padding: 8px 16px; font-weight: 600; font-size: 14px; }
.btn-outline {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xs);
  padding: 6px 14px;
  font-size: 13px;
  color: var(--gray-700);
  background: white;
}
.btn-sm { font-size: 13px; padding: 6px 12px; border-radius: var(--radius-xs); }
.btn-back {
  font-size: 14px; color: var(--purple); font-weight: 600;
  padding: 4px 0; background: none;
}
.btn-checkin {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  color: white; border-radius: 20px;
  padding: 8px 18px; font-size: 13px; font-weight: 600;
  white-space: nowrap; box-shadow: 0 2px 8px rgba(124,58,237,.25);
}
.btn-retry {
  background: linear-gradient(135deg, var(--amber), #F97316);
}
.btn-redeem {
  background: linear-gradient(135deg, var(--amber), #F97316);
  color: white; border-radius: 20px;
  padding: 8px 18px; font-size: 13px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(245,158,11,.3);
}

/* 标签 */
.tag { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tag-pending { background: var(--amber-light); color: #92400E; }
.tag-done    { background: var(--green-light); color: #065F46; }
.tag-locked  { background: var(--gray-100); color: var(--gray-500); }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--gray-700); margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); background: white;
  transition: border .2s;
  color: var(--gray-900);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139,92,246,.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); background: white;
  color: var(--gray-900);
  line-height: 1.6;
}
.form-textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139,92,246,.1); }
.form-checkboxes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.checkbox-label input { width: 18px; height: 18px; cursor: pointer; }
.char-count { text-align: right; font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* 页面头部 */
.page-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  background: white;
  position: sticky; top: 0; z-index: 10;
}
.page-header h2 { font-size: 18px; font-weight: 700; }
.page-header-simple {
  padding: 20px 20px 12px;
}
.page-header-simple h2 { font-size: 20px; font-weight: 800; }
.page-header-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.page-header-actions h2 { font-size: 18px; font-weight: 700; }

.section-title {
  font-size: 15px; font-weight: 700;
  color: var(--gray-700);
  padding: 16px 20px 8px;
}

/* 空状态 */
.empty-state {
  text-align: center; color: var(--gray-500);
  padding: 40px 20px; font-size: 15px; line-height: 1.8;
}
.error-state {
  text-align: center; color: var(--red);
  padding: 40px 20px;
}

/* ============================================================
   家庭孩子切换
   ============================================================ */
.parent-view-shell {
  padding-bottom: calc(var(--nav-height) + 16px);
}
.child-switcher {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
  overflow-x: auto;
}
.child-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.child-switcher-btn.active {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  color: white;
  border-color: transparent;
}
.child-switcher-avatar {
  font-size: 16px;
}
.parent-view-body {
  padding-top: 8px;
}

/* ============================================================
   底部导航栏
   ============================================================ */
.nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100vw);
  height: var(--nav-height);
  background: white;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: stretch;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  z-index: 100;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 8px 4px;
  font-size: 22px; color: var(--gray-500);
  transition: all .2s;
  border-radius: 0;
}
.nav-item span:last-child { font-size: 10px; font-weight: 600; }
.nav-item.active { color: var(--purple); }
.nav-item.active span:first-child { transform: scale(1.1); }

/* Scroll padding for nav bar */
.child-home, .points-page, .rewards-page, .album-page,
.calendar-page, .parent-dashboard, .tasks-page,
.review-page, .points-manager, .rewards-manager,
.stats-page, .report-page, .settings-page {
  padding-bottom: calc(var(--nav-height) + 16px);
}

/* ============================================================
   儿童端 - 首页
   ============================================================ */
.child-home { padding: 0 0 calc(var(--nav-height) + 16px); }

.home-header {
  background: linear-gradient(135deg, var(--purple-dark) 0%, #A78BFA 100%);
  padding: 20px 20px 28px;
  color: white;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.home-greeting { display: flex; align-items: center; gap: 12px; }
.home-header-right,
.dashboard-header-right {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.logout-btn {
  color: white;
  border: 1px solid rgba(255,255,255,.6);
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  transition: background .2s, transform .2s;
}
.logout-btn:hover {
  background: rgba(255,255,255,.24);
  transform: translateY(-1px);
}
.logout-btn:active {
  transform: translateY(0);
}
.user-avatar { font-size: 40px; }
.greeting-text { font-size: 18px; font-weight: 700; }
.date-text { font-size: 13px; opacity: .85; margin-top: 2px; }
.home-stats { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.stat-pill {
  background: rgba(255,255,255,.2);
  border-radius: 20px; padding: 5px 14px;
  font-size: 14px; font-weight: 700; color: white;
  backdrop-filter: blur(4px);
}

/* ============================================================
   超级管理员后台
   ============================================================ */
.admin-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-header h1 {
  margin: 0;
  font-size: 24px;
}

.admin-header p {
  margin: 6px 0 0;
  color: var(--gray-500);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-600);
  font-size: 14px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.admin-tab {
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--gray-700);
  font-weight: 600;
}

.admin-tab.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.admin-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.admin-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 14px;
}

.admin-card-label {
  color: var(--gray-500);
  font-size: 13px;
}

.admin-card-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
  color: #111827;
}

.admin-section {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 14px;
}

.admin-section h3 {
  margin: 0 0 12px;
}

.admin-inline-form,
.admin-user-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-inline-form {
  grid-template-columns: minmax(180px, 320px) auto;
}

.admin-user-form {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.admin-table-wrap {
  overflow: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
  padding: 10px 8px;
  font-size: 14px;
}

.admin-table th {
  color: var(--gray-500);
  font-weight: 700;
}

.admin-actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .admin-header {
    flex-direction: column;
  }

  .admin-inline-form {
    grid-template-columns: 1fr;
  }
}

.progress-section {
  background: white;
  margin: -12px 16px 0;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative; z-index: 1;
}
.progress-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--gray-700); }
.progress-bar { height: 10px; background: var(--gray-100); border-radius: 20px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--amber));
  border-radius: 20px;
  transition: width .6s ease;
}
.congrats-banner {
  margin-top: 10px; text-align: center;
  font-size: 14px; font-weight: 700;
  color: var(--purple);
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.6 } }

.task-list { padding: 8px 16px; display: flex; flex-direction: column; gap: 10px; }

.task-card {
  background: white;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--gray-200);
  transition: all .2s;
}
.task-card.status-todo { border-left-color: var(--gray-200); }
.task-card.status-submitted { border-left-color: var(--amber); background: #FFFDF5; }
.task-card.status-done { border-left-color: var(--green); background: #F0FDF8; }
.task-card.status-rejected { border-left-color: var(--red); background: #FFF5F5; }

.task-card-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.task-emoji { font-size: 28px; flex-shrink: 0; }
.task-info { min-width: 0; }
.task-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.task-meta { font-size: 12px; color: var(--gray-500); }
.task-card-right { flex-shrink: 0; margin-left: 12px; }

/* ============================================================
   打卡页
   ============================================================ */
.checkin-page { padding: 0 0 24px; }

.task-banner {
  margin: 16px 20px;
  padding: 16px;
  border-radius: var(--radius);
  border: 2px solid var(--purple);
  background: var(--purple-light);
  display: flex; gap: 14px; align-items: flex-start;
}
.task-banner-emoji { font-size: 36px; flex-shrink: 0; }
.task-banner-name { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.task-banner-desc { font-size: 13px; color: var(--gray-700); margin-bottom: 6px; line-height: 1.5; }
.task-banner-meta { font-size: 12px; color: var(--purple); font-weight: 600; }

.makeup-notice {
  margin: 0 20px 8px;
  padding: 8px 14px;
  background: var(--amber-light);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: #92400E;
}

#checkin-form { padding: 0 20px; }
.form-section { margin-bottom: 20px; }
.form-label { font-size: 14px; font-weight: 700; color: var(--gray-700); margin-bottom: 10px; }

/* 照片上传 */
.photo-upload-area {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border .2s;
  background: var(--gray-50);
}
.photo-upload-area:hover { border-color: var(--purple); background: var(--purple-light); }
.photo-upload-hint { font-size: 14px; color: var(--gray-500); margin-bottom: 12px; }
.photo-preview-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.photo-thumb { position: relative; width: 80px; height: 80px; border-radius: var(--radius-sm); overflow: hidden; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-remove {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,.6); color: white;
  border-radius: 50%; width: 20px; height: 20px;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
}

/* 心情选择 */
.mood-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.mood-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
  background: white;
  transition: all .15s;
  flex: 1; min-width: 56px;
}
.mood-btn.selected {
  border-color: var(--purple);
  background: var(--purple-light);
}
.mood-emoji { font-size: 24px; }
.mood-label { font-size: 11px; font-weight: 600; color: var(--gray-700); }

/* ============================================================
   日历页
   ============================================================ */
.calendar-page { padding: 0 0 calc(var(--nav-height) + 16px); }
.calendar-legend {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 20px;
  font-size: 12px; color: var(--gray-500);
  flex-wrap: wrap;
}
.calendar-toolbar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.calendar-picker-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}
.calendar-picker {
  min-width: 92px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--gray-200);
  background: white;
  font-size: 13px;
}
.calendar-picker:focus {
  outline: none;
  border-color: var(--purple);
}
.calendar-container { padding: 0 16px; }
.calendar-header-row, .calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
}
.cal-header {
  text-align: center; font-size: 12px; font-weight: 700;
  color: var(--gray-500); padding: 8px 0;
}
.cal-cell {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  border-radius: var(--radius-sm);
  cursor: pointer; transition: background .15s;
  position: relative;
}
.cal-cell:hover { background: var(--gray-100); }
.cal-cell.empty { cursor: default; }
.cal-cell.today { background: var(--purple-light); }
.cal-cell.today .cal-day { color: var(--purple-dark); font-weight: 800; }
.cal-cell.future { opacity: .45; }
.cal-cell.selected { background: var(--purple); }
.cal-cell.selected .cal-day { color: white; }
.cal-day { font-size: 14px; font-weight: 600; }
.cal-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.dot-full { background: var(--green); }
.dot-partial { background: var(--amber); }
.dot-none { background: var(--red); }
.cal-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--amber); color: white;
  border-radius: 50%; width: 16px; height: 16px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.calendar-detail {
  margin: 16px;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease, padding .3s;
}
.calendar-detail.visible {
  max-height: min(420px, calc(100vh - var(--nav-height) - 220px));
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
}
.cal-detail-content strong { display: block; font-size: 15px; margin-bottom: 12px; color: var(--purple); }
.cal-detail-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}
.cal-detail-row:last-child { border-bottom: none; }
.cal-detail-row-muted {
  color: var(--gray-400);
}
.cal-detail-note {
  margin-left: 4px;
  font-size: 12px;
  color: var(--gray-400);
}

.cal-detail-head {
  margin-bottom: 12px;
}
.cal-detail-summary {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
}
.cal-task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cal-task-item {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.cal-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}
.cal-task-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.cal-task-emoji {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.cal-task-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-task-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.cal-task-status {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.cal-task-status.status-pending { color: #92400E; }
.cal-task-status.status-done { color: #065F46; }
.cal-task-status.status-rejected { color: #B91C1C; }
.cal-task-status.status-todo { color: var(--gray-500); }

.cal-task-review-btn {
  min-width: 88px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(124,58,237,.24);
  background: #fff;
  color: var(--purple-dark);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.review-btn-arrow {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .2s ease;
}
.cal-task-review-btn.expanded {
  background: var(--purple-light);
}
.cal-task-review-btn.expanded .review-btn-arrow {
  transform: rotate(180deg);
}
.cal-task-review-btn.disabled {
  border-color: var(--gray-200);
  color: var(--gray-500);
  background: var(--gray-100);
  cursor: not-allowed;
}

.cal-review-panel {
  border-top: 1px dashed var(--gray-200);
  padding: 10px 12px 12px;
  background: #FCFAFF;
}
.cal-review-block + .cal-review-block {
  margin-top: 8px;
}
.cal-review-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 4px;
}
.cal-review-text {
  font-size: 13px;
  color: var(--gray-800);
  line-height: 1.6;
  word-break: break-word;
}
.cal-review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cal-review-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--purple-light);
  color: var(--purple-dark);
  font-size: 11px;
  font-weight: 600;
}
.cal-review-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}
.cal-review-bonus {
  font-size: 12px;
  font-weight: 700;
  color: #047857;
}
.cal-review-bonus.empty {
  color: var(--gray-500);
  font-weight: 600;
}
.cal-review-time {
  font-size: 12px;
  color: var(--gray-500);
}

@media (max-width: 400px) {
  .cal-task-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .cal-task-actions {
    width: 100%;
    justify-content: space-between;
  }
  .cal-task-review-btn {
    min-width: 80px;
  }
}

/* ============================================================
   积分页
   ============================================================ */
.points-page { padding: 0 0 calc(var(--nav-height) + 16px); }
.points-hero {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  padding: 32px 20px;
  text-align: center; color: white;
}
.points-big { font-size: 64px; font-weight: 900; line-height: 1; }
.points-label { font-size: 15px; opacity: .85; margin-top: 8px; }
.streak-tag {
  display: inline-block;
  background: rgba(255,255,255,.2);
  border-radius: 20px; padding: 6px 16px;
  font-size: 14px; margin-top: 12px;
}

.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px; }
.badge-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.badge-emoji { font-size: 32px; display: block; margin-bottom: 6px; }
.badge-name { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.badge-desc { font-size: 11px; color: var(--gray-500); }

.score-history { padding: 0 16px; }
.score-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}
.score-row:last-child { border-bottom: none; }
.score-note { color: var(--gray-700); }
.score-plus { color: var(--green); font-weight: 700; }
.score-minus { color: var(--red); font-weight: 700; }
.score-date { font-size: 12px; color: var(--gray-500); margin-left: 8px; }

/* ============================================================
   奖励页
   ============================================================ */
.rewards-page { padding: 0 0 calc(var(--nav-height) + 16px); }
.current-score-bar {
  background: var(--purple-light);
  padding: 12px 20px;
  font-size: 15px; color: var(--purple-dark);
}
.reward-list { padding: 8px 16px; display: flex; flex-direction: column; gap: 10px; }
.reward-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  display: flex; gap: 14px; align-items: flex-start;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid transparent;
  transition: all .2s;
}
.reward-card:not(.reward-locked) { border-color: var(--amber); }
.reward-card.reward-locked { opacity: .65; }
.reward-emoji { font-size: 36px; flex-shrink: 0; }
.reward-info { flex: 1; min-width: 0; }
.reward-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.reward-desc { font-size: 13px; color: var(--gray-500); margin-bottom: 6px; }
.reward-cost { font-size: 13px; font-weight: 700; color: var(--amber); }
.reward-limit { font-size: 12px; color: var(--gray-500); }
.reward-action { flex-shrink: 0; display: flex; align-items: center; }
.exchange-list { padding: 0 16px; }
.exchange-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--gray-100);
  font-size: 13px; color: var(--gray-700);
}
.exchange-row:last-child { border-bottom: none; }

/* ============================================================
   相册页
   ============================================================ */
.album-page { padding: 0 0 calc(var(--nav-height) + 16px); }
.album-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 3px; padding: 0 0 8px;
}
.album-item { position: relative; aspect-ratio: 1; overflow: hidden; cursor: pointer; }
.album-img { width: 100%; height: 100%; object-fit: cover; }
.album-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  color: white; font-size: 11px; padding: 20px 6px 6px;
}
.album-empty { padding: 60px 20px; }

/* ============================================================
   家长端 - 仪表盘
   ============================================================ */
.parent-dashboard { padding: 0 0 calc(var(--nav-height) + 16px); }
.dashboard-header {
  background: linear-gradient(135deg, #1E40AF 0%, var(--blue) 100%);
  padding: 24px 20px 32px;
  color: white;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.dashboard-title { font-size: 20px; font-weight: 800; }
.dashboard-sub { font-size: 14px; opacity: .85; margin-top: 4px; }
.child-avatar-big { font-size: 48px; }

.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; padding: 0 16px;
  margin-top: -20px; position: relative; z-index: 1;
}
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: center;
  transition: transform .15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-number { font-size: 32px; font-weight: 900; }
.stat-label { font-size: 12px; color: var(--gray-500); font-weight: 600; margin-top: 4px; }
.stat-pending .stat-number { color: var(--amber); }
.stat-rate .stat-number { color: var(--green); }
.stat-score .stat-number { color: var(--purple); }
.stat-streak .stat-number { color: var(--red); }

.review-quick-list { padding: 0 16px; }
.review-quick-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  background: white; border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  font-size: 14px;
}
.empty-hint { text-align: center; color: var(--gray-500); font-size: 14px; padding: 20px; }

.quick-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 0 16px;
}
.quick-action-btn {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 600; color: var(--gray-700);
  transition: all .15s;
}
.quick-action-btn:hover { background: var(--purple-light); color: var(--purple); transform: translateY(-2px); }
.quick-action-btn span:first-child { font-size: 28px; }

/* ============================================================
   家长端 - 任务管理
   ============================================================ */
.tasks-page { padding: 0 0 calc(var(--nav-height) + 16px); }
.task-manager-list { padding: 8px 16px; display: flex; flex-direction: column; gap: 10px; }
.task-row {
  background: white; border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: flex-start;
  box-shadow: var(--shadow-sm); gap: 10px;
}
.task-row-left { display: flex; gap: 12px; align-items: flex-start; flex: 1; min-width: 0; }
.task-row-emoji { font-size: 28px; flex-shrink: 0; }
.task-row-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.task-row-meta { font-size: 12px; color: var(--gray-500); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-row-dates { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.task-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.type-tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }

.task-form-page { padding: 0 0 24px; }
#task-form { padding: 16px 20px; }
#reward-form { padding: 16px 20px; }

/* ============================================================
   家长端 - 审核中心
   ============================================================ */
.review-page { padding: 0 0 calc(var(--nav-height) + 16px); }
.review-list { padding: 8px 16px; display: flex; flex-direction: column; gap: 12px; }
.review-card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.review-card-header {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px 10px;
}
.review-task-emoji { font-size: 32px; flex-shrink: 0; }
.review-task-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.review-task-meta { font-size: 13px; color: var(--gray-500); }
.review-photos {
  padding: 0 16px 12px;
  display: flex; gap: 8px; overflow-x: auto;
}
.review-photo-thumb {
  width: 80px; height: 80px; border-radius: var(--radius-sm);
  object-fit: cover; flex-shrink: 0; cursor: pointer;
}
.review-reflection, .review-self-eval {
  margin: 0 16px 10px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--gray-700);
  display: flex; gap: 8px;
}
.reflection-icon { flex-shrink: 0; }
.review-actions { padding: 12px 16px; background: var(--gray-50); border-top: 1px solid var(--gray-200); }
.review-comment {
  width: 100%; margin-bottom: 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: white;
}
.review-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag-btn {
  padding: 5px 12px; border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  font-size: 12px; background: white; color: var(--gray-700);
  transition: all .15s;
}
.tag-btn.selected { background: var(--purple-light); border-color: var(--purple); color: var(--purple); }
.score-bonus-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; margin-bottom: 10px;
}
.bonus-input { width: 80px; padding: 6px 10px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-xs); }
.review-btn-row { display: flex; gap: 10px; }
.review-btn-row .btn-success, .review-btn-row .btn-danger { flex: 1; }

/* ============================================================
   家长端 - 积分管理
   ============================================================ */
.points-manager { padding: 0 0 calc(var(--nav-height) + 16px); }
.manual-score-form {
  margin: 16px; padding: 16px;
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.manual-score-form h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.manual-score-form .form-row { display: flex; gap: 8px; align-items: center; }
.manual-score-form input { flex: 1; padding: 10px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); }

/* ============================================================
   家长端 - 奖励管理
   ============================================================ */
.rewards-manager { padding: 0 0 calc(var(--nav-height) + 16px); }
.reward-manage-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.reward-manage-row {
  background: white; border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shadow-sm);
}
.reward-row-emoji { font-size: 28px; flex-shrink: 0; }
.reward-row-info { flex: 1; min-width: 0; }
.reward-row-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.reward-row-meta { font-size: 12px; color: var(--gray-500); }
.reward-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.exchange-pending-list { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.exchange-pending-card {
  background: var(--amber-light); border-radius: var(--radius);
  padding: 12px 16px; font-size: 13px;
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid #FCD34D;
}
.exchange-pending-card > div:last-child { display: flex; gap: 8px; }

/* ============================================================
   家长端 - 统计
   ============================================================ */
.stats-page { padding: 0 0 calc(var(--nav-height) + 16px); }
.stats-overview {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding: 16px;
}
.stat-overview-card {
  background: white; border-radius: var(--radius-sm);
  padding: 12px 8px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-ov-num { font-size: 22px; font-weight: 900; color: var(--purple); }
.stat-ov-label { font-size: 11px; color: var(--gray-500); margin-top: 4px; }

/* 最近7天柱状图 */
.last7-chart {
  display: flex; align-items: flex-end; gap: 6px;
  padding: 0 16px; height: 120px;
}
.day-bar-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; height: 100%;
}
.day-bar-bg {
  flex: 1; width: 100%;
  background: var(--gray-100); border-radius: 6px 6px 0 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
}
.day-bar-fill {
  background: linear-gradient(var(--purple), var(--purple-dark));
  border-radius: 4px 4px 0 0;
  transition: height .5s ease;
  min-height: 2px;
}
.day-bar-label { font-size: 10px; color: var(--gray-500); margin-top: 4px; }
.day-bar-pct { font-size: 10px; font-weight: 700; color: var(--purple); }

/* 分类统计条 */
.type-bars { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.stat-bar-row { display: flex; align-items: center; gap: 8px; }
.stat-bar-label { font-size: 13px; width: 70px; flex-shrink: 0; }
.stat-bar-bg {
  flex: 1; height: 10px; background: var(--gray-100);
  border-radius: 20px; overflow: hidden;
}
.stat-bar-fill {
  height: 100%; border-radius: 20px;
  transition: width .5s ease;
}
.stat-bar-val { font-size: 12px; font-weight: 700; color: var(--gray-700); width: 36px; text-align: right; }

/* ============================================================
   家长端 - 暑假总结
   ============================================================ */
.report-page { padding: 0 0 24px; }
.report-cover {
  background: linear-gradient(135deg, var(--purple-dark), var(--blue));
  padding: 40px 20px;
  text-align: center; color: white;
}
.report-avatar { font-size: 64px; margin-bottom: 12px; }
.report-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.report-date { font-size: 14px; opacity: .8; }
.report-section { padding: 20px; border-bottom: 1px solid var(--gray-100); }
.report-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.report-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.report-stat {
  background: var(--gray-50); border-radius: var(--radius-sm);
  padding: 12px 8px; text-align: center;
}
.report-stat-num { font-size: 22px; font-weight: 900; color: var(--purple); }
.report-stat div:last-child { font-size: 11px; color: var(--gray-500); margin-top: 4px; }
.report-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.report-badge {
  background: var(--amber-light); border-radius: 20px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; color: #92400E;
}
.report-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.report-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }

/* ============================================================
   设置页
   ============================================================ */
.settings-page { padding: 16px 0 calc(var(--nav-height) + 16px); }
.settings-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.settings-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.danger-zone { margin-top: 20px; }
.danger-zone h3 { color: var(--red); }
#save-settings-btn { margin: 16px 20px; }
#clear-data-btn { width: calc(100% - 0px); }

/* ============================================================
   加载状态
   ============================================================ */
.loading-screen, .error-screen {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; gap: 16px;
  background: #FBF9FF;
}
.loading-spinner {
  width: 44px; height: 44px;
  border: 4px solid #EDE9FE;
  border-top-color: #7C3AED;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--gray-500); font-size: 15px; font-weight: 500; }
.error-screen { color: var(--gray-700); font-size: 16px; text-align: center; gap: 20px; }

/* ============================================================
   打印样式
   ============================================================ */
@media print {
  .nav-bar, .btn-primary, #toast-container { display: none !important; }
  #app { max-width: 100%; box-shadow: none; }
  .report-page { padding: 0; }
  body { background: white; }
}

/* ============================================================
   响应式适配
   ============================================================ */
@media (max-width: 380px) {
  .stats-overview { grid-template-columns: repeat(2, 1fr); }
  .report-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .badge-grid { grid-template-columns: repeat(2, 1fr); }
}
