/* ===== 暑假打卡乐园 · 按设计稿还原 ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'ZCOOL KuaiLe', 'PingFang SC', 'Noto Sans SC', 'Hiragino Sans GB', sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  background: linear-gradient(180deg, #FDF6EC 0%, #F1E9D8 100%);
  color: #4A3B32;
}
.hand { font-family: 'ZCOOL KuaiLe', 'PingFang SC', cursive; }
.num  { font-family: 'Baloo 2', 'Avenir Next', 'PingFang SC', sans-serif; }

#app { min-height: 100dvh; display: flex; flex-direction: column; position: relative; }

/* ---- 顶部品牌栏 ---- */
.brand-bar {
  flex: none; text-align: center; padding: 14px 0 10px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: rgba(253, 246, 236, .9); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 10; border-bottom: 1px solid #EADFC6;
}
.brand-title { font-family: 'ZCOOL KuaiLe', 'PingFang SC', cursive; font-size: 22px; color: #E86B4C; }

/* ---- 内容区 ---- */
.content {
  flex: 1; overflow-y: auto; padding: 18px 18px 110px;
  max-width: 760px; margin: 0 auto; width: 100%;
}

/* ---- 状态卡 ---- */
.status-card {
  background: linear-gradient(135deg, #FFC98A, #EE7E63);
  border-radius: 26px; padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 14px 30px -18px rgba(238, 126, 99, .6);
}
.level-circle {
  flex: none; width: 60px; height: 60px; border-radius: 50%; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.level-circle .lv { font-weight: 800; font-size: 13px; color: #E86B4C; }
.level-circle .medal { font-size: 18px; }
.status-mid { flex: 1; min-width: 0; }
.level-title { color: #fff; font-weight: 700; font-size: 14px; }
.level-track { background: rgba(255,255,255,.4); border-radius: 999px; height: 9px; margin-top: 6px; overflow: hidden; }
.level-fill  { height: 100%; background: #fff; border-radius: 999px; transition: width .3s; }
.level-hint  { color: #FFF3E6; font-size: 11px; margin-top: 3px; }
.status-stat { flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.status-stat .icon { font-size: 20px; }
.status-stat .val  { color: #fff; font-weight: 800; font-size: 16px; }
.status-stat .cap  { color: #FFF3E6; font-size: 9px; }

/* ---- 日期 + 进度 ---- */
.date-row { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 2px 10px; }
.date-label { font-family: 'ZCOOL KuaiLe', 'PingFang SC', cursive; font-size: 22px; color: #4A3B32; }
.date-progress { font-size: 13px; color: #9A8878; font-weight: 600; }
.day-track { background: #EFE4CC; border-radius: 999px; height: 10px; overflow: hidden; margin-bottom: 16px; }
.day-fill { height: 100%; background: linear-gradient(90deg, #F6B93B, #EE7E63); border-radius: 999px; transition: width .3s; }

/* ---- 任务卡片网格 ---- */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 14px; }
.task-card {
  cursor: pointer; background: #fff; border-radius: 20px; padding: 16px 12px;
  text-align: center; border: 3px solid #EFE4CC;
  box-shadow: 0 8px 18px -14px rgba(74, 59, 50, .35); user-select: none;
  transition: transform .1s;
}
.task-card:active { transform: scale(.94); }
.task-card.done { background: #FDF0E4; border-color: #F0A83C; }
.task-card .t-icon { font-size: 34px; }
.task-card .t-name { font-weight: 700; color: #4A3B32; margin-top: 6px; font-size: 13.5px; }
.task-card .t-pts  { color: #B79A6B; font-size: 11.5px; margin-top: 2px; }
.task-card .t-check {
  margin: 10px auto 0; width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid #DFD2BC; background: transparent;
  display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff;
}
.task-card.done .t-check { border-color: #3FA36B; background: #3FA36B; }

/* ---- 全勤横幅 ---- */
.all-done-banner {
  margin-top: 16px; background: #FFF3D6; border: 2px dashed #F0C15C;
  border-radius: 18px; padding: 14px; text-align: center;
  font-weight: 700; color: #C98A1E; font-size: 14px;
}

/* ---- 最近 7 天 ---- */
.week-card {
  margin-top: 22px; background: #fff; border-radius: 20px; padding: 14px 16px;
  box-shadow: 0 8px 20px -16px rgba(74, 59, 50, .3);
}
.week-title { font-size: 12.5px; color: #9A8878; font-weight: 700; margin-bottom: 10px; }
.week-row { display: flex; justify-content: space-between; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.week-day .w-label { font-size: 11px; color: #B79A6B; font-weight: 700; }
.week-day.today .w-label { color: #E86B4C; }
.week-day .w-dot {
  width: 28px; height: 28px; border-radius: 50%; background: #F4ECDD;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  border: 2px solid transparent;
}
.week-day.today .w-dot { border-color: #E86B4C; }
.week-day.partial .w-dot { background: #FDEEE9; }
.week-day.full .w-dot { background: #F6B93B; }

/* ---- 勋章墙 ---- */
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 2px 16px; }
.page-title { font-family: 'ZCOOL KuaiLe', 'PingFang SC', cursive; font-size: 22px; color: #4A3B32; }
.page-sub { font-size: 13px; color: #9A8878; font-weight: 600; }
.badge-group { margin-bottom: 22px; }
.badge-group-title { font-family: 'ZCOOL KuaiLe', 'PingFang SC', cursive; font-size: 17px; margin-bottom: 10px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 14px; }
.badge { cursor: pointer; text-align: center; }
.badge .b-icon {
  width: 68px; height: 68px; border-radius: 50%; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: #EDE6D6; border: 3px solid #DCCBAA;
  filter: grayscale(1) opacity(.55);
}
.badge.unlocked .b-icon {
  background: linear-gradient(135deg, #FFE2A8, #FFC98A);
  border-color: #F0A83C; filter: none;
  animation: badgeGlow 2.4s ease-in-out infinite;
}
.badge .b-label { font-size: 11px; color: #5C4B3E; margin-top: 6px; font-weight: 500; line-height: 1.25; }
.badge.unlocked .b-label { font-weight: 700; }
.badge .b-sub { font-size: 10px; color: #B7A68F; margin-top: 1px; }
.badge.unlocked .b-sub { color: #3FA36B; }

/* ---- 任务设置 ---- */
.add-btn {
  background: #E86B4C; color: #fff; font-weight: 700; font-size: 13px;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
}
.task-row {
  display: flex; align-items: center; gap: 14px; background: #fff;
  border-radius: 16px; padding: 12px 16px; margin-bottom: 10px;
  box-shadow: 0 6px 16px -12px rgba(74, 59, 50, .3);
}
.task-row .r-icon { font-size: 28px; flex: none; }
.task-row .r-mid { flex: 1; min-width: 0; }
.task-row .r-name { font-weight: 700; color: #4A3B32; font-size: 14px; }
.task-row .r-sub  { color: #B79A6B; font-size: 11.5px; margin-top: 2px; }
.icon-btn {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px;
}
.icon-btn.edit { background: #F4ECDD; }
.icon-btn.del  { background: #FDEEE9; }

/* ---- 底部 Tab 栏 ---- */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex;
  background: #fff; border-top: 1px solid #EADFC6;
  box-shadow: 0 -8px 20px -16px rgba(74, 59, 50, .3); z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; text-align: center; padding: 10px 0 8px; cursor: pointer; color: #B7A68F; }
.tab.active { color: #E86B4C; }
.tab-icon { font-size: 22px; }
.tab-label { font-size: 11px; font-weight: 700; margin-top: 2px; }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; background: #4A3B32; color: #fff;
  padding: 8px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2); z-index: 70;
  animation: floatUp 1.4s ease forwards; pointer-events: none;
}

/* ---- 庆祝 ---- */
.celebrate {
  position: fixed; inset: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center; z-index: 65;
}
.celebrate .emoji { font-size: 100px; animation: popIn .6s ease; }

/* ---- 弹窗 ---- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(74, 59, 50, .55);
  display: flex; align-items: center; justify-content: center; z-index: 80; padding: 20px;
}
.badge-modal { background: #fff; border-radius: 24px; padding: 30px 28px; max-width: 280px; text-align: center; }
.badge-modal .m-icon { font-size: 56px; }
.badge-modal .m-title { font-family: 'ZCOOL KuaiLe', 'PingFang SC', cursive; font-size: 19px; color: #4A3B32; margin-top: 8px; }
.badge-modal .m-sub { color: #9A8878; font-size: 12.5px; margin-top: 6px; }
.badge-modal .m-btn {
  margin-top: 16px; background: #E86B4C; color: #fff; padding: 10px 26px;
  border-radius: 999px; font-weight: 700; display: inline-block; cursor: pointer; font-size: 14px;
}

.task-modal {
  background: #fff; border-radius: 24px; padding: 24px 22px;
  width: 100%; max-width: 340px; max-height: 80vh; overflow-y: auto;
}
.task-modal .f-title { font-family: 'ZCOOL KuaiLe', 'PingFang SC', cursive; font-size: 18px; color: #4A3B32; margin-bottom: 14px; }
.task-modal input[type=text] {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 2px solid #E4D6BE;
  font-size: 14px; font-family: inherit; outline: none;
}
.task-modal .f-section { font-size: 12.5px; color: #9A8878; font-weight: 700; margin: 14px 0 8px; }
.icon-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.icon-choice {
  text-align: center; padding: 8px 0; border-radius: 12px; font-size: 20px;
  cursor: pointer; background: #F8F3E8; border: 2px solid #EFE4CC;
}
.icon-choice.selected { background: #FDEEE9; border-color: #E86B4C; }
.point-row { display: flex; gap: 8px; }
.point-choice {
  flex: 1; text-align: center; padding: 9px 0; border-radius: 12px;
  font-weight: 700; font-size: 13px; cursor: pointer;
  background: #F8F3E8; color: #9A8878; border: 2px solid #EFE4CC;
}
.point-choice.selected { background: #E86B4C; color: #fff; border-color: #E86B4C; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-cancel {
  flex: 1; text-align: center; padding: 11px 0; border-radius: 999px;
  background: #F4ECDD; color: #9A8878; font-weight: 700; cursor: pointer; font-size: 14px;
}
.btn-save {
  flex: 1; text-align: center; padding: 11px 0; border-radius: 999px;
  background: #E86B4C; color: #fff; font-weight: 700; cursor: pointer; font-size: 14px;
}

/* ---- 备份 ---- */
.backup-row { display: flex; gap: 10px; margin-top: 24px; }
.backup-btn {
  flex: 1; text-align: center; padding: 11px 0; border-radius: 14px;
  background: #F4ECDD; color: #8A7358; font-weight: 700; cursor: pointer; font-size: 13px;
  border: 2px solid #EFE4CC;
}
.backup-hint {
  margin-top: 10px; text-align: center; color: #B7A68F; font-size: 11.5px; line-height: 1.5;
}

/* ---- 动画 ---- */
@keyframes floatUp { 0% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, -50px); opacity: 0; } }
@keyframes popIn { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 55% { transform: scale(1.2) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes badgeGlow { 0%, 100% { box-shadow: 0 0 0 rgba(255, 190, 80, .55); } 50% { box-shadow: 0 0 22px rgba(255, 190, 80, .85); } }
