* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 16px 40px 16px;
  color: #1a1a1a;
  background: #f7f8fa;
  line-height: 1.5;
  font-size: 15px;
}
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 12px 0; }
h2 { font-size: 17px; margin: 18px 0 10px 0; }
code { background: #eef1f6; padding: 2px 6px; border-radius: 4px; font-size: 13px; word-break: break-all; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e2e6ed;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.topbar-title { font-weight: 700; font-size: 17px; color: #111; }
.nav-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nav-tab {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 14px;
  color: #333;
  background: #f1f3f7;
  font-weight: 500;
}
.nav-tab.active { background: #111; color: #fff; text-decoration: none; }
.nav-tab.logout { background: transparent; color: #666; }

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
}
.alert.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert.err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.card {
  background: #fff;
  border: 1px solid #e2e6ed;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.stu-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.stu-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.stu-pill {
  padding: 6px 14px;
  border: 1px solid #cfd6e0;
  border-radius: 999px;
  background: #fff;
  color: #222;
  font-size: 14px;
  font-weight: 600;
}
.stu-pill.active { background: #111; color: #fff; border-color: #111; text-decoration: none; }

/* 7 天日期条 */
.week-strip-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
}
.week-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid #d5dbe4;
  border-radius: 8px;
  background: #fff;
  color: #222;
  font-weight: 700;
}
.day-pill {
  flex: 1 1 0;
  min-width: 72px;
  text-align: center;
  padding: 7px 6px;
  border: 1px solid #d5dbe4;
  border-radius: 8px;
  background: #fff;
  color: #222;
}
.day-pill.active { border: 2px solid #111; background: #111; color: #fff; text-decoration: none; }
.day-pill .wd { font-size: 13px; font-weight: 700; display: block; }
.day-pill .dt { font-size: 12px; opacity: 0.8; display: block; }
.day-pill .st { font-size: 12px; margin-top: 2px; display: block; font-weight: 600; }
.day-pill.is-done:not(.active) { background: #f0fdf4; border-color: #86efac; }
.day-pill.is-miss:not(.active) { background: #fff7ed; border-color: #fdba74; }

/* 单选胶囊（免 JS 也能点击选学科与标签） */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px 0; }
.chip { display: inline-block; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid #cfd6e0;
  border-radius: 7px;
  background: #f8f9fb;
  color: #222;
  font-size: 13px;
  font-weight: 500;
}
.chip input:checked + span {
  background: #111;
  color: #fff;
  border-color: #111;
  font-weight: 600;
}

input[type="text"], input[type="number"], input[type="date"], input[type="password"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd3df;
  border-radius: 7px;
  font-size: 14px;
  background: #fff;
  margin-top: 4px;
}
label.field-label { display: block; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 10px; }

.row-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row-inline > * { flex: 1 1 160px; }

.btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #111;
  border-radius: 7px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; font-weight: 500; }
.btn.outline { background: #fff; color: #222; border-color: #cbd3df; }
.btn.danger { background: #fff; color: #b91c1c; border-color: #fca5a5; }
.btn.ok { background: #065f46; border-color: #065f46; color: #fff; }

.subj-block { margin-bottom: 14px; }
.subj-title {
  font-size: 15px;
  font-weight: 700;
  padding: 6px 0;
  border-bottom: 2px solid #111;
  display: flex;
  justify-content: space-between;
}
.task-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 4px;
  border-bottom: 1px solid #eceff4;
}
.task-item.done .t-name { text-decoration: line-through; color: #777; }
.t-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #eef1f6;
  color: #222;
  font-size: 12px;
  font-weight: 600;
  margin-right: 6px;
}
.t-auto { background: #e0f2fe; color: #0369a1; }
.t-meta { font-size: 12px; color: #666; margin-left: 6px; }
.t-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.t-actions form { margin: 0; }

details.fold {
  border: 1px dashed #cbd3df;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0 12px 0;
  background: #fafbfc;
}
details.fold summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #333; }

/* 本周复盘矩阵 */
.matrix-wrap { overflow-x: auto; }
table.matrix { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
table.matrix th, table.matrix td {
  border: 1px solid #e2e6ed;
  padding: 7px 6px;
  text-align: center;
}
table.matrix th { background: #f3f5f8; font-weight: 700; }
table.matrix td.subj-col { text-align: left; font-weight: 700; background: #fafbfc; }
table.matrix td.cell-ok { background: #ecfdf5; color: #065f46; font-weight: 700; }
table.matrix td.cell-warn { background: #fff7ed; color: #9a3412; font-weight: 700; }
table.matrix td.cell-empty { color: #aaa; }
.dur-chips { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.dur-btn {
  padding: 3px 8px;
  border: 1px solid #cbd3df;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}
