/* ════════════════════════════════════════════════════════════════
   每日作业清单 — 可爱风格样式表
   ════════════════════════════════════════════════════════════════ */

/* ——— 基础变量 ——— */
:root {
  --bg-cream: #fffaf3;
  --bg-warm: #fff5e9;
  --card-bg: #ffffff;
  --text-main: #4a3f35;
  --text-soft: #8a7d70;
  --text-pinyin: #b0a090;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 4px 16px rgba(180, 160, 130, 0.12);
  --shadow-hover: 0 6px 24px rgba(180, 160, 130, 0.2);

  /* 科目颜色 */
  --pink-light: #fff0f3;
  --pink-main: #ff8fab;
  --pink-dark: #e85d7a;
  --blue-light: #f0f7ff;
  --blue-main: #6cbef8;
  --blue-dark: #3a9ae0;
  --green-light: #f0faf3;
  --green-main: #6dd99a;
  --green-dark: #3cb874;
  --orange-light: #fff8f0;
  --orange-main: #ffb066;
  --orange-dark: #e88a3a;

  /* 标签颜色 */
  --tag-online: #e3f2fd;
  --tag-online-t: #1565c0;
  --tag-parent: #fff3e0;
  --tag-parent-t: #e65100;
  --tag-paper: #f3e5f5;
  --tag-paper-t: #7b1fa2;
  --tag-home: #e8f5e9;
  --tag-home-t: #2e7d32;
  --tag-must: #ffebee;
  --tag-must-t: #c62828;
  --tag-group: #e0f7fa;
  --tag-group-t: #00838f;
  --tag-done: #f5f5f5;
  --tag-done-t: #616161;
}

/* ——— 重置 ——— */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(160deg, var(--bg-cream), var(--bg-warm));
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ——— 布局 ——— */
#app {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

/* ——— 头部 ——— */
.header {
  text-align: center;
  padding: 24px 16px 16px;
  position: relative;
}

.school-info {
  font-size: 15px;
  color: var(--text-soft);
  margin-bottom: 6px;
  font-weight: 500;
}

.title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 18px;
  letter-spacing: 2px;
}

.title ruby rt {
  font-size: 11px;
}

/* ——— 日期导航 ——— */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}

.nav-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.25s;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
}

.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.date-display {
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 24px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
}

.date-display:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

/* ——— 控制按钮 ——— */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pinyin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  background: #e8f5e9;
  color: #2e7d32;
}

.pinyin-toggle.off {
  background: #f0f0f0;
  color: #999;
}

.pinyin-toggle .toggle-icon {
  font-size: 18px;
}

.read-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  background: #e3f2fd;
  color: #1565c0;
}

.read-all-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }

.read-all-btn.speaking {
  background: #ffebee;
  color: #c62828;
  animation: pulse-btn 1s ease-in-out infinite;
}

@keyframes pulse-btn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ——— 日历弹窗 ——— */
.calendar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.25);
  z-index: 100;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
}

.calendar-overlay.show { display: flex; }

.calendar-popup {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  padding: 20px;
  width: 320px;
  max-width: 90vw;
  animation: pop-in 0.25s ease;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.9) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.cal-nav {
  width: 32px; height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--bg-warm);
  cursor: pointer;
  font-size: 16px;
  color: var(--text-soft);
  transition: all 0.2s;
}

.cal-nav:hover { background: var(--pink-light); }

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

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

.cal-weekday {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 6px 0;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-main);
  cursor: default;
  transition: all 0.2s;
}

.cal-day.empty { visibility: hidden; }

.cal-day.has-data {
  background: var(--pink-light);
  color: var(--pink-dark);
  font-weight: 700;
  cursor: pointer;
}

.cal-day.has-data:hover {
  background: var(--pink-main);
  color: white;
  transform: scale(1.08);
}

.cal-day.selected {
  background: var(--pink-dark) !important;
  color: white !important;
}

/* ——— 内容区 ——— */
.content {
  margin-top: 20px;
}

.content > * {
  animation: fade-up 0.4s ease;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ——— 科目卡片 ——— */
.subject-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow 0.3s;
}

.subject-card:hover { box-shadow: var(--shadow-hover); }

.subject-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  transition: filter 0.2s;
}

.subject-header:hover { filter: brightness(0.95); }

.subject-card[data-color="pink"] .subject-header {
  background: linear-gradient(135deg, var(--pink-light), #ffe0e8);
}
.subject-card[data-color="blue"] .subject-header {
  background: linear-gradient(135deg, var(--blue-light), #e0f0ff);
}
.subject-card[data-color="green"] .subject-header {
  background: linear-gradient(135deg, var(--green-light), #e0f5e8);
}
.subject-card[data-color="orange"] .subject-header {
  background: linear-gradient(135deg, var(--orange-light), #fff0e0);
}

.subject-icon { font-size: 26px; }

.subject-name {
  font-size: 20px;
  font-weight: 700;
}

.subject-name ruby rt { font-size: 10px; }

.subject-summary {
  font-size: 14px;
  color: var(--text-soft);
  margin-left: auto;
  font-weight: 500;
}

.subject-summary ruby rt { font-size: 9px; }

.subject-read-btn {
  border: none;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.subject-read-btn:hover { transform: scale(1.15); background: rgba(255,255,255,0.9); }

/* ——— 课堂内容 ——— */
.class-note {
  margin: 0 16px;
  padding: 12px 16px;
  background: var(--blue-light);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-soft);
  line-height: 2;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 12px;
}

.class-note:hover { background: #e0f0ff; }

.class-note-label {
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 4px;
  font-size: 13px;
}

/* ——— 任务列表 ——— */
.task-list {
  padding: 12px 16px 16px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s;
  margin-bottom: 8px;
  border: 2px solid transparent;
}

.task-item:hover {
  background: var(--bg-warm);
}

.task-item.speaking {
  border-color: var(--pink-main);
  background: var(--pink-light);
  animation: glow 1.2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,143,171,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(255,143,171,0); }
}

.task-item.important {
  background: #fff5f5;
  border: 2px dashed var(--pink-main);
}

.task-item.important:hover {
  background: #ffebee;
}

.task-number {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
}

.subject-card[data-color="pink"] .task-number { background: var(--pink-light); color: var(--pink-dark); }
.subject-card[data-color="blue"] .task-number { background: var(--blue-light); color: var(--blue-dark); }
.subject-card[data-color="green"] .task-number { background: var(--green-light); color: var(--green-dark); }
.subject-card[data-color="orange"] .task-number { background: var(--orange-light); color: var(--orange-dark); }

.task-body {
  flex: 1;
  min-width: 0;
}

.task-text {
  font-size: 16px;
  line-height: 2.4;
  color: var(--text-main);
  transition: line-height 0.3s;
}

.no-pinyin .task-text { line-height: 1.8; }

.task-text ruby rt {
  font-size: 11px;
  color: var(--text-pinyin);
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

.no-pinyin rt { display: none; }

.task-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.task-tag ruby rt { font-size: 8px; }

/* 标签颜色 */
.task-tag[data-tag="线上交"] { background: var(--tag-online); color: var(--tag-online-t); }
.task-tag[data-tag="家长督促"] { background: var(--tag-parent); color: var(--tag-parent-t); }
.task-tag[data-tag="纸质作业"] { background: var(--tag-paper); color: var(--tag-paper-t); }
.task-tag[data-tag="在家练习"] { background: var(--tag-home); color: var(--tag-home-t); }
.task-tag[data-tag="必带"] { background: var(--tag-must); color: var(--tag-must-t); }
.task-tag[data-tag="群内接龙"] { background: var(--tag-group); color: var(--tag-group-t); }
.task-tag[data-tag="已反馈"] { background: var(--tag-done); color: var(--tag-done-t); }

.task-speak-icon {
  flex-shrink: 0;
  font-size: 18px;
  opacity: 0.35;
  transition: all 0.2s;
  margin-top: 2px;
}

.task-item:hover .task-speak-icon { opacity: 0.7; }

.task-item.speaking .task-speak-icon {
  opacity: 1;
  animation: bounce-icon 0.6s ease-in-out infinite;
}

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

/* ——— 重点速览 ——— */
.highlights {
  background: linear-gradient(135deg, #fffde7, #fff9c4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 2px solid #ffe082;
}

.highlights-title {
  font-size: 20px;
  font-weight: 700;
  color: #f57f17;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.highlights-title ruby rt { font-size: 10px; }

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.25s;
  line-height: 2.2;
}

.no-pinyin .highlight-item { line-height: 1.8; }

.highlight-item:hover {
  background: white;
  transform: translateX(4px);
}

.highlight-item.speaking {
  background: white;
  box-shadow: 0 0 0 2px #ffe082;
}

.highlight-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }

.highlight-label {
  font-weight: 700;
  color: #e65100;
  font-size: 15px;
}

.highlight-label ruby rt { font-size: 9px; }

.highlight-text {
  color: var(--text-main);
  font-size: 15px;
}

.highlight-text ruby rt { font-size: 10px; }

/* ——— 活动通知 ——— */
.activity {
  background: linear-gradient(135deg, #f3e5f5, #fce4ec);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 2px solid #ce93d8;
}

.activity-title {
  font-size: 19px;
  font-weight: 700;
  color: #7b1fa2;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 2.2;
}

.no-pinyin .activity-title { line-height: 1.6; }

.activity-title ruby rt { font-size: 10px; }

.activity-subtitle {
  font-size: 14px;
  color: #9c27b0;
  margin-bottom: 12px;
  line-height: 2;
}

.no-pinyin .activity-subtitle { line-height: 1.6; }

.activity-subtitle ruby rt { font-size: 9px; }

.activity-items {
  list-style: none;
  padding: 0;
}

.activity-item {
  padding: 8px 14px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 15px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 2.2;
}

.no-pinyin .activity-item { line-height: 1.7; }

.activity-item:hover { background: white; }

.activity-item ruby rt { font-size: 10px; }

.activity-footer {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.5);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #7b1fa2;
  font-weight: 500;
  cursor: pointer;
  line-height: 2.2;
}

.no-pinyin .activity-footer { line-height: 1.6; }

.activity-footer ruby rt { font-size: 9px; }

/* ——— 提醒 ——— */
.reminder {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 2px solid #81c784;
  cursor: pointer;
  transition: all 0.25s;
}

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

.reminder-title {
  font-size: 18px;
  font-weight: 700;
  color: #2e7d32;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reminder-title ruby rt { font-size: 10px; }

.reminder-text {
  font-size: 16px;
  color: var(--text-main);
  line-height: 2.4;
}

.no-pinyin .reminder-text { line-height: 1.8; }

.reminder-text ruby rt { font-size: 11px; color: var(--text-pinyin); }

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

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

/* ——— 页脚 ——— */
.footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-soft);
  font-size: 14px;
}

/* ——— 响应式 ——— */
@media (max-width: 600px) {
  .title { font-size: 24px; }
  .subject-name { font-size: 18px; }
  .subject-summary { display: none; }
  .task-text { font-size: 15px; }
  .highlight-text { font-size: 14px; }
  .nav-btn { width: 36px; height: 36px; }
  .date-display { padding: 8px 16px; font-size: 15px; }
  .controls { gap: 8px; }
  .pinyin-toggle, .read-all-btn { padding: 7px 14px; font-size: 14px; }
}
