/* 学习空间：课程、学分与习惯 */

.study-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.page-heading .heading-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 学分dial */
.credit-card {
  display: flex;
  gap: 26px;
  align-items: center;
  padding: 24px 26px;
  position: relative;
  overflow: hidden;
}

.credit-card::after {
  content: "";
  position: absolute;
  inset: -40% -30% auto auto;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(180, 215, 255, .16), transparent 65%);
  pointer-events: none;
}

.credit-dial {
  width: 148px;
  height: 148px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 0 0 1px rgba(184, 205, 246, .12), 0 18px 40px -22px rgba(0, 0, 0, .9);
  animation: dial-in .9s cubic-bezier(.22, .68, 0, 1) both;
}

.credit-dial::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}

.credit-dial::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed var(--line);
  animation: spin-slow 40s linear infinite;
}

.credit-dial-inner {
  position: relative;
  text-align: center;
  line-height: 1.1;
}

.credit-dial-inner strong {
  display: block;
  font-size: 34px;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--text);
}

.credit-dial-inner span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .06em;
}

.credit-copy { min-width: 0; flex: 1; }
.credit-copy h2 { margin: 4px 0 8px; font-size: 30px; font-weight: 650; letter-spacing: -.02em; }
.credit-copy h2 small { font-size: 15px; color: var(--muted); margin-left: 2px; font-weight: 500; }
.credit-copy .muted { font-size: 12.5px; margin: 8px 0 0; }

.credit-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--glass-card);
  overflow: hidden;
}

.credit-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fc0f5, #b4d7ff 45%, #e8b6d2);
  box-shadow: 0 0 14px rgba(180, 215, 255, .5);
  animation: bar-grow 1.1s cubic-bezier(.22, .68, 0, 1) both;
}

.credit-legend {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--muted);
}

.credit-mini {
  display: flex;
  gap: 22px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.credit-mini span { display: grid; gap: 1px; }
.credit-mini b { font-size: 19px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.credit-mini small { font-size: 10.5px; color: var(--muted); letter-spacing: .05em; }
.credit-mini span:nth-child(2) b { color: var(--blue); }
.credit-mini span:nth-child(3) b { color: var(--muted); }

.credit-legend li { display: inline-flex; align-items: center; gap: 6px; }
.credit-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.credit-legend b { color: var(--text); font-weight: 600; }
.credit-legend small { opacity: .7; }
.credit-legend li.muted { font-size: 12px; line-height: 1.6; }

/* 三个小指标 */
.study-metrics {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  padding: 0;
  overflow: hidden;
}

.study-metric {
  background: var(--glass-panel);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  transition: background .25s ease;
}

.study-metric:hover { background: var(--glass-panel-hover); }
.study-metric span { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.study-metric strong { font-size: 21px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.study-metric small { font-size: 11px; color: var(--muted); }

/* 主体布局 */
.study-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.study-main { display: grid; gap: 14px; min-width: 0; }
.study-grid .timeline-toolbar { position: sticky; top: 12px; z-index: 3; backdrop-filter: blur(12px); }

.course-list { display: grid; gap: 12px; }

.course-card {
  padding: 18px 20px;
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: transform .28s cubic-bezier(.22, .68, 0, 1), border-color .28s ease, box-shadow .28s ease;
  animation: rise .55s cubic-bezier(.22, .68, 0, 1) both;
}

.course-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(180, 215, 255, .75), transparent);
  opacity: 0;
  transition: opacity .3s ease;
}

.course-card:hover {
  transform: translateY(-2px);
  border-color: var(--line);
  box-shadow: 0 22px 44px -30px rgba(0, 0, 0, .95);
}

.course-card:hover::before { opacity: 1; }
.course-list .course-card:nth-child(2) { animation-delay: .05s; }
.course-list .course-card:nth-child(3) { animation-delay: .1s; }
.course-list .course-card:nth-child(4) { animation-delay: .15s; }
.course-list .course-card:nth-child(5) { animation-delay: .2s; }
.course-list .course-card:nth-child(n+6) { animation-delay: .25s; }

.course-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.course-head h3 { margin: 0 0 3px; font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.course-head p { margin: 0; font-size: 12px; }

.course-credits {
  flex: none;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--blue);
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.course-credits small { font-size: 10.5px; color: var(--muted); font-weight: 500; letter-spacing: .04em; }

.course-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.status-pill {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
  letter-spacing: .02em;
}

.status-studying { color: var(--accent-2); border-color: var(--line); background: var(--glass-card); }
.status-passed { color: var(--accent); border-color: var(--line); background: var(--glass-card); }
.status-planned { color: var(--muted); border-color: var(--line); background: var(--glass-card); }
.status-score { color: var(--pink); border-color: var(--line); background: var(--glass-card); }

.demo-label {
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 99px;
  padding: 2px 8px;
}

.course-assessment {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.assessment-chip {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--glass-card);
  border: 1px solid var(--line);
  color: var(--violet);
}

.assessment-chip.is-empty { color: var(--muted); font-style: italic; }
.assessment-total { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.assessment-total.is-warn { color: var(--alert); }
.assessment-total-preview { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.assessment-total-preview.is-warn { color: var(--alert); }

.course-actions { display: flex; gap: 12px; }
.course-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease;
}
.course-link svg { width: 13px; height: 13px; }
.course-link:hover { color: var(--blue); }
.course-link.is-danger:hover { color: var(--alert); }

/* 习惯面板 */
.study-aside { display: grid; gap: 14px; position: sticky; top: 12px; }

.habit-panel { padding: 18px; display: grid; gap: 12px; }

.habit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.habit-head h3 { margin: 2px 0 0; font-size: 15px; font-weight: 600; }

.habit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  animation: rise .5s cubic-bezier(.22, .68, 0, 1) both;
}
.habit-row:last-child { border-bottom: 0; padding-bottom: 0; }
.habit-row:nth-child(3) { animation-delay: .06s; }
.habit-row:nth-child(4) { animation-delay: .12s; }
.habit-row:nth-child(5) { animation-delay: .18s; }

.habit-check {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--glass-card);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.habit-check svg { width: 15px; height: 15px; }
.habit-check:hover { border-color: var(--line); transform: scale(1.06); }
.habit-check:active { transform: scale(.9); }
.habit-check.is-done {
  background: linear-gradient(150deg, #cfe6ff, #e8b6d2);
  border-color: transparent;
  box-shadow: 0 0 16px rgba(200, 220, 255, .38);
  animation: pop .42s cubic-bezier(.3, 1.6, .5, 1);
}

.habit-info { min-width: 0; flex: 1; display: grid; gap: 1px; }
.habit-info strong { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.habit-info small { font-size: 11px; color: var(--muted); }

.habit-week { display: flex; gap: 3px; }
.habit-week i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glass-card-bright);
  transition: background .3s ease, box-shadow .3s ease;
}
.habit-week i.on { background: var(--blue); box-shadow: 0 0 8px rgba(180, 215, 255, .75); }

.habit-empty { display: grid; gap: 10px; font-size: 12.5px; color: var(--muted); }
.habit-empty p { margin: 0; line-height: 1.6; }
.habit-empty .btn { justify-self: start; }

.storage-note {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
  padding: 0 2px;
}
.storage-note svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }

/* 表单补充 */
.assessment-rows { display: grid; gap: 8px; margin-top: 8px; }
.assessment-row { display: grid; grid-template-columns: minmax(0, 1fr) 92px 34px; gap: 8px; align-items: center; }
.assessment-row .icon-button { width: 34px; height: 34px; }
.form-note { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.btn-danger-ghost { color: var(--alert); border-color: var(--line); }
.btn-danger-ghost:hover { background: var(--glass-card); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  0% { transform: scale(.82); }
  55% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes dial-in {
  from { opacity: 0; transform: rotate(-36deg) scale(.88); }
  to { opacity: 1; transform: none; }
}
@keyframes bar-grow { from { width: 0; } }
@keyframes spin-slow { to { transform: rotate(360deg); } }

@media (max-width: 1080px) {
  .study-overview { grid-template-columns: 1fr; }
  .study-metrics { grid-template-rows: none; grid-template-columns: repeat(3, 1fr); }
  .study-grid { grid-template-columns: 1fr; }
  .study-aside, .study-grid .timeline-toolbar { position: static; }
}

@media (max-width: 620px) {
  .credit-card { flex-direction: column; align-items: stretch; gap: 16px; padding: 20px; }
  .credit-dial { width: 122px; height: 122px; align-self: center; }
  .study-metrics { grid-template-columns: 1fr 1fr; }
  .study-metric:last-child { grid-column: 1 / -1; }
  .assessment-row { grid-template-columns: minmax(0, 1fr) 78px 34px; }
  .page-heading .heading-actions { width: 100%; }
  .page-heading .heading-actions .btn { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .credit-dial, .credit-dial::after, .credit-bar span, .course-card, .habit-row, .habit-check.is-done { animation: none !important; }
  .course-card, .habit-check { transition: none; }
}

/* 培养方案信息：保研标记、课程备注、学分口径 */
.gpa-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--text);
  background: var(--glass-card-bright);
  border: 1px solid var(--line);
}
.gpa-pill.is-off {
  color: var(--text);
  background: var(--glass-card);
  border-color: var(--line);
}
.course-note {
  margin: 2px 0 0;
  padding: 8px 0 2px 11px;
  border-left: 2px solid var(--line);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}
.credit-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.check-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.check-field input { margin-top: 2px; accent-color: #b4d7ff; }
.check-field small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.credit-card .credit-dial { flex: none; }

/* 课程多起来以后，双列排布更省纵向空间 */
.course-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.assessment-total.is-pending { color: var(--muted); font-weight: 500; }

/* 培养方案面板 */
.curriculum-panel {
  position: relative;
  overflow: hidden;
  padding: 22px 26px;
  margin-bottom: 18px;
  display: grid;
  gap: 18px;
  background: var(--glass-panel);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(5, 6, 25, .35);
}
.curriculum-panel::after {
  content: "";
  position: absolute;
  inset: -30% -12% auto auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(159, 216, 200, .14), transparent 66%);
  pointer-events: none;
}
.curriculum-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.curriculum-head h2 { margin: 4px 0 3px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.curriculum-head p { margin: 0; font-size: 12px; }
.curriculum-total {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-soft);
}
.curriculum-total small { font-size: 11px; color: var(--text-hint); letter-spacing: .06em; margin-top: 4px; font-weight: 500; }
.curriculum-modules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.curriculum-module {
  display: grid;
  gap: 7px;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--glass-card);
  border: 1px solid var(--glass-border-soft);
  transition: border-color .25s ease, transform .25s ease, background .25s ease;
}
.curriculum-module:hover { border-color: var(--line); transform: translateY(-2px); background: var(--glass-card); }
.curriculum-module-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.curriculum-module-top b, .curriculum-major b {
  font-family: "QHorizons WenKai", KaiTi, var(--font-body);
  font-weight: 400;
  text-shadow: none;
}
.curriculum-module-top b { font-size: 17px; line-height: 1.3; color: #385770; }
.curriculum-module-top span { font-size: 11.5px; color: var(--accent); white-space: nowrap; font-weight: 600; }
.curriculum-module small { font-size: 13px; line-height: 1.55; color: var(--text); }
.curriculum-bar { height: 4px; border-radius: 99px; background: var(--glass-card); overflow: hidden; }
.curriculum-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 10px var(--accent-soft); }
.curriculum-majors { display: flex; flex-wrap: wrap; gap: 8px; }
.curriculum-major {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--tag-green-soft);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--tag-green);
}
.curriculum-major b { font-size: 14px; color: var(--tag-green); }
.curriculum-major small { color: var(--accent); }

@media (max-width: 620px) {
  .curriculum-panel { padding: 18px; }
  .curriculum-modules { grid-template-columns: 1fr; }
  .curriculum-total { font-size: 32px; }
}
