/* ============================================
   四年级学习工作台 - 样式
   设计原则：
   - 莫兰迪色调，孩子友好
   - 圆角卡片，移动端优先
   - 字号偏大（适合4年级），点击区域 ≥44px
   ============================================ */

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

:root {
  /* 8 科配色 */
  --c-chinese: #7FA8C9;
  --c-math:    #E29B6F;
  --c-english: #5BA88E;
  --c-pe:      #A0C36F;
  --c-reading: #B58FB8;
  --c-science: #5DAFC2;
  --c-morality:#D4A668;
  --c-chores:  #C58A82;
  --c-reward:  #E8B14F;

  /* 全局色 */
  --bg:        #F4F1EC;       /* 米色背景，孩子不刺眼 */
  --bg-card:   #FFFFFF;
  --bg-soft:   #FBF9F5;
  --text:      #1A1A1A;
  --text-soft: #4A4A4A;
  --text-light:#7A7A7A;
  --border:    #E5DFD2;
  --shadow:    0 2px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 6px 24px rgba(0,0,0,0.08);

  /* 间距 */
  --gap: 14px;
  --gap-lg: 20px;
  --radius: 14px;
  --radius-lg: 18px;

  /* 顶部导航 */
  --topbar-h: 60px;
  --bottombar-h: 64px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

body {
  padding-top: var(--topbar-h);
  padding-bottom: var(--bottombar-h);
}

/* ============ 顶部栏 ============ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 4px; }

.hamburger {
  background: none; border: none;
  width: 38px; height: 38px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 4px;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.user-card {
  display: flex; align-items: center; gap: 8px;
}
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5BA88E, #5DAFC2);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
}
.user-meta { display: flex; flex-direction: column; }
.user-title { font-weight: 600; font-size: 14px; }
.user-sub { font-size: 12px; color: var(--text-soft); font-weight: 500; }

.topbar-btn {
  background: none; border: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.topbar-btn:active { background: var(--bg-soft); }

/* ============ 侧边栏 ============ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 280px;
  height: 100%;
  background: #2A3744;
  color: #fff;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(.22,.61,.36,1);
  display: flex; flex-direction: column;
  padding: 16px 0;
}
.sidebar.open { transform: translateX(0); }

.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #5BA88E, #5DAFC2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600;
}
.logo-text { font-size: 16px; font-weight: 600; }

.sidebar-nav {
  list-style: none;
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
}
.sidebar-nav li {
  display: flex; align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s;
}
.sidebar-nav li:hover { background: rgba(255,255,255,0.04); }
.sidebar-nav li.active {
  background: rgba(255,255,255,0.08);
  position: relative;
}
.sidebar-nav li.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--subject-color, #5BA88E);
}
.sidebar-nav .icon-box {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  background: var(--subject-color, #5BA88E);
  color: #fff;
  font-size: 13px;
}
.sidebar-nav .badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
}
.badge.prefer { background: rgba(91,168,142,0.3); color: #A8E0C5; }
.badge.weak   { background: rgba(226,155,111,0.3); color: #F5C7A5; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  display: flex; flex-direction: column; gap: 6px;
}
.streak-mini, .points-mini {
  display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.7);
}

/* ============ 主内容 ============ */
.content {
  padding: var(--gap) 14px calc(var(--gap) + var(--bottombar-h)) 14px;
  min-height: calc(100vh - var(--topbar-h) - var(--bottombar-h));
}

/* 卡片 */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: var(--gap);
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--text);
}

.card-title .badge-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: #F0EBE0;
  color: var(--text-soft);
  font-weight: 600;
}

/* ============ 首页 ============ */
.greeting-banner {
  background: linear-gradient(135deg, #5BA88E 0%, #5DAFC2 100%);
  color: #fff;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--gap);
  box-shadow: var(--shadow-lg);
}
.greeting-banner h2 {
  font-size: 19px;
  margin-bottom: 4px;
}
.greeting-banner .meta {
  font-size: 13px;
  opacity: 1;
  color: rgba(255,255,255,0.95);
  font-weight: 600;
  margin-bottom: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: var(--gap);
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-num { font-size: 26px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-soft); margin-top: 4px; font-weight: 500; }

/* 进度条 */
.progress-bar {
  height: 8px;
  background: var(--bg-soft);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5BA88E, #5DAFC2);
  border-radius: 4px;
  transition: width 0.3s;
}
.progress-text {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  display: flex; justify-content: space-between;
  margin-bottom: 6px;
}

/* 任务完成度网格（首页） */
.subject-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.subject-cell {
  background: #F0EBE0;
  padding: 10px 4px;
  border-radius: 10px;
  text-align: center;
  transition: background 0.15s;
}
.subject-cell:active { background: #E0D9C8; }
.subject-cell .icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  margin: 0 auto 4px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.subject-cell .name { font-size: 12px; color: var(--text); font-weight: 600; }
.subject-cell .pct  {
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
  filter: saturate(1.6) brightness(0.85);
}

/* 今日内容速览列表（首页） */
.overview-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 2px;
}
.overview-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.overview-list li:last-child { border-bottom: 0; }
.overview-list .ov-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.overview-list .ov-text { flex: 1; }
.overview-list .ov-text .main { font-weight: 600; font-size: 14px; color: var(--text); }
.overview-list .ov-text .sub { font-size: 12px; color: var(--text-soft); margin-top: 3px; font-weight: 500; }
.overview-list .ov-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: transparent;
  font-size: 14px;
}
.overview-list .ov-check.done {
  background: #5BA88E;
  border-color: #5BA88E;
  color: #fff;
}

/* 心情能量 */
.mood-bar {
  display: flex; gap: 8px;
  justify-content: space-around;
  padding: 6px 0;
}
.mood-btn {
  flex: 1;
  background: none;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 8px 4px;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
  font-weight: 600;
}
.mood-btn span { color: var(--text); font-weight: 600; font-size: 11px; }
.mood-btn.selected {
  border-color: #5BA88E;
  background: rgba(91,168,142,0.1);
}

/* ============ 科目页 ============ */
.subject-hero {
  background: var(--subject-color, #5BA88E);
  color: #fff;
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--gap);
  box-shadow: var(--shadow-lg);
}
.subject-hero .tag-row { display: flex; gap: 6px; margin-bottom: 8px; }
.subject-hero .tag {
  background: rgba(255,255,255,0.25);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
}
.subject-hero h1 { font-size: 22px; margin-bottom: 4px; }
.subject-hero .slogan { font-size: 13px; opacity: 0.9; margin-bottom: 12px; }
.subject-hero .stats-mini {
  display: flex; gap: 16px;
  font-size: 12px; opacity: 0.95;
}

.task-list { list-style: none; }
.task-item {
  display: flex; align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: 0; }
.task-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: transparent;
  font-size: 14px;
  background: transparent;
  transition: all 0.15s;
}
.task-check.done {
  background: var(--subject-color, #5BA88E);
  border-color: var(--subject-color, #5BA88E);
  color: #fff;
}
.task-check.done::after {
  content: '✓';
  font-size: 14px;
  font-weight: 700;
}
.task-body { flex: 1; min-width: 0; }
.task-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: text-decoration 0.15s;
}
.task-title.done {
  text-decoration: line-through;
  color: var(--text-light);
}
.task-sub {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 3px;
  line-height: 1.45;
}
.task-points {
  font-size: 11px;
  font-weight: 600;
  color: var(--subject-color, #5BA88E);
  background: var(--subject-accent, #E6F4EE);
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.add-task-btn {
  width: 100%;
  background: var(--bg-soft);
  border: 2px dashed #D5CCB8;
  border-radius: 10px;
  padding: 12px;
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
  margin-top: 12px;
  font-weight: 500;
}
.add-task-btn:active { background: #F0EBE0; }

/* 小贴士 */
.tips-card .tip-row {
  display: flex; gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
}
.tips-card .tip-num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--subject-color, #5BA88E);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

/* 知识卡片（科学/数学 等丰富内容） */
.knowledge-card .kn-row {
  display: flex; gap: 10px;
  padding: 8px 0;
  font-size: 13px;
}
.kn-icon {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--subject-accent, #E6F4EE);
  color: var(--subject-color, #5BA88E);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.knowledge-card .kn-row > div:last-child { color: var(--text); font-size: 14px; line-height: 1.5; }

/* ============ 伴鱼课表 ============ */
.banana-card {
  border: 1px solid #B8E5D5;
  background: linear-gradient(180deg, #F0FBF6 0%, #FFFFFF 100%);
}
.banana-info { margin-bottom: 10px; }
.banana-meta {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
  font-weight: 500;
}
.banana-dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 8px;
}
.banana-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #E5DFD2;
  border: 2px solid #C5C5C5;
}
.banana-dot.past {
  background: var(--c-english);
  border-color: var(--c-english);
}
.banana-dot.today {
  background: #FFF;
  border-color: var(--c-english);
  box-shadow: 0 0 0 3px rgba(91,168,142,0.25);
  width: 16px; height: 16px;
}
.banana-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.banana-legend span::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.banana-legend .past::before { background: var(--c-english); }
.banana-legend .today::before { background: #FFF; border: 2px solid var(--c-english); box-sizing: border-box; }
.banana-legend .future::before { background: #E5DFD2; }
.banana-today {
  background: var(--c-english);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-top: 8px;
}
.banana-next {
  background: rgba(91,168,142,0.08);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  margin-top: 8px;
}
.banana-more {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
  vertical-align: middle;
}

/* ============ 伴鱼编辑面板 ============ */
.banana-editor { max-width: 720px; margin: 0 auto; }
.editor-header { padding: 0 4px 16px; }
.editor-header h2 { font-size: 22px; margin-bottom: 4px; }
.editor-header p { font-size: 13px; color: var(--text-soft); margin-bottom: 12px; }
.back-btn {
  background: var(--bg-soft);
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 12px;
}
.back-btn:active { background: #E0D9C8; }

.time-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
}
.time-row label { font-weight: 600; }
.time-row input[type="time"] {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 16px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
}
.time-row .hint { font-size: 12px; color: var(--text-soft); }

.month-list { display: flex; flex-direction: column; gap: 12px; }
.month-block {
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 12px;
}
.month-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.month-header strong { font-size: 15px; min-width: 40px; }
.month-count {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
}
.month-add {
  margin-left: auto;
  background: var(--c-english);
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.lesson-list {
  display: flex; flex-direction: column; gap: 6px;
}
.lesson-row {
  display: flex; gap: 6px;
  align-items: center;
}
.lesson-row input[type="date"] {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
}
.lesson-del {
  background: #E07B5C;
  color: #fff;
  border: none;
  width: 28px; height: 28px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.lesson-empty {
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  padding: 8px 0;
  font-style: italic;
}

.editor-actions {
  display: flex; gap: 10px;
  flex-wrap: wrap;
}
.btn-primary, .btn-secondary, .btn-danger {
  flex: 1;
  min-width: 120px;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: var(--c-english);
  color: #fff;
}
.btn-secondary {
  background: var(--bg-soft);
  color: var(--text);
}
.btn-danger {
  background: #fff;
  color: #E07B5C;
  border: 1px solid #E07B5C;
}

/* ============ 假期编辑 ============ */
.holiday-editor { max-width: 720px; margin: 0 auto; }
.holiday-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.holiday-row {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg-soft);
  padding: 8px 10px;
  border-radius: 10px;
}
.holiday-label {
  flex: 1;
  min-width: 80px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
}
.holiday-from, .holiday-to {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
}
.holiday-row .arrow {
  color: var(--text-soft);
  font-weight: 700;
  font-size: 16px;
}
@media (max-width: 600px) {
  .holiday-row {
    flex-wrap: wrap;
  }
  .holiday-label { width: 100%; flex: none; }
  .holiday-from, .holiday-to { flex: 1; min-width: 110px; }
}

.single-day-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.single-day-row {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg-soft);
  padding: 8px 10px;
  border-radius: 10px;
}
.sd-label {
  flex: 1;
  min-width: 80px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
}
.sd-date, .sd-type {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
}
@media (max-width: 600px) {
  .single-day-row {
    flex-wrap: wrap;
  }
  .sd-label { width: 100%; flex: none; }
  .sd-date, .sd-type { flex: 1; min-width: 110px; }
}

/* 伴鱼任务的待办上打个标记 */
.task-item .task-body .task-title:has(+ .task-sub:contains("伴鱼")) {
  /* noop */
}
.task-points.banana {
  background: var(--c-english) !important;
  color: #fff !important;
}
.task-points.ket {
  background: #8E44AD !important;
  color: #fff !important;
}
.task-item.task-custom {
  background: linear-gradient(90deg, #FCF3DF 0%, transparent 100%);
  border-radius: 8px;
  position: relative;
}
.task-item .task-del {
  background: transparent;
  border: none;
  color: var(--text-light);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 4px;
}
.task-item .task-del:hover {
  background: rgba(224, 123, 92, 0.15);
  color: #E07B5C;
}
.task-item .task-edit {
  background: transparent;
  border: none;
  color: var(--text-light);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: 2px;
}
.task-item .task-edit:hover {
  background: rgba(91,168,142,0.15);
  color: var(--c-english);
}

/* 长按菜单 */
#task-menu-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.task-menu-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  animation: fadeIn 0.2s;
}
.task-menu-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 16px;
  width: 90%;
  max-width: 360px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 18px 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  animation: fadeIn 0.2s;
}
.task-menu-hint {
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
  margin-bottom: 14px;
  font-weight: 600;
}
.task-menu-field {
  margin-bottom: 12px;
}
.task-menu-field label {
  display: block;
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 4px;
  font-weight: 600;
}
.task-menu-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-soft);
  color: var(--text);
  box-sizing: border-box;
}
.task-menu-primary {
  display: block;
  width: 100%;
  border: none;
  background: var(--c-english);
  color: #fff;
  border-radius: 10px;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  font-family: inherit;
}
.task-menu-secondary {
  display: block;
  width: 100%;
  border: 1.5px solid var(--c-english);
  background: #fff;
  color: var(--c-english);
  border-radius: 10px;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  font-family: inherit;
}
.task-menu-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.task-menu-pts {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 14px;
}
.task-menu-section {
  margin-bottom: 14px;
}
.task-menu-label {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 6px;
}
.task-menu-pts-row {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.task-menu-pts-row button {
  flex: 1;
  min-width: 48px;
  border: 2px solid var(--border);
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.task-menu-pts-row button:hover { border-color: var(--c-english); background: rgba(91,168,142,0.1); }
.task-menu-danger {
  display: block;
  width: 100%;
  border: 2px solid #E07B5C;
  background: #fff;
  color: #E07B5C;
  border-radius: 10px;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  font-family: inherit;
}
.task-menu-cancel {
  display: block;
  width: 100%;
  border: none;
  background: var(--bg-soft);
  color: var(--text-soft);
  border-radius: 10px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.points-hero {
  background: linear-gradient(135deg, #E8B14F, #D4A668);
  color: #fff;
  padding: 24px 16px;
  border-radius: var(--radius-lg);
  text-align: center;
  margin-bottom: var(--gap);
  box-shadow: var(--shadow-lg);
}
.points-hero .label { font-size: 13px; opacity: 0.9; }
.points-hero .big-num { font-size: 48px; font-weight: 700; margin: 4px 0; }
.points-hero .meta { font-size: 12px; opacity: 0.85; }

.rules-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 8px;
}
.rules-list li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
}
.rules-list li::before {
  content: '·';
  color: #5BA88E;
  font-size: 24px;
  line-height: 0;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.shop-item {
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
  font-size: 12px;
  position: relative;
}
.shop-item .ic {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--c-reward);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px;
  font-size: 16px;
  font-weight: 600;
}
.shop-item .cost {
  color: var(--c-reward);
  font-weight: 600;
  margin: 4px 0;
}
.shop-item .btn {
  width: 100%;
  border: none;
  background: var(--c-reward);
  color: #fff;
  padding: 5px 0;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}
.shop-item .btn:disabled {
  background: #D0D0D0;
  cursor: not-allowed;
}
.shop-item.shop-custom {
  background: linear-gradient(135deg, #FCF3DF 0%, #F0F4F8 100%);
  border: 1px dashed #E8B14F;
  position: relative;
}
.shop-item .btn-custom-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(224, 123, 92, 0.85);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  font-weight: 700;
}

/* ============ 底部导航 ============ */
.bottombar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottombar-h);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-btn {
  flex: 1;
  background: none;
  border: none;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  font-size: 10px;
  color: var(--text-soft);
  cursor: pointer;
}
.bottom-btn .bi {
  font-size: 20px;
  font-weight: 600;
}
.bottom-btn.active {
  color: var(--c-english);
}
.bottom-btn.active .bi {
  background: rgba(91,168,142,0.15);
  border-radius: 8px;
  padding: 2px 10px;
}

/* 遮罩 */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.overlay.show { opacity: 1; pointer-events: auto; }

/* ============ 平板适配 ============ */
@media (min-width: 768px) {
  :root {
    --topbar-h: 64px;
    --bottombar-h: 0px;
  }
  body { padding-bottom: var(--gap); }
  .bottombar { display: none; }

  .content {
    max-width: 920px;
    margin: 0 auto;
    padding: 20px;
  }

  .topbar {
    padding: 0 24px;
  }

  .subject-progress {
    grid-template-columns: repeat(8, 1fr);
  }

  .shop-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 1024px) {
  body {
    padding-left: 0;
  }
  .sidebar {
    transform: translateX(0);
    width: 220px;
  }
  .content {
    margin-left: 220px;
    max-width: none;
  }
  .hamburger { display: none; }
  .overlay { display: none; }
}

/* ============ 动画 ============ */
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.pop { animation: pop 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.25s ease; }