:root {
  --blue-950: #062b55;
  --blue-900: #003b78;
  --blue-800: #075093;
  --blue-700: #0b65b1;
  --blue-100: #eaf5ff;
  --cyan: #22a7b8;
  --green: #20a783;
  --amber: #f2a93b;
  --red: #d84d4d;
  --ink: #12233a;
  --muted: #68778a;
  --line: #e3eaf2;
  --page: #f3f7fb;
  --card: #fff;
  --shadow: 0 14px 36px rgba(12, 60, 107, .12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
input,
select,
textarea {
  transition: border-color .2s ease, box-shadow .2s ease, color .2s ease, background-color .2s ease, transform .2s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(34, 167, 184, .32);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.student-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  background:
    linear-gradient(120deg, rgba(0, 59, 120, .94), rgba(34, 167, 184, .72)),
    url("./../prototype/assets/hero-education.svg") center / cover no-repeat;
}

.login-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px min(6vw, 78px);
  color: #fff;
}

.brand,
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand img,
.sidebar-brand img {
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 50%;
}

.brand strong,
.brand small,
.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.brand strong {
  font-size: 24px;
}

.brand small,
.sidebar-brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, .72);
}

.login-copy {
  max-width: 720px;
  padding-bottom: 54px;
}

.login-copy span {
  color: #d4fff6;
  font-weight: 900;
  letter-spacing: .08em;
}

.login-copy h1 {
  margin: 18px 0 14px;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.12;
}

.login-copy p {
  max-width: 620px;
  color: rgba(255, 255, 255, .8);
  font-size: 17px;
}

.login-card {
  align-self: center;
  margin-right: min(6vw, 76px);
  padding: 34px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: var(--radius);
  box-shadow: 0 28px 80px rgba(0, 35, 76, .24);
}

.login-card h2 {
  margin: 0 0 8px;
  color: var(--blue-900);
  font-size: 28px;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #34485f;
  font-weight: 800;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d7e3ef;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

input,
select {
  height: 40px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-700);
  box-shadow: 0 0 0 3px rgba(11, 101, 177, .12);
}

.login-card label {
  display: block;
  margin-top: 16px;
}

.login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.check {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  margin: 0 !important;
}

.check input {
  width: 15px;
  height: 15px;
}

.primary-button,
.ghost-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 900;
}

.primary-button {
  color: #fff;
  border: 1px solid var(--blue-800);
  background: linear-gradient(135deg, var(--blue-800), var(--blue-700));
}

.ghost-button {
  color: var(--blue-800);
  border: 1px solid #cfe0ef;
  background: #fff;
}

.primary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled),
.card-actions button:hover:not(:disabled),
.assignment-card button:hover:not(:disabled),
.weak-card button:hover:not(:disabled),
.student-nav button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(12, 60, 107, .12);
}

.primary-button:active:not(:disabled),
.ghost-button:active:not(:disabled),
.card-actions button:active:not(:disabled),
.assignment-card button:active:not(:disabled),
.weak-card button:active:not(:disabled) {
  transform: translateY(0);
}

.login-card .primary-button {
  width: 100%;
}

.login-error {
  display: block;
  min-height: 18px;
  margin-top: 12px;
  color: var(--red);
}

.student-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.student-sidebar {
  color: #dceeff;
  background: linear-gradient(180deg, #063764, #075093);
  padding: 18px 14px;
}

.sidebar-brand {
  min-height: 58px;
  padding: 0 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.sidebar-brand strong {
  color: #fff;
  font-size: 17px;
}

.sidebar-brand img {
  width: 42px;
  height: 42px;
}

.student-nav {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.student-nav button {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: rgba(255, 255, 255, .82);
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.student-nav button:hover,
.student-nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.student-main {
  min-width: 0;
}

.student-topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 26px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(12, 60, 107, .06);
}

.student-topbar strong,
.student-topbar small {
  display: block;
}

.student-topbar strong {
  font-size: 20px;
}

.student-topbar small {
  margin-top: 2px;
  color: var(--muted);
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--blue-900);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  position: relative;
  width: min(28vw, 300px);
}

.search svg {
  position: absolute;
  left: 11px;
  top: 10px;
  color: #7890a6;
}

.search input {
  padding-left: 38px;
}

.avatar {
  width: 38px;
  height: 38px;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: var(--blue-800);
  font-weight: 900;
}

.api-status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #d7e3ef;
  border-radius: 999px;
  color: #526579;
  background: #f7fbff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.api-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f2a93b;
}

.api-status.ok {
  color: #1f7d61;
  border-color: #bbe6d4;
  background: #f0fbf7;
}

.api-status.ok::before {
  background: #20a783;
}

.api-status.warn {
  color: #93630c;
  border-color: #f5d997;
  background: #fff9e8;
}

.api-status.warn::before {
  background: #f2a93b;
}

.student-content {
  padding: 22px 26px 34px;
}

.student-view {
  display: none;
}

.student-view.active {
  display: block;
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 170px;
  padding: 28px;
  color: #fff;
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(0, 59, 120, .96), rgba(34, 167, 184, .78)),
    url("./../prototype/assets/hero-education.svg") center / cover no-repeat;
  box-shadow: var(--shadow);
}

.hero-card span {
  color: #d4fff6;
  font-weight: 900;
}

.hero-card h1 {
  margin: 10px 0;
  max-width: 720px;
  font-size: clamp(26px, 3.2vw, 42px);
  line-height: 1.2;
}

.hero-card p {
  margin: 0;
  max-width: 620px;
  color: rgba(255, 255, 255, .78);
}

.hero-card .primary-button {
  border-color: rgba(255, 255, 255, .6);
  background: #fff;
  color: var(--blue-900);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.stat-grid article,
.panel,
.course-card,
.assignment-card,
.weak-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(12, 60, 107, .07);
}

.course-card:hover,
.assignment-card:hover,
.weak-card:hover,
.panel:focus-within,
.stat-grid article:focus-within {
  border-color: #bdd7ec;
  box-shadow: 0 14px 34px rgba(12, 60, 107, .1);
}

.stat-grid article {
  min-height: 116px;
  padding: 18px;
}

.stat-grid span {
  color: var(--muted);
  font-size: 14px;
}

.stat-grid strong {
  display: block;
  margin: 10px 0 8px;
  color: var(--blue-900);
  font-size: 32px;
  line-height: 1;
}

.stat-grid small {
  color: #557086;
}

.dashboard-grid,
.report-layout,
.plan-layout,
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  padding: 18px;
}

.panel.wide {
  grid-row: span 2;
}

.panel-head,
.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-head {
  margin-bottom: 14px;
}

.panel-head h2,
.module-head h1 {
  margin: 0;
  color: var(--blue-900);
}

.panel-head h2 {
  font-size: 18px;
}

.panel-head span,
.module-head p,
.module-tip {
  color: var(--muted);
  font-size: 13px;
}

.module-head {
  margin-bottom: 16px;
}

.module-head h1 {
  font-size: 26px;
}

.module-head p {
  margin: 5px 0 0;
}

.line-area {
  height: 280px;
  border-radius: 7px;
  background:
    linear-gradient(0deg, #edf4fb 1px, transparent 1px),
    linear-gradient(90deg, #edf4fb 1px, transparent 1px);
  background-size: 36px 36px;
}

.line-area svg {
  width: 100%;
  height: 100%;
}

.task-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.task-mini-list li {
  padding: 13px 0;
  border-bottom: 1px solid #edf2f7;
}

.task-mini-list li:last-child {
  border-bottom: 0;
}

.task-mini-list strong,
.task-mini-list span {
  display: block;
}

.task-mini-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.ai-note,
.plan-output {
  padding: 16px;
  border-radius: 7px;
  background: #f0f7fd;
}

.ai-note strong,
.plan-output h3 {
  color: var(--blue-900);
}

.ai-note p,
.plan-output p {
  margin: 9px 0 0;
  color: #50657a;
  font-size: 14px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.course-card {
  overflow: hidden;
}

.course-cover {
  height: 132px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 25% 30%, rgba(255, 255, 255, .42), transparent 24%),
    linear-gradient(135deg, #075093, #22a7b8);
}

.course-cover svg {
  width: 42px;
  height: 42px;
}

.course-body {
  padding: 16px;
}

.course-body h3,
.assignment-card h3,
.weak-card h3 {
  margin: 0;
  font-size: 17px;
}

.course-body p,
.assignment-card p,
.weak-card p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.course-requirement {
  display: block;
  margin: -2px 0 12px;
  padding: 8px 10px;
  border-radius: 7px;
  color: #0b4f86;
  background: #eef7ff;
  line-height: 1.5;
}

.meta-row,
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.meta-row {
  color: #557086;
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #1f7d61;
  background: #e7f8f2;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pill.pending {
  color: #93630c;
  background: #fff4d8;
}

.pill.done {
  color: #1f7d61;
  background: #e7f8f2;
}

.pill.doing {
  color: var(--blue-800);
  background: #eaf5ff;
}

.card-actions {
  margin-top: 14px;
}

.card-actions button,
.assignment-card button,
.weak-card button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--blue-800);
  border: 1px solid #d4e3f0;
  border-radius: 5px;
  background: #fff;
  font-weight: 800;
}

.progress-line {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e7eef6;
  overflow: hidden;
}

.progress-line i {
  display: block;
  width: var(--w);
  height: 100%;
  background: linear-gradient(90deg, var(--blue-700), var(--cyan));
}

.assignment-list,
.weakness-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.assignment-card,
.weak-card {
  padding: 18px;
}

.assignment-footer,
.weak-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.assignment-footer div,
.weak-footer div {
  padding: 10px;
  border-radius: 7px;
  background: #f5f9fc;
}

.assignment-footer strong,
.assignment-footer span,
.weak-footer strong,
.weak-footer span {
  display: block;
}

.assignment-footer strong,
.weak-footer strong {
  color: var(--blue-900);
}

.assignment-footer span,
.weak-footer span {
  color: var(--muted);
  font-size: 12px;
}

.radar {
  display: grid;
  gap: 15px;
}

.radar div {
  display: grid;
  grid-template-columns: 54px 1fr 34px;
  align-items: center;
  gap: 12px;
}

.radar strong,
.radar em {
  font-size: 13px;
  font-style: normal;
}

.radar span {
  height: 9px;
  border-radius: 999px;
  background: #e7eef6;
  overflow: hidden;
}

.radar span::after {
  content: "";
  display: block;
  width: var(--w);
  height: 100%;
  background: linear-gradient(90deg, var(--blue-700), var(--cyan));
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline article {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 7px;
  background: #f5f9fc;
}

.timeline time {
  color: var(--blue-800);
  font-weight: 900;
}

.timeline strong,
.timeline span {
  display: block;
}

.timeline span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.plan-output {
  min-height: 260px;
}

.plan-output ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.profile-form {
  display: grid;
  gap: 14px;
}

.profile-form .primary-button {
  width: fit-content;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.badge-grid div {
  min-height: 94px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 7px;
  background: linear-gradient(135deg, #f8fcff, #e9f7f8);
}

.badge-grid strong,
.badge-grid span {
  display: block;
}

.badge-grid strong {
  color: var(--blue-900);
}

.badge-grid span {
  color: var(--muted);
}

.study-dialog {
  width: min(620px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 28px 80px rgba(0, 35, 76, .28);
}

.study-dialog::backdrop {
  background: rgba(5, 25, 48, .52);
}

.study-dialog form {
  padding: 22px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dialog-head h2 {
  margin: 0;
  color: var(--blue-900);
}

.dialog-head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef4fa;
  font-size: 24px;
}

.video-box {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  border-radius: 7px;
  background:
    radial-gradient(circle at 25% 30%, rgba(255, 255, 255, .18), transparent 24%),
    linear-gradient(135deg, #062b55, #0b65b1);
}

.video-box svg {
  width: 56px;
  height: 56px;
}

.video-box strong,
.video-box span {
  display: block;
}

.video-box span {
  color: rgba(255, 255, 255, .76);
}

.resource-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #063864;
  background: #fff;
  text-decoration: none;
  font-weight: 900;
}

.study-dialog label {
  display: block;
  margin-top: 14px;
}

.study-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  color: #fff;
  background: rgba(3, 47, 88, .94);
  border-radius: 7px;
  padding: 11px 14px;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .student-login {
    grid-template-columns: 1fr;
  }

  .login-side {
    min-height: 360px;
  }

  .login-card {
    width: min(430px, calc(100% - 32px));
    margin: -80px auto 32px;
  }

  .student-shell {
    grid-template-columns: 1fr;
  }

  .student-sidebar {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    width: 248px;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }

  body.menu-open .student-sidebar {
    transform: translateX(0);
  }

  .menu-button {
    display: inline-grid;
  }

  .stat-grid,
  .course-grid,
  .assignment-list,
  .weakness-grid,
  .dashboard-grid,
  .report-layout,
  .plan-layout,
  .profile-layout {
    grid-template-columns: 1fr 1fr;
  }

  .panel.wide {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .login-side {
    min-height: 310px;
    padding: 24px;
  }

  .login-copy {
    padding-bottom: 18px;
  }

  .login-copy h1 {
    font-size: 30px;
  }

  .login-card {
    padding: 24px;
  }

  .student-topbar {
    min-height: 66px;
    flex-wrap: wrap;
    padding: 14px;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .search {
    width: 100%;
  }

  .api-status {
    order: 2;
  }

  .student-content {
    padding: 16px 14px 26px;
  }

  .hero-card {
    align-items: stretch;
    flex-direction: column;
    min-height: 0;
    padding: 20px;
  }

  .hero-card .primary-button,
  .module-head .primary-button {
    width: 100%;
  }

  .stat-grid,
  .course-grid,
  .assignment-list,
  .weakness-grid,
  .dashboard-grid,
  .report-layout,
  .plan-layout,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .module-head {
    align-items: stretch;
    flex-direction: column;
  }

  .assignment-footer,
  .weak-footer {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
    text-align: center;
  }
}
