/* 学生端样式：手机优先 */
:root {
  --primary: #4f6ef7;
  --primary-dark: #3b5bdb;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(17, 24, 39, .06), 0 4px 14px rgba(17, 24, 39, .05);
  --math: #3b82f6;
  --phys: #f59e0b;
  --chem: #10b981;
  --other: #6366f1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 640px; margin: 0 auto; padding: 18px 16px 48px; }

/* 加载与错误状态 */
.loading { text-align: center; padding: 80px 20px; color: var(--muted); }
.loading .spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  text-align: center; padding: 60px 24px; margin-top: 40px;
}
.error-box .icon { font-size: 44px; }
.error-box h2 { font-size: 18px; margin: 12px 0 6px; }
.error-box p { color: var(--muted); font-size: 14px; }

/* 顶部学生信息卡 */
.hero {
  background: linear-gradient(135deg, #5b7cfa 0%, #4353c9 100%);
  border-radius: 18px; color: #fff; padding: 26px 22px; box-shadow: var(--shadow);
}
.hero .hello { font-size: 13px; opacity: .85; }
.hero h1 { font-size: 26px; margin: 2px 0 12px; letter-spacing: .5px; }
.hero .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .25);
  padding: 3px 12px; border-radius: 999px; font-size: 13px;
}

/* 卡片与分节 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.section-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-title .bar { width: 4px; height: 16px; border-radius: 2px; background: var(--primary); }

/* 科目筛选 chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  padding: 4px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 科目徽章 */
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; color: #fff; vertical-align: middle; white-space: nowrap; }

/* 老师寄语 */
.note-body { font-size: 15px; white-space: pre-wrap; color: #374151; }

/* 待完成作业 */
.hw-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.hw-item:last-child { border-bottom: none; }
.hw-item .dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; margin-top: 8px; flex-shrink: 0; }
.hw-item .meta { font-size: 12px; color: var(--muted); }
.hw-item .text { font-size: 14.5px; }

/* 成绩表 */
.score-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
.score-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.score-table td { padding: 8px 4px; border-bottom: 1px solid #f3f4f6; }
.score-table tr:last-child td { border-bottom: none; }
.pct-good { color: #10b981; font-weight: 600; }
.pct-mid { color: #f59e0b; font-weight: 600; }
.pct-low { color: #ef4444; font-weight: 600; }

.chart-wrap { margin-top: 4px; }
.chart-svg { width: 100%; height: auto; display: block; }

/* 课时时间线 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: #e8eaf1; border-radius: 2px; }
.session { position: relative; padding-bottom: 18px; }
.session:last-child { padding-bottom: 2px; }
.session::before {
  content: ''; position: absolute; left: -22px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--primary);
}
.session .date { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session .topic { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.session .comment { font-size: 14px; color: #374151; white-space: pre-wrap; }
.session .hw { margin-top: 8px; font-size: 13.5px; background: #f8f9fc; border-radius: 8px; padding: 8px 10px; color: #4b5563; }
.session .hw .done { color: #10b981; }
.session .hw .pending { color: #f59e0b; }

.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 14px 0; }

footer.site-footer { text-align: center; color: #9ca3af; font-size: 12.5px; margin-top: 28px; }
