:root {
  --bg: linear-gradient(135deg, #fce4ec 0%, #fff3e0 30%, #e8f5e9 60%, #e3f2fd 100%);
  --panel: rgba(255,255,255,0.92);
  --panel-border: rgba(255,182,193,0.3);
  --ink: #2d2d3a;
  --muted: #8888a0;
  --shadow: 0 3px 15px rgba(100,80,140,0.08), 0 8px 30px rgba(80,80,160,0.06);
  --shadow-hover: 0 6px 25px rgba(100,80,140,0.14), 0 12px 40px rgba(80,80,160,0.10);
  --cat-school: #5b7fff;
  --cat-out: #36b37e;
  --cat-personal: #ff8a65;
  --cat-research: #9b59b6;
  --ok: #27ae60;
  --warn: #f39c12;
  --danger: #e74c3c;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  top: -80px; right: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,182,193,0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  bottom: -100px; left: -80px;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(100,200,255,0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

header.topbar {
  background: linear-gradient(135deg, #2d1b69 0%, #4a2c8a 30%, #6b3fa0 70%, #3b1f6e 100%);
  color: #fff;
  padding: 16px 24px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 4px 20px rgba(45,27,105,0.3);
  position: sticky; top: 0; z-index: 30;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
header.topbar h1 {
  font-size: 20px; margin: 0; font-weight: 800;
  letter-spacing: 1px;
  background: rgba(0,0,0,0.15);
  padding: 4px 16px;
  border-radius: 20px;
}
header.topbar .sub { font-size: 12px; opacity: .9; }
header.topbar .spacer { flex: 1; }
header.topbar .datepill {
  background: rgba(255,255,255,0.25);
  padding: 6px 16px; border-radius: 20px; font-size: 13px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.3);
}

nav.tabs {
  position: relative;
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,182,193,0.15);
  box-shadow: 0 2px 12px rgba(200,150,200,0.08);
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  z-index: 20;
}
nav.tabs::-webkit-scrollbar { height: 0; display: none; }
nav.tabs button {
  position: relative; z-index: 2;
  border: none; background: transparent;
  padding: 10px 18px; cursor: pointer;
  font-size: 14px; color: var(--muted); font-weight: 600;
  border-radius: 14px; white-space: nowrap;
  transition: all .3s cubic-bezier(.34,1.25,.5,1);
}
nav.tabs button:hover { transform: translateY(-2px) scale(1.04); }
nav.tabs button.active { color: #fff; }
nav.tabs button[data-view="remind"]   { --c: #ff6b6b; }
nav.tabs button[data-view="overview"] { --c: #20bf6b; }
nav.tabs button[data-view="schedule"] { --c: #9b59b6; }
nav.tabs button[data-view="mooc"]     { --c: #1abc9c; }
nav.tabs button[data-view="stats"]    { --c: #e67e22; }
nav.tabs button[data-view="improve"]  { --c: #1abc9c; }
nav.tabs button[data-view="honor"]    { --c: #f1c40f; }
nav.tabs button[data-view="data"]     { --c: #e84393; }
.tab-indicator {
  position: absolute; z-index: 1; top: 8px; bottom: 8px; left: 0; width: 0; opacity: 0;
  border-radius: 14px;
  transition: transform .34s cubic-bezier(.34,1.25,.5,1), width .34s cubic-bezier(.34,1.25,.5,1), opacity .25s ease;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

main {
  max-width: 1180px; margin: 18px auto; padding: 0 16px 60px;
  position: relative; z-index: 1;
}
.view { display: none; }
.view.active { display: block; animation: bounceIn .4s cubic-bezier(.34,1.25,.5,1); }
@keyframes bounceIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.96); }
  60% { transform: translateY(-2px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.card {
  background: var(--panel);
  border: 1.5px solid var(--panel-border);
  border-radius: 18px; padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 18px;
  backdrop-filter: blur(8px);
  transition: box-shadow .3s ease, transform .3s ease;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card h2 {
  margin: 0 0 14px; font-size: 17px; font-weight: 700;
  background: linear-gradient(135deg, #ff6b6b, #5b7fff, #20bf6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.card h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 700; color: #8888b0; letter-spacing: 0.5px; }

input, select, textarea {
  font-family: inherit; font-size: 14px; padding: 10px 13px;
  border: 2px solid #e8e0f0; border-radius: 12px;
  background: #fff; color: var(--ink); outline: none; min-width: 0;
  transition: border-color .25s ease, box-shadow .25s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102,126,234,0.12);
}
textarea { resize: vertical; min-height: 64px; }

button.btn {
  border: none; border-radius: 14px; padding: 10px 18px; cursor: pointer; font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; letter-spacing: 0.5px;
  transition: all .3s cubic-bezier(.34,1.25,.5,1);
  box-shadow: 0 4px 12px rgba(102,126,234,0.30);
}
button.btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 6px 20px rgba(102,126,234,0.40); }
button.btn:active { transform: translateY(0) scale(0.97); }
button.btn.ghost { background: #f0ecf6; color: #7a6a9a; box-shadow: none; }
button.btn.ghost:hover { background: #e6def0; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(161,140,209,0.12); }
button.btn.sm { padding: 6px 12px; font-size: 12px; border-radius: 10px; }
button.danger { background: linear-gradient(135deg, #ff6b6b, #ee5a24); box-shadow: 0 4px 12px rgba(255,107,107,0.3); }
button.link { background: transparent; color: #5b7fff; border: none; cursor: pointer; padding: 4px 8px; font-size: 13px; font-weight: 600; border-radius: 8px; transition: all .2s; }
button.link:hover { background: rgba(91,127,255,0.1); }
button.link.danger { color: #ff6b6b; }

.tag {
  display: inline-block; padding: 3px 11px; border-radius: 14px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  letter-spacing: 0.3px; border: 1.5px solid transparent;
}
.tag.cat-school { background: #eaf0ff; color: #5b7fff; border-color: #d0ddff; }
.tag.cat-out { background: #e8faf0; color: #36b37e; border-color: #b8e6cc; }
.tag.cat-personal { background: #fef0ea; color: #ff8a65; border-color: #fcd8c9; }
.tag.cat-research { background: #f4ebfa; color: #9b59b6; border-color: #e0caf0; }
.tag.st-ok { background: #e8faf0; color: #27ae60; border-color: #b8e6cc; }
.tag.st-warn { background: #fef6e0; color: #d68910; border-color: #fae5a0; }
.tag.st-danger { background: #fde8e8; color: #e74c3c; border-color: #f5baba; }
.tag.st-muted { background: #f0ecf6; color: #8888a0; border-color: #ddd6e8; }
.tag.mooc { background: #e8faf3; color: #0f9d76; border-color: #b8e6d0; }
.tag.mooc.due { background: #fde8e8; color: #e74c3c; border-color: #f5baba; }

table.grid {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13.5px; border-radius: 14px; overflow: hidden;
}
table.grid th, table.grid td { padding: 10px 12px; text-align: left; vertical-align: top; }
table.grid th {
  background: linear-gradient(135deg, #f8f0ff, #f0e8ff);
  color: #6a5a8a; font-weight: 700;
  position: sticky; top: 0; z-index: 2;
  border-bottom: 2px solid #d8d0e8;
}
table.grid td { border-bottom: 1px solid #f0ecf6; background: rgba(255,255,255,0.6); }
table.grid tr:hover td { background: rgba(161,140,209,0.06); }
table.grid tr:last-child td:first-child { border-radius: 0 0 0 14px; }
table.grid tr:last-child td:last-child { border-radius: 0 0 14px 0; }
.month-head { background: linear-gradient(135deg, #fff0f5, #f0f0ff) !important; font-weight: 700; }
.month-head td { padding: 8px 12px; color: #7a5a9a; font-size: 14px; }
.item-cell { white-space: pre-wrap; max-width: 460px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.warnbox { background: #fef6e0; border: 1.5px solid #fae5a0; color: #8a5a00; padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; }
.okbox { background: #e8faf0; border: 1.5px solid #b8e6cc; color: #0f7a40; padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; }

.sched-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.sched-col {
  background: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(200,180,220,0.3);
  border-radius: 14px; padding: 12px; min-height: 120px;
  backdrop-filter: blur(4px); transition: box-shadow .3s ease;
}
.sched-col:hover { box-shadow: 0 4px 16px rgba(200,180,220,0.2); }
.sched-col.today { border-color: #a18cd1; background: rgba(161,140,209,0.08); box-shadow: 0 0 0 3px rgba(161,140,209,0.12); }
.sched-col .wd { font-weight: 700; margin-bottom: 8px; font-size: 14px; }
.sched-col:nth-child(1) .wd { color: #ff6b6b; }
.sched-col:nth-child(2) .wd { color: #e17055; }
.sched-col:nth-child(3) .wd { color: #5b7fff; }
.sched-col:nth-child(4) .wd { color: #a18cd1; }
.sched-col:nth-child(5) .wd { color: #20bf6b; }
.sched-col:nth-child(6) .wd { color: #f39c12; }
.sched-col:nth-child(7) .wd { color: #e84393; }
.sched-col .cls {
  background: #fff; border: 1px solid #eee6f4; border-left: 3px solid #a18cd1;
  border-radius: 10px; padding: 7px 9px; margin-bottom: 7px; font-size: 12.5px;
}
.sched-col .cls:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.sched-col .cls .sub { color: var(--muted); font-size: 11.5px; }
.sched-col .cls .del { float: right; cursor: pointer; color: #e74c3c; font-size: 12px; }

.mooc-week { border-left: 3px solid #1abc9c; padding: 6px 0 6px 14px; margin-bottom: 4px; }
.reminder-card { border: 1.5px solid rgba(255,182,193,0.2); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: rgba(255,255,255,0.75); transition: box-shadow .3s ease; }
.reminder-card:hover { box-shadow: 0 4px 12px rgba(255,182,193,0.15); }
.reminder-card.alert { border-color: #fae5a0; background: #fffaf5; }
.reminder-card .big { font-size: 15px; font-weight: 700; }

.counts { display: flex; gap: 14px; flex-wrap: wrap; }
.count-box { background: rgba(255,255,255,0.85); border: 1.5px solid rgba(200,180,220,0.2); border-radius: 14px; padding: 14px 18px; min-width: 120px; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .3s ease, transform .3s ease; }
.count-box:hover { box-shadow: 0 6px 20px rgba(200,180,220,0.15); transform: translateY(-2px); }
.count-box .n { font-size: 24px; font-weight: 800; background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.count-box .l { font-size: 12px; color: var(--muted); font-weight: 600; }

.empty { color: var(--muted); text-align: center; padding: 24px; font-style: italic; }
td.cal-cell { padding: 6px 8px; vertical-align: top; font-size: 12px; line-height: 1.5; white-space: pre-wrap; max-width: 120px; min-width: 80px; }

.modal-mask { position: fixed; inset: 0; background: rgba(100,80,140,0.3); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 18px; padding: 22px; width: 440px; max-width: 92vw; box-shadow: 0 10px 40px rgba(100,80,140,0.2); border: 1px solid rgba(200,180,220,0.2); animation: bounceIn .35s cubic-bezier(.34,1.25,.5,1); }
.modal h3 { margin-top: 0; background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-size: 16px; }

.seg { display: inline-flex; border: 2px solid #e8e0f0; border-radius: 12px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); transition: all .2s; }
.seg button:hover { background: #f8f4fc; }
.seg button.active { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }

#calendarNotes { margin-top: 16px; padding: 16px; background: rgba(255,255,255,0.85); border: 1.5px solid var(--panel-border); border-radius: 14px; }
#calendarNotes h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ========== 折叠表单与新增日志按钮 ========== */
.fill-toggle {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s cubic-bezier(.34,1.25,.5,1);
  box-shadow: 0 3px 10px rgba(161,140,209,0.25);
  white-space: nowrap;
}
.fill-toggle:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 5px 16px rgba(161,140,209,0.35);
}
.fill-toggle:active {
  transform: translateY(0) scale(0.97);
}
.fill-form-collapsible {
  border-left: 3px solid #a18cd1;
  animation: slideDown .3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) { main { max-width: 100%; } }
@media (max-width: 920px) { .sched-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px) {
  header.topbar { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  header.topbar h1 { font-size: 16px; }
  header.topbar .sub { width: 100%; order: 3; }
  main { padding: 0 10px 50px; margin-top: 12px; }
  .row .field { flex: 1 1 100% !important; width: 100% !important; }
  .sched-grid { grid-template-columns: repeat(2, 1fr); }
  .item-cell { max-width: 200px; }
  table.grid { min-width: 680px; }
  #overviewTable, #moocList, #remindBody, #schedGrid { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .counts { gap: 10px; }
  .count-box { min-width: 92px; padding: 10px 12px; }
  .count-box .n { font-size: 20px; }
  nav.tabs button { padding: 9px 14px; font-size: 13px; }
}
@media (max-width: 480px) {
  nav.tabs button { padding: 8px 12px; font-size: 12px; }
  .sched-grid { grid-template-columns: 1fr; }
  .seg button { padding: 6px 10px; font-size: 12px; }
  .card { padding: 14px; }
  button.btn { padding: 8px 14px; font-size: 13px; }
}

/* ========== 统计看板 ========== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.stat-card {
  background: rgba(255,255,255,0.85); border: 1.5px solid rgba(200,180,220,0.2);
  border-radius: 14px; padding: 16px; text-align: center;
  transition: box-shadow .3s ease, transform .3s ease;
}
.stat-card:hover { box-shadow: 0 6px 20px rgba(200,180,220,0.15); transform: translateY(-3px); }
.stat-card.bar { grid-column: span 2; }
.stat-num { font-size: 32px; font-weight: 800; background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.stats-loading { text-align: center; padding: 40px; color: var(--muted); font-size: 15px; }

.progress-bar { height: 8px; background: #f0ecf6; border-radius: 10px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, #667eea, #5a67d8); transition: width .6s ease; }

.stats-section { margin-top: 20px; }
.stats-section h3 { font-size: 15px; margin: 0 0 12px; font-weight: 700; color: var(--ink); }

.chart-bars { display: flex; flex-direction: column; gap: 10px; }
.month-chart { flex-direction: row; justify-content: space-around; align-items: flex-end; min-height: 200px; padding-top: 20px; }
.chart-row { display: flex; align-items: center; gap: 12px; }
.chart-label { min-width: 100px; font-size: 13px; font-weight: 600; color: var(--ink); }
.chart-track { flex: 1; height: 28px; background: #f5f0fa; border-radius: 14px; overflow: hidden; }
.chart-fill { height: 100%; border-radius: 14px; transition: width .8s ease; }
.chart-val { min-width: 60px; font-size: 12px; color: var(--muted); text-align: right; }
.chart-fill.cat-学校工作 { background: linear-gradient(90deg, #5b7fff, #7b9aff); }
.chart-fill.cat-校外工作 { background: linear-gradient(90deg, #36b37e, #5cc99a); }
.chart-fill.cat-私人事情 { background: linear-gradient(90deg, #ff8a65, #ffab91); }
.chart-fill.cat-教科研 { background: linear-gradient(90deg, #9b59b6, #be7ad4); }
.chart-fill.st-ok { background: linear-gradient(90deg, #27ae60, #4cd882); }
.chart-fill.st-muted { background: linear-gradient(90deg, #a18cd1, #c3b0e0); }
.chart-fill.st-danger { background: linear-gradient(90deg, #e74c3c, #f06b5e); }

.chart-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.chart-col-fill {
  width: 40px; background: linear-gradient(180deg, #a18cd1, #7c5bb5);
  border-radius: 8px 8px 0 0; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 4px; font-size: 11px; font-weight: 700; color: #fff; min-height: 20px;
  transition: height .8s ease;
}
.chart-col-label { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ========== 自我提升计划 ========== */
.improve-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.improve-card {
  background: rgba(255,255,255,0.85); border: 1.5px solid rgba(200,180,220,0.2);
  border-radius: 14px; padding: 16px;
  transition: box-shadow .3s ease, transform .3s ease;
}
.improve-card:hover { box-shadow: 0 6px 20px rgba(200,180,220,0.15); transform: translateY(-2px); }
.improve-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.improve-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.improve-desc { font-size: 13px; color: var(--muted); margin-bottom: 10px; line-height: 1.6; }
.improve-progress { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.improve-pct { font-size: 14px; font-weight: 700; min-width: 40px; text-align: right; }
.improve-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.improve-outcome { background: #fffaf0; border: 1px solid #fae5a0; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: 8px 0; line-height: 1.5; }
.improve-actions { display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid #f0ecf6; padding-top: 10px; margin-top: 10px; }

/* 自我提升计划 类别标签 */
.tag.improve-运动 { background: #e8faf0; color: #16a34a; border-color: #b8e6cc; }
.tag.improve-吃药 { background: #fce8f3; color: #e11d48; border-color: #f5c2dd; }
.tag.improve-学习 { background: #f4ebfa; color: #9333ea; border-color: #e0caf0; }
.tag.improve-约会 { background: #fde8f4; color: #db2777; border-color: #f7bcd8; }
.tag.improve-其他 { background: #f0ecf6; color: #7a6a9a; border-color: #ddd6e8; }

/* 自我提升类型标签（旧版，保留兼容） */
.tag.improve-在线课程 { background: #e8f0fe; color: #1a73e8; border-color: #c5d9f7; }
.tag.improve-读书 { background: #fef7e0; color: #b8860b; border-color: #fae5a0; }
.tag.improve-线下培训 { background: #e8faf0; color: #0f9d76; border-color: #b8e6cc; }
.tag.improve-教研活动 { background: #f4ebfa; color: #8e44ad; border-color: #e0caf0; }
.tag.improve-课题研究 { background: #fce8e8; color: #c0392b; border-color: #f5baba; }
.tag.improve-技能训练 { background: #e8f4fd; color: #2980b9; border-color: #b5d8f0; }
.tag.improve-其他 { background: #f0ecf6; color: #7a6a9a; border-color: #ddd6e8; }

/* ========== 每日打卡日历 ========== */
.checkin-cal { width:100%; border-collapse:collapse; margin-top:12px; border:1px solid #e0d8f0; border-radius:8px; overflow:hidden; }
.checkin-cal th { padding:8px 4px; text-align:center; font-weight:600; color:#8888a0; font-size:13px; border-bottom:2px solid #e0d8f0; }
.checkin-cal td { border:1px solid #e8e0f0; padding:6px; vertical-align:top; cursor:pointer; height:80px; width:14.28%; transition:background .15s; }
.checkin-cal td:hover { background:rgba(161,140,209,0.08); }
.checkin-cal td.today { background:rgba(100,126,234,0.10); border-color:#667eea; }
.checkin-cal td.has-checkin { background:rgba(34,197,94,0.06); }
.chk-day { font-size:15px; font-weight:600; margin-bottom:4px; }
.checkin-cal td.today .chk-day { color:#667eea; }
.chk-badges { display:flex; flex-wrap:wrap; gap:3px; }
.chk-badge { font-size:16px; cursor:help; line-height:1; }
.chk-entry { display:flex; align-items:center; gap:8px; padding:6px 0; border-bottom:1px solid #e8e0f0; font-size:14px; }
.chk-entry:last-child { border:none; }

/* ========== 课表日历样式 ========== */
.sc-cal { width:100%; border-collapse:collapse; margin-top:12px; border:1px solid #e0d8f0; border-radius:8px; overflow:hidden; }
.sc-cal th { padding:8px 4px; text-align:center; font-weight:600; color:var(--muted); font-size:13px; border-bottom:2px solid #e0d8f0; }
.sc-cal td { border:1px solid #e4e8f0; padding:6px; vertical-align:top; height:80px; width:14.28%; transition:background .15s; }
.sc-cal td:hover { background:rgba(161,140,209,0.06); }
.sc-cal td.today { background:rgba(100,126,234,0.10); border-color:#667eea; }
.sc-cal td.empty { background:rgba(0,0,0,0.02); }
.sc-cal .sc-day { font-size:15px; font-weight:600; margin-bottom:2px; }
.sc-cal td.today .sc-day { color:#4f46e5; }
.sc-cal .sc-week-num { font-size:11px; color:#4a5568; font-weight:600; text-align:center; min-width:60px; width:60px; background:rgba(100,126,234,0.06); padding:4px 2px; }


/* 打卡类型配色（日历徽标 / 统计条 / 构成标签 共用） */
.ct-运动打卡 { --cc:#22c55e; }
.ct-学习打卡 { --cc:#a855f7; }
.ct-早睡打卡 { --cc:#6366f1; }
.ct-吃药打卡 { --cc:#f43f5e; }
.ct-约会打卡 { --cc:#ec4899; }
.ct-其他打卡 { --cc:#f59e0b; }
.chk-badge.ct-运动打卡,
.chk-badge.ct-学习打卡,
.chk-badge.ct-早睡打卡,
.chk-badge.ct-吃药打卡,
.chk-badge.ct-约会打卡,
.chk-badge.ct-其他打卡 { background:color-mix(in srgb, var(--cc) 16%, white); border-radius:6px; padding:1px 3px; }

/* 本月打卡构成 */
.chk-dist { margin-top:16px; }
.chk-dist-title { font-weight:700; margin-bottom:8px; color:#2d2d3a; }
.chk-pill {
  display:inline-flex; align-items:center; gap:4px; margin:4px 6px 4px 0;
  padding:4px 10px; border-radius:999px; font-size:13px; font-weight:600;
  color:var(--cc); background:color-mix(in srgb, var(--cc) 14%, white);
  border:1px solid color-mix(in srgb, var(--cc) 35%, white);
}
.chart-fill.chk-运动打卡 { background:linear-gradient(135deg,#22c55e,#16a34a); }
.chart-fill.chk-学习打卡 { background:linear-gradient(135deg,#a855f7,#9333ea); }
.chart-fill.chk-早睡打卡 { background:linear-gradient(135deg,#6366f1,#4f46e5); }
.chart-fill.chk-吃药打卡 { background:linear-gradient(135deg,#f43f5e,#e11d48); }
.chart-fill.chk-约会打卡 { background:linear-gradient(135deg,#ec4899,#db2777); }
.chart-fill.chk-其他打卡 { background:linear-gradient(135deg,#f59e0b,#d97706); }

/* ECharts 图表容器 */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 18px; margin-top: 20px; }
.chart-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.chart-box h3 { font-size: 14px; margin: 0 0 10px; font-weight: 700; color: var(--ink); }

@media (max-width: 760px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card.bar { grid-column: span 2; }
  .improve-grid { grid-template-columns: 1fr; }
  .chart-row { flex-wrap: wrap; }
  .chart-label { min-width: 80px; }
  .charts-grid { grid-template-columns: 1fr; }
}


/* ========== 认证系统 ========== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.auth-card {
  background: var(--panel);
  border: 1.5px solid var(--panel-border);
  border-radius: 24px;
  padding: 36px 32px;
  width: 400px;
  max-width: 92vw;
  box-shadow: 0 12px 50px rgba(100,80,140,0.15);
  backdrop-filter: blur(12px);
  animation: bounceIn .4s cubic-bezier(.34,1.25,.5,1);
  text-align: center;
}
.auth-logo {
  font-size: 48px;
  margin-bottom: 8px;
}
.auth-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 24px;
}
.auth-field {
  text-align: left;
  margin-bottom: 12px;
}
.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #8888b0;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}
.auth-field input, .auth-field select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 11px 14px;
  border: 2px solid #e8e0f0;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.auth-field input:focus, .auth-field select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102,126,234,0.12);
}
.auth-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  font-size: 15px;
  border-radius: 14px;
}
.auth-error {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #b91c1c;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 8px;
  text-align: left;
}
.auth-switch {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}
.auth-switch a {
  color: #a18cd1;
  text-decoration: none;
  font-weight: 700;
}
.auth-switch a:hover {
  text-decoration: underline;
}

/* 用户管理表格 */
#view-users .grid th {
  background: linear-gradient(135deg, #f8f0ff, #f0e8ff);
  color: #6a5a8a;
  font-weight: 700;
}


.sc-cal td { height:auto; min-height:90px; }
.sc-cell-edit:empty::before {
  content: attr(placeholder);
  color: #c0b8d8;
  font-style: italic;
  pointer-events: none;
}
.sc-cell-edit:focus {
  background: rgba(168,139,250,0.06);
  border-radius: 4px;
}

/* Editable calendar cells */
.sc-cal td { height:auto; min-height:90px; }
.sc-cell-edit {
  font-size:11px;
  min-height:40px;
  outline:none;
  cursor:text;
  padding:2px;
  line-height:1.4;
  color:#e11d48;
  white-space:pre-wrap;
  word-break:break-all;
  border-radius:3px;
  transition: background 0.15s;
}
.sc-cell-edit:empty::before {
  content: attr(placeholder);
  color: #c0b8d8;
  font-style: italic;
  pointer-events: none;
}
.sc-cell-edit:focus {
  background: rgba(168,139,250,0.08);
}

/* 月历单元格右上角 ＋（添加当天补课/调课） */
.sc-cal td { position: relative; }
.sc-cell-add {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #9a8cc0;
  cursor: pointer;
  line-height: 1;
  padding: 1px 2px;
  border-radius: 3px;
  background: rgba(161,140,209,0.10);
}
.sc-cell-add:hover { color: #6c4dba; background: rgba(161,140,209,0.22); }

/* ========== 授课课表 - 按星期区分颜色 ========== */
.sched-col:nth-child(1) .cls { border-left:3px solid #3b82f6; }
.sched-col:nth-child(2) .cls { border-left:3px solid #22c55e; }
.sched-col:nth-child(3) .cls { border-left:3px solid #f59e0b; }
.sched-col:nth-child(4) .cls { border-left:3px solid #a855f7; }
.sched-col:nth-child(5) .cls { border-left:3px solid #ef4444; }
.sched-col:nth-child(6) .cls { border-left:3px solid #14b8a6; }
.sched-col:nth-child(7) .cls { border-left:3px solid #6366f1; }

/* ========== 慕课计划日历 ========== */
.mooc-month { margin-bottom: 26px; }
.mooc-month-title { font-weight: 700; font-size: 16px; color: #4a2c8a; margin: 8px 0 6px; padding-left: 10px; border-left: 4px solid #1abc9c; }
.mooc-cal { width: 100%; border-collapse: collapse; border: 1px solid #e0d8f0; border-radius: 10px; overflow: hidden; }
.mooc-cal th { padding: 8px 4px; text-align: center; font-weight: 600; color: #8888a0; font-size: 13px; border-bottom: 2px solid #e0d8f0; background: rgba(161,140,209,0.06); }
.mooc-cal td { border: 1px solid #e8e0f0; padding: 5px; vertical-align: top; cursor: pointer; height: 96px; width: 14.28%; transition: background .15s; }
.mooc-cal td:hover { background: rgba(26,188,156,0.08); }
.mooc-cal td.today { background: rgba(100,126,234,0.10); border-color: #667eea; }
.mooc-cal td.has-mooc { background: rgba(26,188,156,0.05); }
.mooc-cal td.mooc-empty { cursor: default; background: #faf8fd; }
.mooc-cal td.today .mooc-day { color: #667eea; font-weight: 700; }
.mooc-day { font-size: 13px; color: #666688; margin-bottom: 3px; }
.mooc-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.mooc-tag { font-size: 10.5px; line-height: 1.35; padding: 2px 5px; border-radius: 6px; color: #fff; font-weight: 600; cursor: help; white-space: normal; word-break: break-all; }
.mooc-open  { background: #3b82f6; }
.mooc-start { background: #22c55e; }
.mooc-ann   { background: #a855f7; }
.mooc-pub   { background: #14b8a6; }
.mooc-due   { background: #f59e0b; }
.mooc-final { background: #ef4444; }
.mooc-end   { background: #d97706; }
.mooc-other { background: #64748b; }
.mooc-entry { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e8e0f0; border-radius: 8px; margin-bottom: 6px; background: #fdfcff; }
.mooc-entry .hint { margin-left: 8px; font-size: 12px; }

/* ========== 慕课提示条 ========== */
.mooc-tip {
  margin-top: 10px;
  padding: 9px 14px;
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  border: 1.5px dashed #f0c36d;
  border-radius: 10px;
  color: #8a6d3b;
  font-size: 13px;
  line-height: 1.6;
}
.mooc-tip b { color: #c77700; }
