:root {
  --ink: #20332b;
  --ink-soft: #50625a;
  --muted: #8b968f;
  --paper: #f4f1e8;
  --paper-deep: #ebe7dc;
  --surface: #fffdf8;
  --surface-soft: #f9f7f1;
  --line: #e4dfd4;
  --line-strong: #d7d1c5;
  --green: #355f4e;
  --green-2: #4d7867;
  --green-soft: #e5eee8;
  --orange: #c57852;
  --orange-soft: #f6e7dd;
  --gold: #b58a47;
  --gold-soft: #f5ecd8;
  --blue: #687ca5;
  --blue-soft: #e9edf6;
  --danger: #b7584b;
  --danger-soft: #f8e5e1;
  --shadow-sm: 0 4px 14px rgba(42, 55, 48, 0.055);
  --shadow-md: 0 14px 42px rgba(42, 55, 48, 0.09);
  --shadow-lg: 0 28px 80px rgba(33, 51, 42, 0.16);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --sidebar: 236px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  background:
    radial-gradient(circle at 90% 5%, rgba(188, 211, 194, 0.28), transparent 26rem),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(53, 95, 78, 0.2);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

svg {
  display: block;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
}

.boot-screen p {
  margin: 0;
  letter-spacing: 0.08em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  flex: 0 0 auto;
  box-shadow: 0 8px 22px rgba(53, 95, 78, 0.2);
}

.brand-mark span {
  display: block;
  width: 3px;
  border-radius: 6px;
  background: currentColor;
  transform-origin: bottom center;
}

.brand-mark span:nth-child(1) {
  height: 12px;
  transform: rotate(-22deg);
}

.brand-mark span:nth-child(2) {
  height: 18px;
}

.brand-mark span:nth-child(3) {
  height: 10px;
  transform: rotate(24deg);
}

.brand-mark.large {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  animation: pulse 1.4s ease-in-out infinite alternate;
}

.brand-mark.large span {
  width: 4px;
}

.brand-mark.large span:nth-child(1) {
  height: 18px;
}

.brand-mark.large span:nth-child(2) {
  height: 26px;
}

.brand-mark.large span:nth-child(3) {
  height: 15px;
}

@keyframes pulse {
  from {
    transform: translateY(2px);
    box-shadow: 0 5px 12px rgba(53, 95, 78, 0.16);
  }
  to {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(53, 95, 78, 0.28);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

/* Authentication */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(480px, 1.18fr) minmax(400px, 0.82fr);
  background: var(--surface);
}

.login-story {
  min-height: 100vh;
  padding: clamp(34px, 5vw, 72px);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #f8f7ef;
  background:
    linear-gradient(135deg, rgba(20, 50, 38, 0.12), transparent 60%),
    #294c3e;
}

.login-story::before,
.login-story::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.login-story::before {
  width: 620px;
  height: 620px;
  right: -260px;
  top: -240px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 70px rgba(255, 255, 255, 0.018),
    0 0 0 150px rgba(255, 255, 255, 0.016);
}

.login-story::after {
  width: 360px;
  height: 360px;
  left: -170px;
  bottom: -140px;
  background: rgba(209, 179, 115, 0.1);
  filter: blur(1px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.login-brand .brand-mark {
  background: #f1eee1;
  color: var(--green);
  box-shadow: none;
}

.login-brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.17em;
}

.login-brand small {
  display: block;
  margin-top: -2px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.story-content {
  position: relative;
  z-index: 1;
  margin: auto 0;
  padding: 65px 0 48px;
  max-width: 710px;
}

.story-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d7c294;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.story-kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.story-content h1 {
  margin: 26px 0 23px;
  max-width: 640px;
  font-family: var(--serif);
  font-size: clamp(46px, 6vw, 80px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.story-content h1 em {
  color: #dfcda6;
  font-style: normal;
  position: relative;
}

.story-content h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: -5px;
  bottom: 2px;
  height: 7px;
  border-radius: 50%;
  background: rgba(217, 194, 148, 0.18);
  z-index: -1;
}

.story-content > p {
  max-width: 510px;
  margin: 0;
  color: rgba(255, 255, 255, 0.67);
  font-size: 16px;
  line-height: 1.9;
}

.story-features {
  display: flex;
  gap: 30px;
  margin-top: 46px;
}

.story-feature {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: rgba(255, 255, 255, 0.84);
}

.story-feature .feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #e3cca0;
  background: rgba(255, 255, 255, 0.07);
}

.story-feature strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}

.story-feature span {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
}

.story-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px;
  background:
    radial-gradient(circle at 100% 0%, rgba(222, 214, 194, 0.4), transparent 24rem),
    var(--surface);
}

.login-box {
  width: min(400px, 100%);
  animation: fadeUp 0.55s ease both;
}

.login-box .mobile-brand {
  display: none;
}

.login-eyebrow {
  color: var(--green-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.login-box h2 {
  margin: 11px 0 8px;
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.login-box > p {
  margin: 0 0 32px;
  color: var(--muted);
}

.field {
  margin-bottom: 17px;
}

.field label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.field label span {
  color: var(--muted);
  font-weight: 400;
}

.input-wrap {
  position: relative;
}

.input-wrap > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca49f;
  pointer-events: none;
}

.input-wrap input {
  padding-left: 42px;
}

.input-wrap .password-toggle {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.input-wrap .password-toggle:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fffefa;
  color: var(--ink);
  padding: 11px 13px;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    background 0.18s;
}

input::placeholder,
textarea::placeholder {
  color: #adb4af;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
textarea:focus,
select:focus {
  outline: 0;
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(53, 95, 78, 0.09);
  background: #fff;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.form-error {
  display: none;
  margin-bottom: 14px;
  padding: 9px 12px;
  border: 1px solid #efd4cd;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
}

.form-error.show {
  display: block;
  animation: shake 0.35s ease;
}

.btn {
  min-height: 39px;
  border: 1px solid transparent;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.16s,
    box-shadow 0.16s,
    background 0.16s,
    border-color 0.16s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 7px 18px rgba(53, 95, 78, 0.16);
}

.btn-primary:hover {
  background: #294e3f;
  box-shadow: 0 9px 22px rgba(53, 95, 78, 0.22);
}

.btn-secondary {
  border-color: var(--line);
  background: var(--surface);
}

.btn-secondary:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: rgba(55, 77, 66, 0.06);
}

.btn-danger {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  min-height: 46px;
  border-radius: 12px;
  padding: 11px 20px;
  font-size: 14px;
}

.btn-sm {
  min-height: 31px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.login-submit {
  margin-top: 25px;
}

.login-submit .loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.login-submit.loading .loader {
  display: block;
}

.login-submit.loading .btn-label {
  opacity: 0.7;
}

.demo-section {
  margin-top: 27px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.demo-section > span {
  display: block;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.demo-accounts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.demo-account {
  border: 1px solid var(--line);
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: 0.18s ease;
}

.demo-account:hover {
  border-color: #bdc9c1;
  background: var(--green-soft);
}

.demo-account .demo-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.demo-account.teacher .demo-avatar {
  color: var(--green);
  background: var(--green-soft);
}

.demo-account.admin .demo-avatar {
  color: var(--blue);
  background: var(--blue-soft);
}

.demo-account.student .demo-avatar {
  color: var(--orange);
  background: var(--orange-soft);
}

.demo-account strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.demo-account small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.login-copyright {
  margin-top: 30px;
  color: #a3aaa5;
  font-size: 10px;
  text-align: center;
}

/* Application shell */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 25px 17px 18px;
  border-right: 1px solid rgba(221, 217, 206, 0.85);
  background: rgba(249, 247, 240, 0.9);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 29px;
}

.sidebar-brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sidebar-brand small {
  display: block;
  margin-top: -3px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.sidebar-section-label {
  margin: 8px 12px 9px;
  color: #9ea7a1;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  min-height: 43px;
  border: 0;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  color: #69766f;
  background: transparent;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(50, 82, 67, 0.05);
}

.nav-item.active {
  color: var(--green);
  background: #e5ece6;
  font-weight: 700;
}

.nav-item svg {
  opacity: 0.85;
}

.nav-item .nav-badge {
  margin-left: auto;
  min-width: 21px;
  border-radius: 20px;
  padding: 1px 6px;
  color: #fff;
  background: var(--orange);
  font-size: 9px;
  text-align: center;
}

.student-class-switch {
  margin: 13px 5px 0;
  padding: 10px;
  border: 1px solid #e3ded3;
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.72);
}

.student-class-switch label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.student-class-switch select {
  min-height: 31px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 10px;
}

.student-class-switch small {
  display: block;
  margin-top: 4px;
  color: #9aa29d;
  font-size: 7px;
  line-height: 1.5;
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-quote {
  position: relative;
  margin: 16px 5px;
  padding: 17px 15px;
  border: 1px solid rgba(205, 200, 187, 0.65);
  border-radius: 15px;
  overflow: hidden;
  background: #f3efe4;
}

.sidebar-quote::after {
  content: "”";
  position: absolute;
  right: 10px;
  bottom: -27px;
  color: rgba(72, 106, 91, 0.09);
  font-family: Georgia, serif;
  font-size: 92px;
}

.sidebar-quote p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #68756e;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.8;
}

.sidebar-quote span {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  color: #a3a69b;
  font-size: 9px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 2px;
  border-top: 1px solid var(--line);
}

.profile-card .icon-button {
  width: 30px;
}

.avatar {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.profile-copy {
  min-width: 0;
  flex: 1;
}

.profile-copy strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 0.18s ease;
}

.icon-button:hover {
  color: var(--ink);
  background: rgba(53, 95, 78, 0.07);
}

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

.topbar {
  height: 65px;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 232, 0.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 25;
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
}

.mobile-logo .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.mobile-logo .brand-mark span {
  width: 2px;
}

.readonly-strip {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 18px;
  color: #735e38;
  background: #f6edd8;
  border-bottom: 1px solid #eadfc7;
  font-size: 10px;
  text-align: center;
}

.main-content {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 34px clamp(24px, 3.6vw, 54px) 60px;
}

.page-enter {
  animation: fadeUp 0.35s ease both;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-head h1,
.page-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(25px, 2.5vw, 33px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.page-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--green-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 15px;
  height: 1px;
  background: currentColor;
}

/* Common surfaces */
.panel {
  border: 1px solid rgba(224, 219, 208, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  min-height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid #ebe6db;
}

.panel-header h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.panel-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.panel-body {
  padding: 20px;
}

.panel-link {
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 0;
  color: var(--green-2);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  position: relative;
  min-height: 130px;
  border: 1px solid rgba(224, 219, 208, 0.88);
  border-radius: 15px;
  padding: 17px 18px;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.8);
}

.kpi-card::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -35px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.035;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  color: var(--muted);
  font-size: 11px;
}

.kpi-icon {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.kpi-card:nth-child(2) .kpi-icon {
  color: var(--orange);
  background: var(--orange-soft);
}

.kpi-card:nth-child(3) .kpi-icon {
  color: var(--gold);
  background: var(--gold-soft);
}

.kpi-card:nth-child(4) .kpi-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.kpi-value {
  margin-top: 13px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.kpi-value small {
  margin-left: 2px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.kpi-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
}

.trend-up {
  color: var(--green-2);
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 17px;
}

.span-7 {
  grid-column: span 7;
}

.span-5 {
  grid-column: span 5;
}

.span-8 {
  grid-column: span 8;
}

.span-4 {
  grid-column: span 4;
}

.span-6 {
  grid-column: span 6;
}

.span-12 {
  grid-column: span 12;
}

/* Charts */
.chart-wrap {
  min-height: 220px;
}

.line-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.line-chart .grid-line {
  stroke: #e8e4da;
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.line-chart .area {
  fill: url("#chartArea");
}

.line-chart .chart-line {
  fill: none;
  stroke: var(--green-2);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart .dot {
  fill: var(--surface);
  stroke: var(--green-2);
  stroke-width: 2;
}

.line-chart .chart-label {
  fill: #929b95;
  font-family: var(--sans);
  font-size: 10px;
}

.line-chart .value-label {
  fill: var(--green);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
}

.chart-legend {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 9px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-2);
}

.chart-legend span:last-child i {
  background: var(--orange);
}

.donut-layout {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 178px;
}

.donut {
  width: 132px;
  height: 132px;
  position: relative;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(226, 220, 208, 0.6);
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.1;
}

.donut-center span {
  color: var(--muted);
  font-size: 9px;
}

.donut-legend {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 11px;
}

.donut-legend-item {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}

.donut-legend-item i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.donut-legend-item span {
  color: var(--ink-soft);
}

.donut-legend-item strong {
  font-size: 11px;
}

/* Data table */
.data-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #bcc7c0 transparent;
}

.data-table-wrap::-webkit-scrollbar {
  height: 8px;
}

.data-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 10px;
  background: #bcc7c0;
  background-clip: padding-box;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th {
  padding: 10px 14px;
  color: #949d97;
  background: #faf8f2;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
}

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 20px;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 20px;
}

.data-table td {
  height: 62px;
  padding: 10px 14px;
  border-top: 1px solid #eeeae0;
  color: var(--ink-soft);
  font-size: 11px;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: #fcfaf5;
}

.data-table .clickable-row {
  cursor: pointer;
}

.student-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-cell .avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 12px;
}

.student-cell strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.student-cell small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.mastery-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-progress {
  width: 62px;
  height: 5px;
  overflow: hidden;
  border-radius: 10px;
  background: #e9e5db;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green-2);
}

.mastery-cell b {
  min-width: 28px;
  color: var(--ink);
  font-size: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 20px;
  padding: 3px 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 9px;
  font-weight: 600;
}

.tag.warm {
  color: #9e643b;
  background: var(--orange-soft);
}

.tag.gold {
  color: #8d682f;
  background: var(--gold-soft);
}

.tag.grey {
  color: #7c857f;
  background: #eeebe4;
}

.tag.red {
  color: var(--danger);
  background: var(--danger-soft);
}

.activity-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #d2d4cf;
}

.activity-dot.online {
  background: #65a382;
  box-shadow: 0 0 0 3px rgba(101, 163, 130, 0.12);
}

/* Student dashboard */
.welcome-banner {
  position: relative;
  min-height: 184px;
  margin-bottom: 22px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 29px 34px;
  overflow: hidden;
  color: #f9f7ef;
  background:
    radial-gradient(circle at 86% 12%, rgba(250, 228, 178, 0.16), transparent 15rem),
    linear-gradient(120deg, #315a49, #426f5d);
  box-shadow: 0 18px 50px rgba(53, 95, 78, 0.18);
}

.welcome-banner::before {
  content: "";
  position: absolute;
  right: 9%;
  bottom: -115px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  box-shadow:
    0 0 0 38px rgba(255, 255, 255, 0.025),
    0 0 0 88px rgba(255, 255, 255, 0.018);
}

.welcome-copy {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.welcome-date {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.welcome-copy h1 {
  margin: 12px 0 9px;
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.welcome-copy h1 em {
  color: #e7d3a5;
  font-style: normal;
}

.welcome-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.61);
  font-size: 11px;
}

.welcome-action {
  position: relative;
  z-index: 1;
  text-align: center;
  flex: 0 0 auto;
}

.due-orbit {
  width: 92px;
  height: 92px;
  margin: 0 auto 10px;
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: rgba(255, 255, 255, 0.06);
}

.due-orbit::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.due-orbit strong {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1;
}

.due-orbit span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 8px;
}

.welcome-action .btn {
  color: var(--green);
  background: #f5f0e5;
  border: 0;
  box-shadow: 0 8px 22px rgba(21, 45, 34, 0.18);
}

.activity-bars {
  height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding-top: 20px;
}

.bar-day {
  height: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
}

.bar-track {
  width: min(30px, 70%);
  min-height: 5px;
  flex: 0 0 auto;
  border-radius: 7px 7px 3px 3px;
  position: relative;
  background: #e8e5dc;
}

.bar-track span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 5px;
  border-radius: inherit;
  background: linear-gradient(to top, var(--green), #85a894);
  transition: height 0.5s ease;
}

.bar-day.today .bar-track span {
  background: linear-gradient(to top, var(--orange), #e4a080);
}

.bar-value {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.bar-label {
  color: var(--muted);
  font-size: 9px;
}

.category-list {
  display: flex;
  flex-direction: column;
}

.two-column-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}

.category-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #eee9df;
}

.category-row:first-child {
  border-top: 0;
}

.category-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: 0 0 auto;
}

.category-info {
  min-width: 0;
}

.category-info-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-info strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-info span {
  color: var(--muted);
  font-size: 9px;
}

.wide-progress {
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 10px;
  background: #eae7de;
}

.wide-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.category-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.category-row .icon-button {
  width: 29px;
  height: 29px;
}

.weak-list {
  display: flex;
  flex-direction: column;
}

.weak-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid #eee9df;
}

.weak-item:first-child {
  border-top: 0;
}

.weak-index {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #a76c45;
  background: var(--orange-soft);
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 700;
}

.weak-copy {
  min-width: 0;
  flex: 1;
}

.weak-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weak-copy span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weak-score {
  color: var(--orange);
  font-size: 10px;
  font-weight: 700;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 25px;
  text-align: center;
  color: var(--muted);
}

.empty-state .empty-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--green-2);
  background: var(--green-soft);
}

.empty-state strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 12px;
}

.empty-state p {
  max-width: 280px;
  margin: 0 auto;
  font-size: 10px;
  line-height: 1.7;
}

/* Student knowledge outline */
.study-catalog-page {
  max-width: 1120px;
}

.study-catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 23px;
  background:
    radial-gradient(circle at 90% 20%, rgba(199, 216, 204, 0.3), transparent 18rem),
    var(--surface);
}

.study-catalog-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.study-catalog-title .category-icon {
  width: 48px !important;
  height: 48px !important;
}

.study-catalog-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
}

.study-catalog-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.study-catalog-stats {
  display: flex;
  gap: 22px;
  white-space: nowrap;
}

.study-catalog-stats span {
  color: var(--muted);
  font-size: 9px;
}

.study-catalog-stats b {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
}

.study-catalog-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.study-outline-panel {
  position: sticky;
  top: 20px;
  overflow: hidden;
}

.study-outline-list {
  max-height: min(67vh, 650px);
  overflow-y: auto;
  padding: 7px;
}

.study-outline-row {
  min-width: 0;
  flex: 1;
  min-height: 43px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.study-outline-line {
  display: flex;
  align-items: stretch;
  padding-left: calc(var(--study-depth, 0) * 15px);
}

.study-outline-toggle,
.study-outline-toggle-placeholder {
  width: 20px;
  flex: 0 0 auto;
}

.study-outline-toggle {
  border: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.study-outline-toggle:hover {
  color: var(--ink-soft);
  background: #f0eee7;
  border-radius: 6px;
}

.study-outline-children[hidden] {
  display: none;
}

.study-outline-row:hover {
  background: #f5f3ec;
}

.study-outline-row.active {
  color: var(--green);
  background: var(--green-soft);
}

.study-outline-all {
  font-weight: 600;
}

.study-outline-all > svg {
  flex: 0 0 auto;
  color: var(--green-2);
}

.study-outline-depth {
  width: 12px;
  color: #a2aaa5;
  font-size: 9px;
  flex: 0 0 auto;
}

.study-outline-copy {
  min-width: 0;
  flex: 1;
}

.study-outline-copy strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-outline-copy small {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.study-outline-score {
  color: var(--muted);
  font-size: 8px;
}

.study-content-panel {
  min-width: 0;
  overflow: hidden;
}

.study-select-empty {
  min-height: 400px;
}

.study-content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid #ebe6db;
}

.study-content-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.study-content-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.study-mode-actions,
.study-point-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.study-point-list {
  max-height: min(62vh, 600px);
  overflow-y: auto;
  padding: 0 20px;
}

.study-point-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 90px auto;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-top: 1px solid #eee9df;
}

.study-point-row:first-child {
  border-top: 0;
}

.study-point-state {
  border-radius: 7px;
  padding: 3px 4px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 8px;
  text-align: center;
}

.study-point-state.new {
  color: var(--muted);
  background: #eeebe4;
}

.study-point-state.learning {
  color: #956a36;
  background: var(--gold-soft);
}

.study-point-copy {
  min-width: 0;
}

.study-point-copy strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.study-point-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.study-point-progress {
  display: flex;
  align-items: center;
  gap: 6px;
}

.study-point-progress .mini-progress {
  width: 55px;
}

.study-point-progress b {
  min-width: 27px;
  color: var(--ink-soft);
  font-size: 8px;
}

/* Study flow */
.study-page {
  max-width: 950px;
  margin: 0 auto;
}

.study-setup {
  padding: 8px 0;
}

.study-setup-head {
  max-width: 620px;
  margin: 0 auto 28px;
  text-align: center;
}

.study-setup-head h1 {
  margin: 13px 0 8px;
  font-family: var(--serif);
  font-size: clamp(29px, 4vw, 42px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.study-setup-head p {
  max-width: 460px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 17px;
}

.setup-card {
  position: relative;
  min-height: 178px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 21px;
  overflow: hidden;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.setup-card:hover {
  transform: translateY(-2px);
  border-color: #c7d2ca;
  box-shadow: var(--shadow-md);
}

.setup-card .category-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
}

.setup-card h3 {
  margin: 15px 0 4px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.setup-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.setup-card .setup-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 15px;
  color: var(--ink-soft);
  font-size: 9px;
}

.setup-card .setup-stats b {
  color: var(--ink);
}

.setup-card .setup-arrow {
  position: absolute;
  right: 18px;
  top: 21px;
  color: #b0b8b2;
}

.session-options {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
}

.session-options p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.session-options small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.session-options select {
  width: 130px;
}

.study-stage {
  position: relative;
}

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

.study-progress-head .back-link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  font-size: 11px;
  cursor: pointer;
}

.study-count {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.session-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 10px;
  background: #e4e1d7;
}

.session-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #789985);
  transition: width 0.35s ease;
}

.study-card {
  position: relative;
  min-height: min(550px, calc(100vh - 240px));
  margin-top: 17px;
  border: 1px solid #e2ddd2;
  border-radius: 25px;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4vw, 44px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(249, 245, 235, 0.65), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-md);
}

.study-card::before {
  content: "";
  position: absolute;
  right: -75px;
  top: -75px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(56, 94, 77, 0.06);
  border-radius: 50%;
  box-shadow:
    0 0 0 35px rgba(56, 94, 77, 0.018),
    0 0 0 75px rgba(56, 94, 77, 0.014);
}

.study-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 30px;
  padding: 5px 10px 5px 7px;
  color: var(--ink-soft);
  background: #f1eee6;
  font-size: 9px;
}

.category-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.card-mastery {
  color: var(--muted);
  font-size: 9px;
}

.card-mastery b {
  color: var(--green-2);
  font-size: 11px;
}

.study-question {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px 0;
  text-align: center;
}

.study-question .question-label {
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.study-term {
  max-width: 760px;
  font-family: var(--serif);
  font-size: clamp(36px, 6vw, 65px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.24;
  word-break: break-word;
}

.study-hint-wrap {
  min-height: 30px;
  margin-top: 21px;
}

.hint-button {
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.hint-button:hover {
  color: var(--ink-soft);
  background: var(--surface-soft);
}

.study-hint {
  max-width: 560px;
  border: 1px dashed #dfd7c8;
  border-radius: 9px;
  padding: 7px 11px;
  color: #817866;
  background: #faf6ed;
  font-size: 10px;
}

.study-option-section {
  width: min(760px, 100%);
  margin-top: 20px;
  text-align: left;
}

.study-option-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 9px;
}

.option-mode-badge {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--green-2);
  background: var(--green-soft);
  font-weight: 700;
}

.study-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.study-option {
  min-height: 52px;
  border: 1px solid #ddd7ca;
  border-radius: 11px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  color: var(--ink-soft);
  background: #faf8f2;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.study-option:hover:not(:disabled) {
  border-color: #b9cbbf;
  background: var(--green-soft);
  transform: translateY(-1px);
}

.study-option.selected {
  border-color: var(--green-2);
  background: var(--green-soft);
}

.study-option.correct {
  border-color: #6c987f;
  color: #284c3d;
  background: #e4f1e8;
}

.study-option.wrong {
  border-color: #d68a71;
  color: #7f3d2d;
  background: #fae8e1;
}

.study-option:disabled {
  cursor: default;
}

.study-option-letter {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--green-2);
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}

.study-option-check {
  display: grid;
  place-items: center;
}

.option-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 10px;
}

.option-result.correct {
  color: #28503e;
  background: #e4f1e8;
}

.option-result.wrong {
  color: #7f3d2d;
  background: #fae8e1;
}

.study-answer {
  width: min(670px, 100%);
  margin-top: 25px;
  padding-top: 23px;
  border-top: 1px solid #ebe5d9;
  animation: fadeUp 0.28s ease both;
}

.study-answer .answer-label {
  color: var(--green-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.study-answer .answer-text {
  margin: 9px auto 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(18px, 2.4vw, 25px);
  line-height: 1.7;
}

.study-example {
  margin: 15px auto 0;
  max-width: 600px;
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
  line-height: 1.8;
}

.markdown-body {
  font-style: normal;
  text-align: left;
  overflow-wrap: anywhere;
}

.markdown-body p {
  margin: 0 0 0.7em;
}

.markdown-body p:last-child {
  margin-bottom: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 0.7em 0 0.35em;
  color: var(--ink);
  font-family: var(--serif);
  font-style: normal;
  line-height: 1.4;
}

.markdown-body h1 {
  font-size: 1.55em;
}

.markdown-body h2 {
  font-size: 1.35em;
}

.markdown-body h3 {
  font-size: 1.2em;
}

.markdown-body h4 {
  font-size: 1.08em;
}

.markdown-body strong {
  color: var(--ink);
  font-weight: 700;
}

.markdown-body em {
  color: var(--ink-soft);
}

.markdown-body code {
  border: 1px solid #e3ded3;
  border-radius: 5px;
  padding: 1px 5px;
  color: #7b4c36;
  background: #f4efe6;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.92em;
}

.markdown-body pre {
  max-width: 100%;
  margin: 0.7em 0;
  border: 1px solid #ded8cc;
  border-radius: 10px;
  padding: 13px 15px;
  overflow-x: auto;
  color: #e9f1ec;
  background: #243a31;
  text-align: left;
  white-space: pre;
}

.markdown-body pre code {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font-size: 11px;
  line-height: 1.65;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0.45em 0;
  padding-left: 1.7em;
}

.markdown-body li + li {
  margin-top: 0.2em;
}

.markdown-body blockquote {
  margin: 0.65em 0;
  border-left: 3px solid #99b2a5;
  padding: 5px 11px;
  color: var(--ink-soft);
  background: #f6f3ec;
}

.markdown-body a {
  color: var(--green-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.study-attachments {
  margin-top: 14px;
}

.attachment-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
}

.attachment-image-card {
  min-width: 0;
  border: 1px solid #ded8cc;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  color: var(--ink-soft);
  background: #f8f5ee;
  text-align: left;
  cursor: zoom-in;
}

.attachment-image-card img {
  width: 100%;
  height: 135px;
  display: block;
  object-fit: cover;
  background: #eeeae1;
}

.attachment-image-card span {
  display: block;
  overflow: hidden;
  padding: 7px 9px;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-files {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.attachment-file {
  width: 100%;
  min-height: 48px;
  border: 1px solid #ded8cc;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  color: var(--ink-soft);
  background: #faf8f2;
  text-align: left;
  cursor: pointer;
}

.attachment-file:hover {
  border-color: #bdcbc3;
  background: var(--green-soft);
}

.attachment-file-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--green-2);
  background: var(--green-soft);
}

.attachment-file > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.attachment-file strong {
  display: block;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-file small {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.attachment-loading,
.attachment-error {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}

.attachment-loading .loading-spinner {
  width: 17px;
  height: 17px;
}

.attachment-error {
  color: var(--danger);
}

.image-preview-modal {
  width: min(900px, 100%);
}

.image-preview-modal .modal-body {
  display: grid;
  place-items: center;
  max-height: calc(100vh - 180px);
  overflow: auto;
  background: #f4f1e9;
}

.image-preview-modal img {
  max-width: 100%;
  max-height: calc(100vh - 220px);
  object-fit: contain;
}

.study-actions {
  position: relative;
  z-index: 1;
  padding-top: 18px;
  border-top: 1px solid #ece7dd;
}

.action-prompt {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.rating-button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #f6f2ea;
  cursor: pointer;
  transition: 0.18s ease;
}

.rating-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.rating-button .rating-key {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #8f968f;
  background: rgba(255, 255, 255, 0.7);
  font-size: 8px;
}

.rating-button strong {
  font-size: 11px;
  font-weight: 600;
}

.rating-button small {
  color: var(--muted);
  font-size: 8px;
}

.rating-0 {
  color: var(--danger);
  background: var(--danger-soft);
}

.rating-1 {
  color: #9e7440;
  background: var(--gold-soft);
}

.rating-2 {
  color: var(--green-2);
  background: var(--green-soft);
}

.rating-3 {
  color: #416b58;
  background: #dcebe2;
}

.keyboard-tip {
  margin-top: 12px;
  color: #a2aaa5;
  font-size: 8px;
  text-align: center;
}

kbd {
  border: 1px solid #ded9ce;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 4px;
  color: #8b938e;
  background: #fff;
  font-family: var(--sans);
  font-size: 8px;
}

.completion-card {
  max-width: 620px;
  margin: 35px auto;
  padding: 44px;
  text-align: center;
}

.completion-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  box-shadow:
    0 0 0 10px var(--green-soft),
    0 15px 35px rgba(53, 95, 78, 0.2);
}

.completion-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
}

.completion-card > p {
  margin: 9px auto 28px;
  color: var(--muted);
  font-size: 11px;
}

.completion-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 28px;
}

.completion-stat {
  border-radius: 12px;
  padding: 14px 8px;
  background: var(--surface-soft);
}

.completion-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 23px;
}

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

.completion-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
}

/* Knowledge management */
.category-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.category-stat-card {
  position: relative;
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: var(--surface);
  transition: 0.18s ease;
}

.category-card-main {
  width: 100%;
  min-height: 124px;
  border: 0;
  display: block;
  padding: 17px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.category-card-actions {
  position: absolute;
  right: 9px;
  bottom: 8px;
  display: flex;
  gap: 1px;
  opacity: 0;
  transform: translateY(3px);
  transition: 0.18s ease;
}

.category-stat-card:hover .category-card-actions,
.category-stat-card:focus-within .category-card-actions {
  opacity: 1;
  transform: translateY(0);
}

.category-card-actions .icon-button {
  width: 26px;
  height: 26px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 2px 7px rgba(45, 60, 52, 0.08);
}

.category-stat-card:hover,
.category-stat-card.active {
  transform: translateY(-1px);
  border-color: #c8d1ca;
  box-shadow: var(--shadow-sm);
}

.category-stat-card.active {
  box-shadow: inset 0 0 0 1px var(--green-2);
}

.category-stat-card .category-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.category-stat-card h3 {
  margin: 11px 0 2px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.category-stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.category-stat-card .card-count {
  position: absolute;
  right: 16px;
  top: 16px;
  color: var(--muted);
  font-size: 9px;
}

.category-stat-card .card-count b {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 20px;
  border-bottom: 1px solid #ebe6db;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  position: relative;
  width: min(260px, 100%);
}

.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca49f;
}

.search-box input {
  min-height: 35px;
  padding: 7px 11px 7px 34px;
  font-size: 11px;
}

.filter-select {
  width: 130px;
  min-height: 35px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 10px;
}

.class-scope-select {
  width: 145px;
  min-height: 39px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 11px;
}

.page-size-select {
  width: 105px;
  min-height: 31px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 9px;
}

.knowledge-term {
  max-width: 320px;
  white-space: normal;
}

.knowledge-workspace {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.knowledge-table-panel {
  min-width: 0;
  min-height: max(560px, calc(100vh - 210px));
}

.outline-panel {
  position: sticky;
  top: 20px;
  overflow: hidden;
}

.outline-placeholder {
  min-height: 360px;
}

.outline-head {
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #ebe6db;
}

.outline-head span {
  display: block;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.outline-head small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.outline-all {
  width: calc(100% - 16px);
  min-height: 34px;
  margin: 8px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.outline-all:hover,
.outline-all.active {
  color: var(--green);
  background: var(--green-soft);
}

.outline-all span {
  flex: 1;
}

.outline-all em,
.group-row-main em {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.group-tree {
  max-height: min(56vh, 520px);
  overflow-y: auto;
  padding: 2px 8px 8px;
}

.knowledge-progress-tree {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.progress-tree-node {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.progress-tree-node.category {
  border-color: #cbd8d0;
  background: #fbfcf9;
}

.progress-tree-node > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
}

.progress-tree-node > summary::-webkit-details-marker {
  display: none;
}

.progress-tree-node > summary::before {
  content: "›";
  color: var(--green-2);
  font-size: 16px;
  transition: transform 0.15s ease;
}

.progress-tree-node[open] > summary::before {
  transform: rotate(90deg);
}

.progress-tree-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
}

.progress-tree-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-tree-stats {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.progress-tree-stat {
  border-radius: 999px;
  padding: 4px 7px;
  color: #65736a;
  background: #f2f5f1;
  font-size: 8px;
  white-space: nowrap;
}

.progress-tree-stat b {
  color: var(--green-2);
  font-size: 10px;
}

.progress-tree-node.category > summary {
  background: linear-gradient(90deg, #eef5f0, #fbfcf9);
}

.progress-tree-node.category .progress-tree-title strong {
  color: var(--ink);
  font-size: 11px;
}

.progress-tree-node.category .progress-tree-stat {
  background: #fff;
  box-shadow: inset 0 0 0 1px #dce7df;
}

.progress-tree-children {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px 20px;
}

.progress-tree-point {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(90px, 0.8fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #eee9df;
  padding: 10px 6px;
  color: var(--muted);
  font-size: 9px;
}

.progress-tree-point.overview-point {
  grid-template-columns: minmax(180px, 2fr) minmax(140px, 1fr) auto auto auto;
}

.progress-tree-point .knowledge-term {
  min-width: 0;
}

.progress-tree-point .knowledge-term span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-row {
  min-height: 33px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  padding-left: calc(3px + var(--tree-depth, 0) * 15px);
  position: relative;
}

.group-row:hover,
.group-row.active {
  background: #f5f3ec;
}

.group-row.active {
  color: var(--green);
  background: var(--green-soft);
}

.group-toggle {
  width: 19px;
  height: 25px;
  border: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.group-toggle.empty {
  pointer-events: none;
}

.group-row-main {
  min-width: 0;
  border: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  padding: 5px 2px;
  color: inherit;
  background: transparent;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.group-row-main span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-row-actions {
  display: none;
  align-items: center;
  padding-right: 2px;
}

.group-row:hover .group-row-actions,
.group-row:focus-within .group-row-actions {
  display: flex;
}

.group-row-actions .icon-button {
  width: 22px;
  height: 22px;
}

.outline-empty {
  padding: 26px 10px;
  color: var(--muted);
  text-align: center;
}

.outline-empty p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.outline-empty small {
  font-size: 8px;
}

.outline-foot {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid #eee9df;
  color: var(--muted);
  background: #fbf8f1;
  font-size: 8px;
  line-height: 1.6;
}

.group-path-tag {
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 9px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.knowledge-term strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}

.knowledge-term span {
  display: block;
  max-width: 260px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
}

.table-actions {
  display: flex;
  gap: 3px;
}

.coverage-cell {
  min-width: 100px;
}

.coverage-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
}

.coverage-head b {
  color: var(--ink-soft);
}

.coverage-cell .wide-progress {
  margin-top: 5px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-top: 1px solid #eee9df;
  color: var(--muted);
  font-size: 9px;
}

.pagination-buttons {
  display: flex;
  gap: 4px;
}

.pagination-buttons button {
  min-width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 9px;
  cursor: pointer;
}

.pagination-buttons button.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

/* Student detail */
.student-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 21px 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 50%, rgba(198, 215, 203, 0.34), transparent 20rem),
    var(--surface);
}

.student-hero .avatar {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  font-size: 22px;
}

.student-hero h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.student-hero p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.student-hero-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.hero-metric strong {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
}

.hero-metric span {
  color: var(--muted);
  font-size: 8px;
}

.back-button {
  margin-bottom: 15px;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.filter-tabs {
  display: flex;
  gap: 3px;
  overflow-x: auto;
}

.filter-tab {
  border: 0;
  border-radius: 7px;
  padding: 5px 9px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  white-space: nowrap;
  cursor: pointer;
}

.filter-tab.active {
  color: var(--green);
  background: var(--green-soft);
  font-weight: 700;
}

.recent-list {
  display: flex;
  flex-direction: column;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-top: 1px solid #eee9df;
}

.recent-item:first-child {
  border-top: 0;
}

.recent-status {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.recent-status.correct {
  color: var(--green);
  background: var(--green-soft);
}

.recent-status.wrong {
  color: var(--danger);
  background: var(--danger-soft);
}

.recent-copy {
  flex: 1;
  min-width: 0;
}

.recent-copy strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-copy span {
  color: var(--muted);
  font-size: 8px;
}

.recent-time {
  color: var(--muted);
  font-size: 8px;
}

/* Classes and accounts */
.teacher-class-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.teacher-class-option {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}

.teacher-class-option:hover,
.teacher-class-option.active {
  border-color: #b7c8be;
  box-shadow: var(--shadow-sm);
}

.teacher-class-option.active {
  background: var(--green-soft);
}

.teacher-class-option > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.teacher-class-option strong {
  display: block;
  font-family: var(--serif);
  font-size: 12px;
}

.teacher-class-option small {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.teacher-class-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 14px;
  padding: 20px 23px;
  background:
    radial-gradient(circle at 85% 20%, rgba(198, 215, 203, 0.28), transparent 20rem),
    var(--surface);
}

.teacher-class-hero-main {
  display: flex;
  align-items: center;
  gap: 15px;
}

.teacher-class-emblem {
  width: 55px;
  height: 55px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(53, 95, 78, 0.16);
}

.teacher-class-hero h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
}

.teacher-class-hero p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.teacher-class-stats {
  display: flex;
  gap: 27px;
  padding-left: 25px;
  border-left: 1px solid var(--line);
}

.teacher-class-stats div {
  text-align: center;
}

.teacher-class-stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
}

.teacher-class-stats span {
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.teacher-class-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.class-members-panel {
  min-width: 0;
}

.class-member-list {
  max-height: 260px;
  overflow-y: auto;
}

.class-member {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-top: 1px solid #eee9df;
}

.class-member:first-child {
  border-top: 0;
}

.class-member .avatar {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  font-size: 11px;
}

.class-member > div {
  min-width: 0;
  flex: 1;
}

.class-member strong {
  display: block;
  font-size: 10px;
}

.class-member span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-members {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.class-knowledge-panel {
  overflow: hidden;
}

.class-knowledge-list {
  padding: 0 20px;
}

.class-knowledge-row {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #eee9df;
}

.class-knowledge-row:first-child {
  border-top: 0;
}

.class-knowledge-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
}

.class-knowledge-main input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  flex: 0 0 auto;
}

.class-knowledge-main span {
  min-width: 0;
}

.class-knowledge-main strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
}

.class-knowledge-main small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-class-section {
  margin-bottom: 16px;
}

.admin-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}

.admin-section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.admin-section-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.class-management-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.class-management-card {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  background: var(--surface);
  transition: 0.18s ease;
}

.class-management-card:hover {
  border-color: #c6d0c9;
  box-shadow: var(--shadow-sm);
}

.class-card-icon {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--green);
  background: var(--green-soft);
}

.class-card-copy {
  min-width: 0;
  flex: 1;
}

.class-card-copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
}

.class-card-copy span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-card-actions {
  display: flex;
  gap: 1px;
  opacity: 0;
  transition: 0.18s ease;
}

.class-management-card:hover .class-card-actions,
.class-management-card:focus-within .class-card-actions {
  opacity: 1;
}

.class-card-actions .icon-button {
  width: 27px;
  height: 27px;
}

.admin-account-panel .data-table td {
  height: 57px;
}

.admin-toolbar .toolbar-left {
  flex-wrap: wrap;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b0b5b1;
}

.status-dot.on {
  background: #5c9878;
}

.inactive-row {
  opacity: 0.64;
}

.account-active-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--surface-soft);
}

.account-active-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.account-active-toggle strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
}

.account-active-toggle small {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.access-section + .access-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.access-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 11px;
}

.access-section-head strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.access-section-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.access-section-head em {
  color: var(--green-2);
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}

.access-class-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.access-student-list {
  max-height: 310px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.access-student-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-top: 1px solid #eee9df;
}

.access-student-row:first-child {
  border-top: 0;
}

.access-student-row .avatar {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  font-size: 10px;
}

.access-student-copy {
  min-width: 0;
  flex: 1;
}

.access-student-copy strong {
  display: block;
  font-size: 10px;
}

.access-student-copy span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-student-row select {
  width: 112px;
  min-height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 9px;
}

.class-knowledge-modal-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.class-knowledge-modal-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-top: 1px solid #eee9df;
  cursor: pointer;
}

.class-knowledge-modal-row:first-child {
  border-top: 0;
}

.class-knowledge-modal-row:hover {
  background: var(--surface-soft);
}

.class-knowledge-modal-row > span {
  min-width: 0;
  flex: 1;
}

.class-knowledge-modal-row strong {
  display: block;
  font-size: 11px;
}

.class-knowledge-modal-row small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-knowledge-modal-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.point-access-toolbar,
.student-point-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 9px;
}

.point-access-toolbar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.teacher-access-list {
  display: grid;
  gap: 8px;
}

.teacher-access-option {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: var(--surface-soft);
  cursor: pointer;
}

.teacher-access-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--green-2);
}

.teacher-access-option > span {
  min-width: 0;
}

.teacher-access-option strong,
.teacher-access-option small {
  display: block;
}

.teacher-access-option small {
  color: var(--muted);
}

.teacher-permission-toggles {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.teacher-permission-toggles label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.teacher-permission-toggles input {
  width: 15px;
  height: 15px;
}

.student-point-selector {
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.student-point-selector label {
  color: var(--ink-soft);
  font-weight: 600;
}

.student-point-selector select {
  width: 220px;
  min-height: 33px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 10px;
}

.point-access-list {
  max-height: min(55vh, 520px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.point-access-row {
  min-height: 55px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 11px 8px calc(11px + var(--point-depth, 0) * 16px);
  border-top: 1px solid #eee9df;
}

.point-tree-group-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px calc(9px + var(--group-depth, 0) * 16px);
  color: var(--ink-soft);
  background: #f8f6ef;
  border-top: 1px solid #e9e4d9;
  cursor: default;
}

.point-tree-group:first-child .point-tree-group-row {
  border-top: 0;
}

.point-tree-group-row:hover {
  background: #f1efe7;
}

.point-tree-group-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.point-expand-toggle {
  width: 20px;
  height: 22px;
  border: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.point-expand-toggle svg {
  transition: transform 0.18s ease;
}

.point-expand-toggle.expanded svg {
  transform: rotate(90deg);
}

.point-tree-group-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  cursor: pointer;
}

.point-tree-group-row strong {
  flex: 1;
  font-size: 10px;
  font-weight: 600;
}

.point-tree-group-row span {
  color: var(--muted);
  font-size: 8px;
}

.point-access-row:first-child {
  border-top: 0;
}

.point-access-copy {
  min-width: 0;
  flex: 1;
}

.point-access-copy strong {
  display: block;
  color: var(--ink);
  font-size: 10px;
}

.point-access-copy span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.point-access-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.point-access-row select {
  width: 102px;
  min-height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 9px;
}

.class-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.class-choice {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: var(--surface-soft);
  cursor: pointer;
}

.class-choice:has(input:checked) {
  border-color: #a9c1b4;
  background: var(--green-soft);
}

.class-choice input {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
  flex: 0 0 auto;
}

.class-choice span {
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
}

.class-choice small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 400;
}

.account-classes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.account-classes span {
  border-radius: 20px;
  padding: 2px 7px;
  color: #486758;
  background: var(--green-soft);
  font-size: 8px;
}

.muted-text {
  color: var(--muted);
  font-size: 9px;
}

/* Report */
.report-summary {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 17px;
  margin-bottom: 17px;
}

.mastery-summary-card {
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mastery-summary-card .donut {
  margin: 5px auto 17px;
}

.mastery-summary-copy {
  text-align: center;
}

.mastery-summary-copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.mastery-summary-copy span {
  color: var(--muted);
  font-size: 9px;
}

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

.report-category {
  border: 1px solid #e8e3d8;
  border-radius: 13px;
  padding: 15px;
  background: #fdfbf6;
}

.report-category-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.report-category-top .category-icon {
  width: 31px;
  height: 31px;
  border-radius: 9px;
}

.report-category-top strong {
  display: block;
  font-size: 10px;
}

.report-category-top span {
  color: var(--muted);
  font-size: 8px;
}

.report-category-top b {
  margin-left: auto;
  font-family: var(--serif);
  font-size: 17px;
}

/* Modal and toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(25, 40, 33, 0.38);
  backdrop-filter: blur(7px);
  animation: fadeUp 0.18s ease both;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  overflow-y: auto;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.25s ease both;
}

.modal.wide {
  width: min(680px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 23px 17px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.modal-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.modal-body {
  padding: 21px 23px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 15px 23px 21px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .span-all {
  grid-column: 1 / -1;
}

.form-grid textarea {
  min-height: 82px;
}

.markdown-preview {
  margin-top: 9px;
  border: 1px dashed #d6cfc1;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbf9f3;
}

.markdown-preview > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.markdown-preview .markdown-body {
  max-height: 220px;
  overflow-y: auto;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.7;
}

.point-attachment-editor {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: var(--surface-soft);
}

.point-option-editor {
  display: grid;
  gap: 7px;
  margin: 9px 0 8px;
}

.point-option-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 7px;
}

.option-letter {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--green-2);
  background: var(--green-soft);
  font-size: 9px;
  font-weight: 700;
}

.point-option-row input[type="text"],
.point-option-row > input:not([type]) {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  background: #fff;
}

.option-correct-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.option-correct-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--green-2);
}

.point-attachment-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  padding: 5px 6px;
  background: #fffdf9;
}

.point-attachment-item > span {
  color: var(--green-2);
  flex: 0 0 auto;
}

.point-attachment-item > div {
  min-width: 0;
  flex: 1;
}

.point-attachment-item strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.point-attachment-item small {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.upload-zone {
  border: 1.5px dashed #d1cbbd;
  border-radius: 14px;
  padding: 28px 20px;
  justify-items: center;
  text-align: center;
  background: #fbf9f3;
  cursor: pointer;
  transition: 0.18s ease;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--green-2);
  background: var(--green-soft);
}

.upload-zone .upload-icon {
  width: 45px;
  height: 45px;
  margin: 0 auto 11px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.upload-zone strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.upload-zone p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.upload-zone .selected-file {
  margin-top: 10px;
  color: var(--green-2);
  font-size: 10px;
  font-weight: 600;
}

.import-help {
  margin-top: 14px;
  border-radius: 10px;
  padding: 10px 12px;
  color: #7d7566;
  background: #f7f2e7;
  font-size: 9px;
  line-height: 1.7;
}

.import-help code {
  color: #675f51;
  font-family: Consolas, monospace;
}

.divider-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 15px 0;
  color: var(--muted);
  font-size: 8px;
}

.divider-label::before,
.divider-label::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.toast-root {
  position: fixed;
  z-index: 200;
  right: 23px;
  bottom: 23px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  min-width: 250px;
  max-width: 380px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  color: #fff;
  background: #2b4438;
  box-shadow: 0 12px 30px rgba(30, 46, 38, 0.22);
  font-size: 11px;
  animation: fadeUp 0.25s ease both;
}

.toast.error {
  background: #8d4c42;
}

.toast .toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.12);
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #ebe8df;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.loading-page {
  min-height: 65vh;
  display: grid;
  place-items: center;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid #d7ddd8;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (max-width: 1180px) {
  :root {
    --sidebar: 210px;
  }

  .main-content {
    padding: 28px 25px 50px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-workspace {
    grid-template-columns: 225px minmax(0, 1fr);
  }

  .class-management-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-class-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-content h1 {
    font-size: 58px;
  }

  .story-features {
    gap: 16px;
  }
}

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

  .login-story {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 30px 22px;
  }

  .login-box .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 38px;
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 700;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 29;
    background: rgba(29, 43, 36, 0.28);
    backdrop-filter: blur(2px);
  }

  .topbar {
    display: flex;
  }

  .main-content {
    padding: 24px 20px 45px;
  }

  .span-7,
  .span-5,
  .span-8,
  .span-4,
  .span-6 {
    grid-column: span 12;
  }

  .welcome-banner {
    align-items: flex-start;
    padding: 28px;
  }

  .welcome-action {
    align-self: center;
  }

  .study-card {
    min-height: calc(100vh - 210px);
  }

  .knowledge-workspace {
    grid-template-columns: 1fr;
  }

  .teacher-class-layout {
    grid-template-columns: 1fr;
  }

  .study-catalog-layout {
    grid-template-columns: 1fr;
  }

  .study-outline-panel {
    position: static;
  }

  .study-outline-list {
    max-height: 300px;
  }

  .outline-panel {
    position: static;
  }

  .group-tree {
    max-height: 320px;
  }
}

@media (max-width: 650px) {
  .progress-tree-point,
  .progress-tree-point.overview-point {
    grid-template-columns: 1fr;
  }

  .progress-tree-node > summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .progress-tree-stats {
    width: 100%;
    justify-content: flex-start;
    padding-left: 22px;
  }

  .progress-tree-children {
    padding-left: 10px;
  }

  .main-content {
    padding: 20px 14px 36px;
  }

  .topbar {
    height: 58px;
    padding: 0 14px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 20px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .kpi-card {
    min-height: 118px;
    padding: 14px;
  }

  .kpi-value {
    font-size: 26px;
  }

  .dashboard-grid {
    gap: 12px;
  }

  .panel-header,
  .panel-body {
    padding-left: 15px;
    padding-right: 15px;
  }

  .welcome-banner {
    min-height: 245px;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
  }

  .welcome-copy h1 {
    font-size: 27px;
  }

  .welcome-action {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  .due-orbit {
    width: 62px;
    height: 62px;
    margin: 0;
  }

  .due-orbit strong {
    font-size: 24px;
  }

  .login-box h2 {
    font-size: 29px;
  }

  .demo-accounts {
    grid-template-columns: 1fr;
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }

  .two-column-list {
    grid-template-columns: 1fr;
  }

  .study-card {
    min-height: calc(100vh - 185px);
    padding: 20px 16px;
    border-radius: 19px;
  }

  .study-term {
    font-size: 33px;
  }

  .study-answer .answer-text {
    font-size: 18px;
  }

  .rating-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rating-button {
    min-height: 44px;
  }

  .category-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .class-management-grid {
    grid-template-columns: 1fr;
  }

  .teacher-class-picker {
    grid-template-columns: 1fr;
  }

  .teacher-class-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .teacher-class-stats {
    width: 100%;
    justify-content: space-between;
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

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

  .class-knowledge-list {
    padding: 0 15px;
  }

  .class-knowledge-row {
    align-items: flex-start;
    padding: 11px 0;
  }

  .student-point-selector {
    align-items: stretch;
    flex-direction: column;
  }

  .student-point-selector select {
    width: 100%;
  }

  .point-access-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .study-catalog-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .study-catalog-title h1 {
    font-size: 22px;
  }

  .study-catalog-stats {
    width: 100%;
    justify-content: space-between;
  }

  .study-content-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .study-content-head .btn {
    width: 100%;
  }

  .study-mode-actions {
    width: 100%;
  }

  .study-mode-actions .btn {
    width: auto;
    flex: 1;
  }

  .study-point-list {
    padding: 0 14px;
  }

  .study-point-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .study-point-progress {
    grid-column: 2 / 3;
    grid-row: 2;
  }

  .study-point-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-items: stretch;
    flex-direction: column;
  }

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

  .toolbar-left {
    flex-wrap: wrap;
  }

  .search-box {
    width: 100%;
  }

  .filter-select {
    flex: 1;
  }

  .student-hero {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 18px;
  }

  .student-hero-meta {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    padding-top: 13px;
    border-top: 1px solid var(--line);
  }

  .report-summary {
    grid-template-columns: 1fr;
  }

  .category-report-grid {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: end;
  }

  .modal {
    max-height: calc(100vh - 20px);
    border-radius: 20px 20px 13px 13px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-all {
    grid-column: auto;
  }

  .session-options {
    grid-template-columns: 1fr;
  }

  .session-options select {
    width: 100%;
  }

  .completion-card {
    padding: 33px 20px;
  }

  .completion-actions {
    flex-direction: column;
  }

  .toast-root {
    left: 13px;
    right: 13px;
    bottom: 13px;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }
}

@media (hover: none) {
  .category-card-actions,
  .class-card-actions {
    opacity: 1;
    transform: none;
  }

  .group-row-actions {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
