/* ========================================
   作业小达人 v2 - 学生每日作业计划工作台
   风格：卡通、简约、淡粉色
   含日历系统：按日期管理作业、查看历史进度
   ======================================== */

:root {
  --pink-bg: #FFF5F7;
  --pink-light: #FFE4EC;
  --pink-card: #FFFFFF;
  --pink-primary: #FF8FAB;
  --pink-deep: #FF6B95;
  --pink-border: #FFD0DC;
  --pink-soft: #FFF0F4;
  --text-main: #5A4A52;
  --text-light: #9B8A92;
  --text-white: #FFFFFF;
  --green-done: #7DD3A0;
  --green-light: #E8F8EE;
  --yellow-star: #FFD93D;
  --orange-warn: #FF9F43;
  --blue-info: #74B9FF;
  --shadow-soft: 0 4px 16px rgba(255, 143, 171, 0.15);
  --shadow-card: 0 6px 20px rgba(255, 107, 149, 0.1);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-main: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

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

html, body {
  font-family: var(--font-main);
  background: linear-gradient(180deg, var(--pink-bg) 0%, var(--pink-light) 100%);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.hidden { display: none !important; }

/* ========================================
   头部
   ======================================== */
.header {
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  color: var(--text-white);
  padding: 16px 20px 18px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
}

.header-title-area {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.header-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.date-display {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
}

.admin-entry-btn {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-entry-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.4);
}

.header-stats {
  display: flex;
  gap: 12px;
  align-items: center;
}

.stat-item {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 8px 14px;
}

.progress-stat { flex: 1; }
.points-stat { flex-shrink: 0; text-align: center; }

.stat-label {
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-bg {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow-star) 0%, #FFE066 100%);
  border-radius: 5px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.points-badge {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

.points-badge::before {
  content: "⭐ ";
}

.points-badge.bounce { animation: bounce 0.5s ease; }

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* ========================================
   查看历史日期提示栏
   ======================================== */
.viewing-date-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--blue-info);
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
}

.back-to-today-btn {
  background: rgba(255,255,255,0.25);
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  color: white;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.back-to-today-btn:active { background: rgba(255,255,255,0.4); }

/* ========================================
   分区导航
   ======================================== */
.tabs {
  display: flex;
  gap: 6px;
  padding: 14px 16px 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1;
  min-width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  border: none;
  background: var(--pink-card);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tab.active {
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  color: var(--text-white);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.tab-icon { font-size: 22px; line-height: 1; }

.tab.active .tab-icon { animation: tabPop 0.3s ease; }

@keyframes tabPop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ========================================
   内容区
   ======================================== */
.content {
  padding: 8px 16px 170px;
}

/* 只读提示 */
.readonly-notice {
  background: var(--blue-info);
  color: white;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

.readonly-notice.past {
  background: var(--text-light);
}

/* 作业列表卡片 */
.task-card {
  background: var(--pink-card);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.task-card.done {
  background: var(--green-light);
  border: 2px solid var(--green-done);
}

.task-card.readonly {
  cursor: default;
  opacity: 0.85;
}

.task-card:active:not(.readonly) { transform: scale(0.98); }

.task-checkbox {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--pink-border);
  background: var(--pink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 18px;
}

.task-card.done .task-checkbox {
  background: var(--green-done);
  border-color: var(--green-done);
  color: white;
}

.task-text {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
}

.task-card.done .task-text {
  text-decoration: line-through;
  color: var(--text-light);
}

.task-points {
  font-size: 13px;
  font-weight: 700;
  color: var(--pink-primary);
  background: var(--pink-light);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.task-card.done .task-points {
  background: var(--green-light);
  color: var(--green-done);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-light);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 15px; }

/* ========================================
   宠物面板（不变）
   ======================================== */
.pet-panel { padding: 10px 0; }

.pet-stage {
  background: linear-gradient(180deg, #FFF9FB 0%, var(--pink-light) 100%);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.pet-stage::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 143, 171, 0.08) 100%);
}

.pet-display {
  font-size: 80px;
  line-height: 1.2;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.pet-display.float { animation: petFloat 3s ease-in-out infinite; }

@keyframes petFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.pet-egg { font-size: 70px; animation: eggShake 2s ease-in-out infinite; }

@keyframes eggShake {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.pet-name { font-size: 20px; font-weight: 700; color: var(--pink-deep); margin-top: 8px; }
.pet-status-text { font-size: 14px; color: var(--text-light); margin-top: 6px; }

.pet-happiness-bar {
  max-width: 200px;
  margin: 14px auto 0;
  height: 10px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 5px;
  overflow: hidden;
}

.pet-happiness-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow-star) 0%, var(--orange-warn) 100%);
  border-radius: 5px;
  transition: width 0.5s ease;
}

.pet-happiness-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* 宠物领养 */
.adopt-section {
  background: var(--pink-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}

.adopt-title { font-size: 17px; font-weight: 700; color: var(--text-main); text-align: center; margin-bottom: 4px; }
.adopt-desc { font-size: 13px; color: var(--text-light); text-align: center; margin-bottom: 18px; }

.adopt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.adopt-card {
  background: var(--pink-soft);
  border: 2px solid var(--pink-border);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.adopt-card:active { transform: scale(0.95); }
.adopt-card.selected { border-color: var(--pink-deep); background: var(--pink-light); }
.adopt-card-emoji { font-size: 36px; margin-bottom: 6px; }
.adopt-card-name { font-size: 13px; font-weight: 600; color: var(--text-main); }

.adopt-locked { position: relative; opacity: 0.5; pointer-events: none; }
.adopt-locked::after {
  content: "🔒";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
}

.adopt-confirm-btn {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.adopt-confirm-btn:active { transform: scale(0.97); }
.adopt-confirm-btn:disabled { opacity: 0.5; }

/* 宠物操作按钮 */
.pet-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.pet-action-btn {
  background: var(--pink-card);
  border: 2px solid var(--pink-border);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.pet-action-btn:active { transform: scale(0.96); }
.pet-action-btn:disabled { opacity: 0.5; pointer-events: none; }
.pet-action-emoji { font-size: 30px; margin-bottom: 4px; }
.pet-action-name { font-size: 14px; font-weight: 600; color: var(--text-main); }
.pet-action-cost { font-size: 12px; color: var(--orange-warn); margin-top: 3px; font-weight: 600; }

.pet-action-feedback {
  position: absolute;
  font-size: 24px;
  pointer-events: none;
  animation: feedbackFloat 1s ease-out forwards;
  z-index: 200;
}

@keyframes feedbackFloat {
  0% { opacity: 1; transform: translateY(0) scale(0.8); }
  100% { opacity: 0; transform: translateY(-60px) scale(1.4); }
}

/* ========================================
   底部日历列表
   ======================================== */
.calendar-strip-section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--pink-card);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  z-index: 50;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

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

.calendar-strip-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.cal-strip-nav { display: flex; gap: 6px; }

.cal-nav-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--pink-soft);
  font-size: 18px;
  font-weight: 700;
  color: var(--pink-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cal-nav-btn:active { background: var(--pink-primary); color: white; transform: scale(0.9); }

.calendar-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 4px;
  scroll-behavior: smooth;
}

.calendar-strip::-webkit-scrollbar { display: none; }

.cal-strip-item {
  flex-shrink: 0;
  width: 52px;
  padding: 8px 4px 6px;
  border-radius: var(--radius-md);
  background: var(--pink-soft);
  border: 2px solid transparent;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.cal-strip-item:active { transform: scale(0.93); }

.cal-strip-item.cal-strip-today {
  background: var(--pink-light);
  border-color: var(--pink-primary);
}

.cal-strip-item.cal-strip-selected {
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  border-color: var(--pink-deep);
}

.cal-strip-item.cal-strip-selected .cal-strip-weekday,
.cal-strip-item.cal-strip-selected .cal-strip-date {
  color: white;
}

.cal-strip-weekday {
  font-size: 10px;
  color: var(--text-light);
  font-weight: 600;
}

.cal-strip-item.cal-strip-today .cal-strip-weekday {
  color: var(--pink-deep);
}

.cal-strip-date {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.cal-strip-item.cal-strip-today .cal-strip-date {
  color: var(--pink-deep);
}

.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin: 4px auto 0;
}

.cal-dot-pending { background: var(--pink-primary); }
.cal-dot-done { background: var(--green-done); }
.cal-dot-none { display: none; }

.cal-strip-selected .cal-dot-pending { background: rgba(255,255,255,0.7); }
.cal-strip-selected .cal-dot-done { background: rgba(255,255,255,0.9); }

/* ========================================
   管理员登录弹窗（不变）
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(90, 74, 82, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  background: var(--pink-card);
  border-radius: var(--radius-lg);
  padding: 30px 24px 20px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.modal-icon { font-size: 40px; margin-bottom: 8px; }
.modal-title { font-size: 20px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.modal-desc { font-size: 13px; color: var(--text-light); margin-bottom: 20px; }

.password-input-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.password-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--pink-border);
  background: var(--pink-soft);
  transition: all 0.2s;
}

.password-dot.filled { background: var(--pink-primary); border-color: var(--pink-primary); }

.num-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.num-btn {
  height: 52px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--pink-soft);
  font-family: var(--font-main);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}

.num-btn:active { background: var(--pink-primary); color: white; transform: scale(0.93); }
.num-btn-blank { background: transparent; pointer-events: none; }
.num-btn-del { font-size: 20px; }

.modal-cancel-btn {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--pink-border);
  border-radius: var(--radius-md);
  background: transparent;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
}

.modal-cancel-btn:active { background: var(--pink-soft); }

.modal-card.shake { animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* 复制弹窗 */
.copy-date-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  text-align: left;
}

.copy-date-row label { font-size: 14px; font-weight: 600; color: var(--text-main); }

.copy-date-input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--pink-border);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 16px;
  color: var(--text-main);
  background: var(--pink-soft);
  outline: none;
}

.copy-date-input:focus { border-color: var(--pink-primary); background: white; }

.copy-quick-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.copy-quick-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--pink-border);
  border-radius: var(--radius-sm);
  background: var(--pink-soft);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  color: var(--pink-primary);
  cursor: pointer;
}

.copy-quick-btn:active { background: var(--pink-light); }

.modal-buttons-row {
  display: flex;
  gap: 10px;
}

.copy-confirm-btn {
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  color: white;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.copy-confirm-btn:active { transform: scale(0.97); }

/* ========================================
   管理后台面板
   ======================================== */
#adminPanel {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "aheader" "anav" "acontent";
  min-height: 100vh;
  background: var(--pink-bg);
}

.admin-header {
  background: linear-gradient(135deg, #6C7A89 0%, #5A6A7A 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-header h1 { font-size: 18px; font-weight: 700; }
.admin-header-actions { display: flex; gap: 10px; }

/* 后台：左侧垂直导航 */
.admin-header { grid-area: aheader; }
.admin-subtabs {
  grid-area: anav;
  display: flex; flex-direction: row; gap: 8px; flex-wrap: nowrap;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 10px 12px;
  background: var(--pink-light);
  border-bottom: 1px solid var(--pink-border);
  scrollbar-width: none;
}
.admin-subtabs::-webkit-scrollbar { display: none; }
.admin-subtab {
  flex: 0 0 auto; white-space: nowrap; text-align: center;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}
.admin-subtab:hover { background: var(--pink-card); }
.admin-subtab.active {
  background: linear-gradient(135deg, #6C7A89 0%, #5A6A7A 100%);
  color: #fff;
}
.admin-subcontent { grid-area: acontent; padding: 18px; overflow-x: hidden; }
@media (max-width: 768px) {
  #adminPanel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "aheader" "anav" "acontent";
  }
  .admin-subtabs {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--pink-border);
  }
  .admin-subtab { white-space: nowrap; flex-shrink: 0; }
  .admin-subcontent { padding: 14px; }
}

.admin-save-btn {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--green-done);
  color: white;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(125, 211, 160, 0.3);
}

.admin-save-btn:active { transform: scale(0.95); }

.admin-back-btn {
  padding: 10px 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-md);
  background: transparent;
  color: white;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.admin-back-btn:active { background: rgba(255,255,255,0.1); }

/* 后台日历 */
.admin-calendar-section {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px;
}

.admin-calendar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-calendar-header span {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
  text-align: center;
}

.admin-today-btn {
  padding: 6px 14px;
  border: 2px solid var(--pink-border);
  border-radius: 20px;
  background: var(--pink-soft);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  color: var(--pink-primary);
  cursor: pointer;
}

.admin-today-btn:active { background: var(--pink-light); }

.admin-calendar-grid {
  background: var(--pink-card);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.admin-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.admin-cal-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  padding: 4px 0;
}

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

.admin-cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: var(--pink-soft);
}

.admin-cal-day:active { transform: scale(0.92); }

.admin-cal-day-empty { background: transparent; pointer-events: none; }

.admin-cal-day-num { font-size: 15px; font-weight: 600; color: var(--text-main); }

.admin-cal-day-today {
  background: var(--pink-light);
  border: 2px solid var(--pink-primary);
}

.admin-cal-day-today .admin-cal-day-num { color: var(--pink-deep); }

.admin-cal-day-selected {
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
}

.admin-cal-day-selected .admin-cal-day-num { color: white; }

.admin-cal-day-has-plan .admin-cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green-done);
  margin-top: 2px;
}

.admin-cal-day-selected .admin-cal-dot { background: rgba(255,255,255,0.8); }

/* 选中日期提示 */
.admin-selected-date-bar {
  max-width: 700px;
  margin: 0 auto;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.admin-date-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
}

.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 16px 6px;
  max-width: 700px;
  margin: 0 auto;
  overflow-x: auto;
}

.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  border: none;
  background: var(--pink-card);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.admin-tab.active {
  background: linear-gradient(135deg, #6C7A89 0%, #5A6A7A 100%);
  color: white;
}

.admin-content {
  padding: 8px 16px 10px;
  max-width: 700px;
  margin: 0 auto;
}

.admin-task-row {
  background: var(--pink-card);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.admin-task-row .drag-handle {
  font-size: 18px;
  color: var(--text-light);
  cursor: grab;
  flex-shrink: 0;
}

.admin-task-input {
  flex: 1;
  border: 2px solid var(--pink-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-main);
  font-size: 15px;
  color: var(--text-main);
  background: var(--pink-soft);
  outline: none;
  transition: border 0.2s;
}

.admin-task-input:focus { border-color: var(--pink-primary); background: white; }

.admin-task-del {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #FFE0E0;
  color: #E74C3C;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-task-del:active { transform: scale(0.9); background: #FFC0C0; }

.admin-add-btn {
  width: 100%;
  padding: 14px;
  border: 2px dashed var(--pink-primary);
  border-radius: var(--radius-md);
  background: transparent;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 600;
  color: var(--pink-primary);
  cursor: pointer;
  margin-top: 6px;
}

.admin-add-btn:active { background: var(--pink-soft); }

/* 快速复制区 */
.admin-copy-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--pink-card);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.admin-copy-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
}

.admin-copy-btn {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--pink-border);
  border-radius: var(--radius-sm);
  background: var(--pink-soft);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  color: var(--pink-primary);
  cursor: pointer;
}

.admin-copy-btn:active { background: var(--pink-light); }

.admin-footer {
  padding: 20px 16px 40px;
  max-width: 700px;
  margin: 0 auto;
}

.admin-pwd-section {
  background: var(--pink-card);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.admin-pwd-section label { font-size: 14px; font-weight: 600; color: var(--text-main); }

.admin-pwd-section input {
  flex: 1;
  min-width: 100px;
  border: 2px solid var(--pink-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-main);
  font-size: 16px;
  letter-spacing: 4px;
  text-align: center;
  color: var(--text-main);
  background: var(--pink-soft);
  outline: none;
}

.admin-pwd-section input:focus { border-color: var(--pink-primary); background: white; }

.pwd-change-btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--pink-primary);
  color: white;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.pwd-change-btn:active { transform: scale(0.95); }

/* ========================================
   Toast / 粒子（不变）
   ======================================== */
.toast {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(90, 74, 82, 0.92);
  color: white;
  padding: 16px 28px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast.toast-success { background: rgba(125, 211, 160, 0.95); }
.toast.toast-warn { background: rgba(255, 159, 67, 0.95); }
.toast.toast-error { background: rgba(231, 76, 60, 0.95); }

.confetti {
  position: fixed;
  width: 10px; height: 10px;
  z-index: 1500;
  pointer-events: none;
  animation: confettiFall 1.2s ease-out forwards;
}

@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(200px) rotate(360deg); }
}

.pet-stage-badge {
  display: inline-block;
  background: var(--pink-primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  margin-top: 8px;
}

.pet-stage-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--pink-deep);
  margin-top: 6px;
}

/* 成长进度条 */
.pet-growth-section {
  background: var(--pink-card);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

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

.growth-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.growth-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--pink-primary);
}

.growth-bar-bg {
  height: 12px;
  background: var(--pink-light);
  border-radius: 6px;
  overflow: hidden;
}

.growth-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  border-radius: 6px;
  transition: width 0.6s ease;
}

.growth-next-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
  text-align: center;
}

.growth-max-text {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--green-done);
  padding: 8px 0;
}

/* 成长时间线 */
.pet-growth-timeline {
  background: var(--pink-card);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.timeline-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
  text-align: center;
}

.timeline-stages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.timeline-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.3s;
  min-width: 56px;
}

.timeline-stage.reached {
  opacity: 1;
}

.timeline-stage:not(.reached) {
  opacity: 0.35;
  filter: grayscale(0.5);
}

.timeline-stage.current {
  background: var(--pink-light);
  border: 2px solid var(--pink-primary);
  transform: scale(1.08);
}

.timeline-emoji {
  font-size: 28px;
  line-height: 1;
}

.timeline-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  line-height: 1.2;
}

.timeline-arrow {
  font-size: 16px;
  color: var(--pink-border);
  font-weight: 700;
}

.timeline-arrow.reached {
  color: var(--pink-primary);
}

/* 领养前成长提示 */
.pet-growth-hint {
  background: var(--pink-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 16px;
  box-shadow: var(--shadow-card);
}

.growth-hint-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 14px;
}

.growth-hint-stages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.growth-hint-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.gh-emoji { font-size: 24px; }
.gh-name { font-size: 10px; color: var(--text-light); font-weight: 600; }

.growth-hint-arrow {
  font-size: 14px;
  color: var(--pink-border);
}

.growth-hint-desc {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  line-height: 1.5;
}

/* 互动记录 */
.pet-record-section {
  margin-top: 16px;
  background: var(--pink-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.pet-record-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
}

.pet-record-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-light);
}

/* ========================================
   统计面板
   ======================================== */
.stats-panel {
  padding: 10px 0;
}

.stats-card {
  background: var(--pink-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.stats-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
}

/* 圆环 */
.stats-ring-card { text-align: center; }

.stats-ring-container {
  position: relative;
  display: inline-block;
  width: 140px;
  height: 140px;
}

.stats-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.stats-ring-pct {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.stats-ring-sub {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* 完成天数 */
.stats-days-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stats-days-content {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stats-days-number {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.stats-days-unit {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-light);
}

.stats-days-icon {
  font-size: 48px;
  opacity: 0.3;
}

/* 科目完成率 */
.stats-subject-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.stats-subject-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  width: 70px;
  flex-shrink: 0;
}

.stats-subject-bar-wrap {
  flex: 1;
}

.stats-subject-bar-bg {
  height: 16px;
  background: var(--pink-light);
  border-radius: 8px;
  overflow: hidden;
}

.stats-subject-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.8s ease;
  min-width: 2px;
}

.stats-subject-pct {
  font-size: 14px;
  font-weight: 700;
  width: 44px;
  text-align: right;
  flex-shrink: 0;
}

.stats-subject-detail {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 12px;
  margin-left: 80px;
}

.stats-subject-detail:last-child {
  margin-bottom: 0;
}

/* 积分总览 */
.stats-points-card { text-align: center; }

.stats-points-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 6px 0;
}

.stats-points-star { font-size: 28px; }
.stats-points-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--pink-deep);
}
.stats-points-label { font-size: 16px; color: var(--text-light); }

.stats-points-hint {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ========================================
   奖励面板
   ======================================== */
.rewards-panel {
  padding: 10px 0;
}

.rewards-header {
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rewards-points-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.rewards-star { font-size: 24px; }
.rewards-points-num { font-size: 32px; font-weight: 800; }
.rewards-points-unit { font-size: 14px; opacity: 0.9; }

.rewards-redeemed {
  font-size: 13px;
  opacity: 0.85;
  background: rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: 20px;
}

.rewards-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reward-card {
  background: var(--pink-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
  border: 2px solid var(--pink-border);
  transition: all 0.2s;
}

.reward-card.reward-locked {
  opacity: 0.6;
}

.reward-emoji {
  font-size: 52px;
  margin-bottom: 8px;
}

.reward-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.reward-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.reward-cost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 14px;
}

.reward-cost-star { font-size: 18px; }
.reward-cost-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--pink-deep);
}

.reward-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  color: white;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.reward-btn:active { transform: scale(0.97); }
.reward-btn.disabled { opacity: 0.5; pointer-events: none; }

.reward-confirm-btn {
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  color: white;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.reward-confirm-btn:active { transform: scale(0.97); }

/* 兑换记录 */
.rewards-history {
  background: var(--pink-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 16px;
  box-shadow: var(--shadow-card);
}

.rewards-history-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.reward-history-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--pink-soft);
  font-size: 13px;
}

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

.rh-emoji { font-size: 20px; }
.rh-name { flex: 1; color: var(--text-main); font-weight: 500; }
.rh-date { color: var(--text-light); font-size: 12px; }

/* ========================================
   表扬弹窗
   ======================================== */
.praise-card {
  background: linear-gradient(180deg, #FFF9FB 0%, var(--pink-light) 100%);
  border: 2px solid var(--pink-primary);
}

.praise-icon {
  font-size: 56px;
  margin-bottom: 12px;
  animation: praiseBounce 0.6s ease;
}

@keyframes praiseBounce {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); }
}

.praise-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--pink-deep);
  margin-bottom: 8px;
}

.praise-text {
  font-size: 15px;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 0 8px;
}

.praise-close-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  color: white;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.praise-close-btn:active { transform: scale(0.97); }

/* 全部完成撒花弹窗 */
.all-done-card {
  background: linear-gradient(180deg, #FFF9FB 0%, #FFE4EC 100%);
  border: 3px solid var(--pink-deep);
  position: relative;
  overflow: hidden;
}

.all-done-confetti-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.all-done-icon {
  font-size: 64px;
  margin-bottom: 12px;
  animation: trophyShine 0.8s ease;
  position: relative;
  z-index: 2;
}

@keyframes trophyShine {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.3) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.all-done-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--pink-deep);
  margin-bottom: 8px;
  position: relative;
  z-index: 2;
}

.all-done-text {
  font-size: 16px;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 0 10px;
  position: relative;
  z-index: 2;
}

.all-done-close-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pink-deep) 0%, #E5547E 100%);
  color: white;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.all-done-close-btn:active { transform: scale(0.97); }

/* 大撒花粒子 */
.big-confetti {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  animation: bigConfettiFall linear forwards;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes bigConfettiFall {
  0% { opacity: 1; transform: translateY(-20px) rotate(0deg); }
  100% { opacity: 0; transform: translateY(500px) rotate(720deg); }
}

/* ========================================
   响应式
   ======================================== */
@media (min-width: 600px) {
  .tab-name { font-size: 14px; }
  .tab-icon { font-size: 26px; }
  .task-text { font-size: 17px; }
  .pet-display { font-size: 100px; }
  .adopt-grid { grid-template-columns: repeat(6, 1fr); }
  .cal-strip-item { width: 60px; }
  .rewards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .timeline-emoji { font-size: 32px; }
}
/* 竖屏（含平板）：内容居中收窄，便于单手阅读 */
@media (min-width: 600px) and (orientation: portrait) {
  .tabs, .content { max-width: 600px; margin: 0 auto; }
  .calendar-strip-section { max-width: 600px; left: 50%; transform: translateX(-50%); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
/* 横屏：内容撑满全屏，不再居中收窄 */
@media (orientation: landscape) {
  .tabs, .content, .page, #dashboard, #content { max-width: none !important; margin: 0 !important; }
  .calendar-strip-section { max-width: none; left: auto; transform: none; border-radius: var(--radius-lg); }
  .main-area { max-width: none; padding: 16px 28px 36px; }
  .rp-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .rewards-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

@media (max-width: 360px) {
  .tab-name { font-size: 10px; }
  .tab-icon { font-size: 18px; }
  .tab { min-width: 46px; padding: 8px 3px; }
  .header-title { font-size: 16px; }
  .header-stats { flex-direction: column; align-items: stretch; gap: 8px; }
  .cal-strip-item { width: 46px; }
  .timeline-emoji { font-size: 24px; }
  .timeline-stage { min-width: 48px; }
}

/* =====================================================
   新功能样式：导航 / 早起 / 徽章 / 奖励惩罚 / 后台配置
   ===================================================== */

/* 顶部 logo 自定义图标 */
.logo-icon-img { width: 26px; height: 26px; border-radius: 8px; object-fit: contain; }
.logo-emoji { font-size: 26px; }

/* 导航项自定义图标 32x32 */
.nav-ico-img { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; flex-shrink: 0; }

/* 导航水印 */
.sidebar-watermark { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.sidebar-watermark .wm { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.sidebar-toggle, .sidebar-logo, .sidebar-nav, .sidebar-footer { position: relative; z-index: 1; }
.navcfg-row.dragging { opacity: 0.5; }

/* 早起准备 / 放学自查：两张板块卡片大小相同（等宽 + 等高，文字溢出隐藏） */
.morning-section, .afterschool-section { margin: 0 4px 16px; box-sizing: border-box; }
.morning-grid, .afterschool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; grid-auto-rows: 1fr; }
.morning-card, .afterschool-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 108px; height: 100%; box-sizing: border-box; overflow: hidden;
  background: var(--pink-card); border-radius: 18px; padding: 12px;
  box-shadow: var(--shadow-card); border: 2px solid transparent; cursor: pointer;
  font-family: var(--font-main); transition: transform 0.1s, border-color 0.2s, opacity 0.2s;
}
.morning-card:active, .afterschool-card:active { transform: scale(0.96); }
.morning-card .mc-ico { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; }
.morning-card .mc-emoji, .afterschool-card .asc-emoji { font-size: 38px; line-height: 1.1; }
.morning-card .mc-text, .afterschool-card .asc-text {
  font-size: 13px; font-weight: 700; color: var(--text-main); text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.morning-card .mc-points, .afterschool-card .asc-points { font-size: 12px; font-weight: 700; color: var(--pink-deep); background: var(--pink-soft); border-radius: 10px; padding: 2px 10px; }
.morning-card.done, .afterschool-card.done { opacity: 0.55; filter: grayscale(1); border-color: var(--green-done); }
.morning-card.done .mc-text, .afterschool-card.done .asc-text { text-decoration: line-through; }
@media (max-width: 480px) { .morning-grid, .afterschool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 360px) { .morning-grid, .afterschool-grid { grid-template-columns: repeat(1, 1fr); } }

/* 作业编辑：插入文件/图片 的附件芯片与前台可点击链接 */
.admin-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.admin-attach-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--pink-soft); border: 1px solid var(--pink-border); border-radius: 10px; padding: 3px 8px; font-size: 12px; color: var(--text-main); }
.admin-attach-del { border: none; background: transparent; color: var(--pink-deep); cursor: pointer; font-size: 12px; padding: 0 2px; }
.task-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.task-attachment-link, .inserted-file-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px;
  background: var(--pink-soft); border: 1px solid var(--pink-border); color: var(--pink-deep);
  font-weight: 700; text-decoration: none; font-size: 14px;
}
.task-attachment-link:active, .inserted-file-link:active { transform: scale(0.97); }
.task-article img { max-width: 100%; height: auto; border-radius: 8px; margin: 6px 0; display: block; }
.task-img-thumb { width: 100%; max-height: 200px; object-fit: cover; border-radius: 12px; border: 1px solid var(--pink-border); background: #fff; cursor: pointer; margin: 6px 0; display: block; }
/* 图片全屏灯箱 */
.img-lightbox { position: fixed; inset: 0; z-index: 600; background: rgba(0,0,0,0.92); display: flex; align-items: center; justify-content: center; padding: 16px; }
.img-lightbox.hidden { display: none; }
.img-lightbox-img { max-width: 100%; max-height: 90%; object-fit: contain; border-radius: 8px; }
.img-lightbox-close { position: absolute; top: 14px; right: 16px; width: 42px; height: 42px; line-height: 42px; text-align: center; color: #fff; font-size: 22px; background: rgba(255,255,255,0.18); border-radius: 50%; cursor: pointer; }


/* ========== 安装引导横幅 ========== */
.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 400;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #a8d8ea, #f7c8d8);
  color: #234; border-radius: 16px; padding: 10px 12px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.18);
  animation: ib-slide-up 0.3s ease;
}
@keyframes ib-slide-up { from { transform: translateY(140%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.install-banner.hidden { display: none; }
.ib-icon { font-size: 26px; flex-shrink: 0; }
.ib-body { flex: 1; min-width: 0; }
.ib-title { font-weight: 800; font-size: 14px; }
.ib-sub { font-size: 12px; opacity: 0.85; }
.ib-btn {
  border: none; background: #fff; color: #2a9d6a; font-weight: 800;
  padding: 8px 16px; border-radius: 12px; cursor: pointer; font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12); flex-shrink: 0;
}
.ib-close {
  border: none; background: transparent; color: #234; opacity: 0.6;
  font-size: 18px; cursor: pointer; padding: 4px 6px; flex-shrink: 0;
}
/* 安装帮助弹窗 */
.install-help-body { font-size: 14px; line-height: 1.7; color: var(--text-main); }
.ih-steps { padding-left: 20px; margin: 8px 0; }
.ih-steps li { margin: 6px 0; }
.ih-steps b { color: var(--pink-deep); }
.install-help .modal-cancel-btn { margin-top: 14px; }
.ih-warn {
  background: #fff4e0; border: 1px solid #ffcf8a; color: #8a5a00;
  border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 13.5px;
}
.ih-warn b { color: #d2691e; }
.ih-tip { margin: 10px 0 4px; font-size: 13.5px; color: var(--text-main); }
.ih-tip b { color: var(--pink-deep); }
.ih-copy {
  display: block; width: 100%; margin-top: 14px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #4a9eff, #2a7de0); color: #fff; font-weight: 800;
  padding: 12px; border-radius: 12px; font-size: 15px; box-shadow: 0 3px 10px rgba(42,125,224,0.3);
}

/* 我的徽章 */
.badges-section { margin-bottom: 16px; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.badge-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--pink-card); border-radius: 18px; padding: 14px 10px;
  box-shadow: var(--shadow-card); border: 2px solid var(--pink-border); cursor: pointer;
  font-family: var(--font-main); transition: transform 0.1s;
}
.badge-card:active { transform: scale(0.96); }
.badge-ico { width: 54px; height: 54px; border-radius: 50%; object-fit: contain; }
.badge-emoji { font-size: 46px; filter: grayscale(1) opacity(0.5); }
.badge-emoji.locked { filter: grayscale(1) opacity(0.4); }
/* 未点亮：黑白展示；点亮后：恢复彩色 */
.badge-card.off .badge-ico, .badge-card.off .badge-emoji { filter: grayscale(1); opacity: 0.55; }
.badge-card.on .badge-ico, .badge-card.on .badge-emoji { filter: none; opacity: 1; }
.badge-card.on { border-color: var(--yellow-star); box-shadow: 0 0 0 3px rgba(255, 217, 61, 0.35), var(--shadow-card); }
.badge-card.on .badge-emoji { filter: none; }
.badge-name { font-size: 13px; font-weight: 800; color: var(--text-main); text-align: center; }
.badge-prog { font-size: 11px; font-weight: 700; color: var(--text-light); }

/* 奖励和惩罚四区块 */
.rp-panel { display: flex; flex-direction: column; gap: 16px; }
.rp-header { display: flex; justify-content: center; }
.rp-points-display { font-size: 22px; font-weight: 800; color: var(--pink-deep); background: var(--pink-soft); border-radius: 16px; padding: 8px 18px; }
.rp-points-display span { margin: 0 2px; }
.rp-block { background: var(--pink-card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow-card); }
.rp-block-title { font-size: 15px; font-weight: 800; color: var(--pink-deep); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.rp-card { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--pink-soft); border-radius: 16px; padding: 14px 10px; border: 2px solid transparent; }
.rp-card.locked { opacity: 0.7; }
.rp-ico { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; }
.rp-emoji { font-size: 38px; }
.rp-name { font-size: 14px; font-weight: 700; color: var(--text-main); text-align: center; }
.rp-cost { font-size: 13px; font-weight: 800; color: var(--pink-deep); }
.rp-cost.add { color: var(--green-done); }
.rp-cost.sub { color: var(--orange-warn); }
.rp-btn { border: none; border-radius: 12px; padding: 8px 14px; font-size: 13px; font-weight: 700; background: var(--pink-deep); color: #fff; cursor: pointer; font-family: var(--font-main); }
.rp-btn.add { background: var(--green-done); }
.rp-btn.sub { background: var(--orange-warn); }
.rp-btn.disabled { background: var(--text-light); opacity: 0.7; cursor: not-allowed; }
.rp-btn:active { transform: scale(0.95); }
.rp-empty { font-size: 13px; color: var(--text-light); padding: 8px 0; }
.rp-log { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.rp-log-row { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; padding: 6px 8px; background: var(--pink-soft); border-radius: 10px; }
.rp-log-op { font-weight: 700; color: var(--text-main); }
.rp-log-label { color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-log-delta { font-weight: 800; }
.rp-log-delta.plus { color: var(--green-done); }
.rp-log-delta.minus { color: var(--orange-warn); }
.rp-log-time { font-size: 11px; color: var(--text-light); }
.rp-export-btn { border: none; border-radius: 10px; padding: 5px 12px; font-size: 12px; font-weight: 700; background: var(--pink-primary); color: #fff; cursor: pointer; font-family: var(--font-main); }
.rp-log-preview { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }

/* 后台：通用上传 */
.admin-field-col { display: flex; flex-direction: column; gap: 6px; }
.admin-upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-img-preview { margin-top: 8px; background: var(--pink-soft); border-radius: 12px; padding: 10px; min-height: 60px; display: flex; align-items: center; }
.admin-img-preview img { max-width: 80px; max-height: 80px; border-radius: 12px; }
.admin-img-preview:empty::before { content: '默认'; color: var(--text-light); font-size: 13px; }

/* 后台：导航配置 */
.navcfg-row { display: flex; align-items: center; gap: 8px; background: var(--pink-card); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; box-shadow: var(--shadow-card); cursor: grab; }
.navcfg-handle { font-size: 18px; color: var(--text-light); cursor: grab; }
.navcfg-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.navcfg-icon-img { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }
.navcfg-name { flex: 1; min-width: 80px; }
.navcfg-upload { font-size: 12px; font-weight: 700; color: var(--text-light); display: flex; flex-direction: column; gap: 2px; align-items: center; cursor: pointer; }
.navcfg-upload input { font-size: 11px; max-width: 110px; }
.navcfg-up, .navcfg-down { border: none; background: var(--pink-soft); color: var(--pink-deep); border-radius: 6px; width: 28px; height: 24px; font-size: 12px; cursor: pointer; }
.navcfg-up:disabled, .navcfg-down:disabled { opacity: 0.35; cursor: not-allowed; }

/* 后台：早起 / 徽章 / 奖励惩罚 行 */
.morningcfg-row, .badgecfg-row, .rpcfg-row { display: flex; align-items: center; gap: 8px; background: var(--pink-card); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; box-shadow: var(--shadow-card); flex-wrap: wrap; }
.morningcfg-icon, .badgecfg-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.mc-text { flex: 1; min-width: 100px; }
.mc-points-wrap { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--text-light); }
.mc-points-input { width: 64px; border: 2px solid var(--pink-border); border-radius: 10px; padding: 6px 8px; font-size: 13px; }
.bdg-subject { border: 2px solid var(--pink-border); border-radius: 10px; padding: 6px 8px; font-size: 13px; font-family: var(--font-main); }
.bdg-threshold { width: 80px; border: 2px solid var(--pink-border); border-radius: 10px; padding: 6px 8px; font-size: 13px; }
.rp-emoji-input { width: 56px; border: 2px solid var(--pink-border); border-radius: 10px; padding: 6px 8px; font-size: 14px; text-align: center; }
.rpcfg-block { margin-bottom: 16px; }

/* 徽章详情弹窗 */
.badge-detail-card { text-align: center; }
.badge-detail-icon { font-size: 70px; }
.badge-detail-icon img { width: 90px; height: 90px; border-radius: 50%; object-fit: contain; }
.badge-detail-status { font-size: 16px; font-weight: 800; color: var(--pink-deep); margin: 8px 0 14px; }
