:root {
  --brand-navy: #1E3A5F;
  --brand-navy-strong: #142A45;
  --brand-red: #A61B1B;
  --brand-red-strong: #7F1D1D;
  --page-bg: #F1F5F9;
  --card-bg: #FFFFFF;
  --border: #E9EDF3;
  --border-strong: #D8E0EA;
  --text-main: #0F172A;
  --text-secondary: #64748B;
  --text-weak: #94A3B8;
  --status-green: #166534;
  --status-green-bg: #EAF6EE;
  --status-orange: #B45309;
  --status-orange-bg: #FEF6E9;
  --status-red: #B91C1C;
  --status-red-bg: #FDECEC;
  color: var(--text-main);
  background: var(--page-bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  background: rgba(15, 23, 42, 0.88);
}

.lightbox-overlay.hidden {
  display: none;
}

.lightbox-image {
  max-width: 96vw;
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  touch-action: pinch-zoom;
}

.lightbox-caption {
  margin-top: 12px;
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

body.lightbox-open {
  overflow: hidden;
}

.question-attachment img[data-lightbox-src] {
  cursor: zoom-in;
}

.deep-link-highlight {
  animation: deep-link-pulse 2.4s ease-out;
}

@keyframes deep-link-pulse {
  0% {
    background: #FEF3C7;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.4);
  }

  60% {
    background: #FEF3C7;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
  }

  100% {
    background: transparent;
    box-shadow: none;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
}

.site-filing-footer {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

.site-filing-footer a {
  color: inherit;
  text-decoration: none;
}

.site-filing-footer a:hover,
.site-filing-footer a:focus-visible {
  color: var(--brand-red);
  text-decoration: underline;
}

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

.app-feedback {
  position: fixed;
  top: 92px;
  right: 20px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 16px;
  border: 1px solid #BBF7D0;
  border-radius: 999px;
  background: #F0FDF4;
  color: #166534;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.is-login-screen .app-feedback {
  top: 20px;
}

.app-feedback.visible {
  opacity: 1;
  transform: translateY(0);
}

.app-feedback.error {
  border-color: #FECACA;
  background: #FEF2F2;
  color: #B91C1C;
}

.app-feedback.warning {
  border-color: #FDE68A;
  background: #FFFBEB;
  color: #92400E;
}

.app {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.is-login-screen .app {
  width: min(1240px, calc(100vw - 32px));
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 32px 0;
}

.is-login-screen .topbar {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 10px 26px rgba(30, 58, 95, 0.08);
  box-sizing: border-box;
}

.topbar-context {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.topbar-title {
  color: var(--text-main);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.topbar-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
}

.login-panel {
  width: 100%;
  margin: 18px 0;
}

.login-grid {
  display: grid;
  gap: 16px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(440px, 1fr);
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.12);
  border: 1px solid #F1F5F9;
  overflow: hidden;
  width: min(1240px, calc(100vw - 64px));
  margin: 48px auto;
  min-height: 660px;
}

.login-brand-card {
  position: relative;
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  overflow: hidden;
  min-height: 660px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.login-brand-image {
  position: absolute;
  inset: 0;
  background-color: #1e3a5f;
  background-image: url("../assets/school-building.jpg");
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.login-brand-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 30, 60, 0.55) 0%, rgba(15, 30, 60, 0.78) 100%);
  z-index: 1;
}

.login-brand-content {
  position: relative;
  z-index: 2;
}

.login-brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  margin-bottom: 32px;
  border: 0;
}

.login-brand-mark img {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
}

.login-eyebrow {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.login-brand-card h1 {
  margin: 0 0 14px;
  color: #FFFFFF;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.login-brand-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.80);
  font-size: 15px;
  line-height: 1.8;
  max-width: 420px;
}

.login-brand-address {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
}

.login-feature-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 500;
}

.login-feature svg {
  flex-shrink: 0;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
  background: #FFFFFF;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  gap: 28px;
}

.login-card-head h2 {
  margin: 0 0 8px;
  color: #1E293B;
  font-size: 26px;
  font-weight: 700;
}

.login-card-head p {
  margin: 0;
  font-size: 14px;
  color: #94A3B8;
}

.login-card .field label {
  font-size: 13px;
  color: #64748B;
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}

.login-card .field input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  font-size: 15px;
  box-sizing: border-box;
  background: #FFFFFF;
  color: #1E293B;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-card .field input:focus {
  outline: none;
  border-color: #A61B1B;
  box-shadow: 0 0 0 3px rgba(166, 27, 27, 0.12);
}

.login-submit {
  width: 100%;
  height: 50px;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  border-radius: 12px;
}

.login-help {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #94A3B8;
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 960px) {
  .login-shell {
    grid-template-columns: 1fr;
    width: calc(100vw - 32px);
    margin: 24px 16px;
    min-height: auto;
  }

  .login-brand-card {
    min-height: 320px;
    padding: 40px 28px;
  }

  .login-brand-card h1 {
    font-size: 26px;
  }

  .login-card {
    padding: 40px 28px;
  }
}

.password-change-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #F1F5F9;
}

.user-dropdown .password-change-form {
  grid-template-columns: 1fr;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.hidden {
  display: none !important;
}

.brand {
  font-size: 24px;
  font-weight: 900;
}

.sub {
  margin-top: 6px;
  color: #667085;
  font-size: 14px;
}

.user-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.user-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  background: var(--card-bg);
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(30, 58, 95, 0.08);
}

.notification-bell-button {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--brand-navy);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(30, 58, 95, 0.08);
}

.notification-bell-button:hover {
  border-color: var(--brand-red);
  color: var(--brand-red);
}

.notification-bell-icon,
.notification-bell-icon svg {
  width: 20px;
  height: 20px;
}

.notification-bell-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 9px;
  height: 9px;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  background: var(--brand-red);
}

.notification-bell-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
  border-radius: 999px;
  background: var(--brand-red);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.user-menu-text {
  display: grid;
  gap: 1px;
  text-align: left;
}

.user-menu-text strong {
  font-size: 13px;
  font-weight: 800;
}

.user-menu-text small {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.menu-chevron {
  color: #64748b;
  font-size: 16px;
  line-height: 1;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 380px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
}

.user-dropdown-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.user-logout {
  width: 100%;
  margin-top: 12px;
}

.ghost-button,
.role-tab,
.primary-button {
  min-height: 40px;
  border: 1px solid #A61B1B;
  border-radius: 6px;
  padding: 0 14px;
  background: #FFFFFF;
  color: #A61B1B;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  border-color: #A61B1B;
  background: #A61B1B;
  color: #FFFFFF;
}

.primary-button:hover {
  border-color: #861313;
  background: #861313;
}

.role-tabs {
  display: none;
  gap: 10px;
  margin: 18px 0;
}

.role-tab.active {
  border-color: #A61B1B;
  background: #FFF5F5;
  color: #A61B1B;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.workspace-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.summary-grid.module-nav {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0;
  border-radius: 12px;
  border: 1px solid rgba(30, 58, 95, 0.18);
  padding: 16px;
  background: var(--brand-navy);
  box-shadow: 0 16px 34px rgba(30, 58, 95, 0.16);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 4px 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-logo {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: #FFFFFF;
  object-fit: cover;
}

.sidebar-title {
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.sidebar-subtitle {
  margin-top: 4px;
  color: #C9D5E5;
  font-size: 14px;
  font-weight: 800;
}

.module-nav-item {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #E7EEF8;
  box-shadow: none;
}

.module-nav-item.active {
  border-color: rgba(255, 255, 255, 0.76);
  border-left: 3px solid var(--brand-red);
  background: #FFFFFF;
  color: var(--brand-red);
  font-weight: 900;
}

.module-main {
  display: flex;
  min-width: 0;
  align-items: center;
}

.module-icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-right: 12px;
  color: currentColor;
  position: relative;
}

.module-icon svg {
  width: 22px;
  height: 22px;
}

.module-card-trail {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.module-card-trail:empty {
  display: none;
}

.student-mobile-home-card {
  display: none;
}

.module-nav-item.active .metric-label {
  color: var(--brand-red);
  font-weight: 900;
}

.module-nav-item.active .module-note {
  color: var(--brand-red-strong);
  opacity: 1;
}

.module-note {
  display: block;
  margin-top: 5px;
  color: #C9D5E5;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.metric {
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand-navy);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 8px 22px rgba(30, 58, 95, 0.07);
}

.metric-button {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.metric-button:hover {
  border-color: var(--brand-red);
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.08);
  transform: translateY(-1px);
}

.metric-button.active {
  border-color: var(--brand-red);
  background: #FFF5F5;
  color: var(--brand-red);
}

.module-nav-item.metric-button.active {
  border-color: rgba(255, 255, 255, 0.76);
  border-left: 3px solid var(--brand-red);
  background: #FFFFFF;
  color: var(--brand-red);
}

.todo-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.todo-item:hover {
  border-color: var(--brand-red);
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.08);
}

.todo-card-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: #FFF5F5;
  color: var(--brand-red);
}

.todo-card-icon svg {
  width: 18px;
  height: 18px;
}

.metric-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.module-nav-item .metric-label {
  color: inherit;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
}

.metric-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #A61B1B;
  background: var(--brand-red);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.metric-value-zero {
  display: none;
}

.module-nav-item-has-unread .metric-value {
  background: #A61B1B;
  color: #FFFFFF;
}

.module-nav-item.active .metric-value {
  background: #A61B1B;
  color: #FFFFFF;
}

.module-icon-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  background: #DC2626;
  border-radius: 50%;
  border: 1.5px solid #FFFFFF;
  box-sizing: border-box;
  pointer-events: none;
}

.role-view {
  min-height: 620px;
}

.insight-panel {
  min-height: 520px;
}

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

.panel-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 12px;
}

.panel-grid.three {
  grid-template-columns: 0.9fr 1fr 1fr;
}

.admin-subject-workspace {
  max-width: 760px;
}

.admin-subject-panel {
  display: grid;
  gap: 16px;
}

.exam-management {
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
}

.exam-subject-snapshot {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #F8FAFC;
}

.exam-list {
  grid-template-columns: minmax(0, 1fr);
}

.exam-item {
  display: grid;
  gap: 10px;
}

.exam-score-workspace {
  gap: 12px;
}

.exam-score-toolbar {
  display: grid;
  gap: 14px;
}

.exam-score-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.exam-score-import-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.exam-score-import-form input[type="file"] {
  max-width: 100%;
}

.exam-score-table-scroll {
  overflow-x: auto;
}

.exam-score-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13px;
}

.exam-score-table th,
.exam-score-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #E2E8F0;
  text-align: left;
  white-space: nowrap;
}

.exam-score-table th {
  background: #F8FAFC;
  color: #334155;
  font-weight: 800;
}

.score-summary-table td:last-child,
.subject-score-table td:last-child {
  font-weight: 800;
  color: #1E293B;
}

.score-class-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #B91C1C;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.score-class-link:hover,
.score-class-link.active {
  text-decoration: underline;
}

.principal-score-detail {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid #CBD5E1;
  border-radius: 999px;
  background: #FFFFFF;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.subject-dictionary-list {
  display: grid;
  gap: 10px;
}

.subject-dictionary-row,
.subject-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.subject-dictionary-row {
  padding: 10px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #F8FAFC;
}

.panel {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  min-height: 220px;
}

.compact-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 12px;
}

.compact-stat {
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 72px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px;
  background: #F8FAFC;
  color: #6B7280;
  font-size: 12px;
  font-weight: 700;
}

.compact-stat strong {
  color: #0f172a;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}

.compact-stat span {
  color: #6B7280;
  font-size: 12px;
  font-weight: 700;
}

.compact-stat.risk strong {
  color: #E02020;
}

.class-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.class-comparison-grid .compact-stat {
  padding: 12px;
}

.class-pressure-list {
  display: grid;
  gap: 12px;
}

.class-pressure-row {
  display: grid;
  gap: 12px;
  padding: 15px 16px;
}

.class-pressure-main,
.class-pressure-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.class-pressure-level {
  min-width: 42px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.class-pressure-level.high {
  background: var(--status-red-bg);
  color: var(--status-red);
}

.class-pressure-level.medium {
  background: var(--status-orange-bg);
  color: var(--status-orange);
}

.class-pressure-level.low {
  background: var(--status-green-bg);
  color: var(--status-green);
}

.class-pressure-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #EEF2F7;
}

.class-pressure-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: var(--status-green);
}

.class-pressure-bar-fill.medium {
  background: var(--status-orange);
}

.class-pressure-bar-fill.high {
  background: var(--status-red);
}

.class-pressure-footer {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.teacher-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.teacher-comparison-grid .compact-stat {
  padding: 12px;
}

.adviser-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.adviser-comparison-grid .compact-stat {
  padding: 12px;
}

.daily-report {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.daily-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.daily-report-grid .compact-stat {
  padding: 12px;
}

.daily-report-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.trend-section {
  grid-column: 1 / -1;
}

.trend-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
}

.trend-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 14px;
}

.trend-table th,
.trend-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #E2E8F0;
  text-align: left;
  white-space: nowrap;
}

.trend-table th {
  color: #64748B;
  background: #FFF7F7;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 19px;
  font-weight: 900;
}

.panel-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.role-home-overview {
  display: grid;
  gap: 16px;
}

.role-home-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 8px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #FFFFFF 0%, #FFF7F7 54%, #F8FAFC 100%);
}

.role-home-eyebrow {
  margin-bottom: 6px;
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 900;
}

.role-home-hero h2 {
  margin: 0;
  color: var(--brand-navy);
  font-size: 24px;
  line-height: 1.25;
}

.role-home-hero p {
  margin: 8px 0 0;
  max-width: 680px;
  color: #667085;
  font-size: 14px;
  line-height: 1.65;
}

.role-home-date {
  flex: 0 0 auto;
  border: 1px solid rgba(166, 27, 27, 0.14);
  border-radius: 999px;
  padding: 8px 12px;
  background: #FFFFFF;
  color: var(--brand-red);
  font-weight: 900;
}

.role-home-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.role-home-metric {
  display: grid;
  gap: 8px;
  min-height: 92px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 16px;
  background: #FFFFFF;
  color: #667085;
  text-align: left;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.05);
}

.role-home-metric:hover {
  border-color: rgba(166, 27, 27, 0.28);
  box-shadow: 0 12px 26px rgba(23, 32, 51, 0.08);
}

.role-home-metric span {
  font-size: 13px;
  font-weight: 800;
}

.role-home-metric strong {
  color: var(--brand-navy);
  font-size: 28px;
  line-height: 1.1;
}

.role-home-metric.risk strong {
  color: var(--brand-red);
}

.role-home-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px;
}

.role-home-panel {
  min-height: 0;
}

.role-home-panel-body {
  display: grid;
  gap: 10px;
}

.role-home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.role-home-action {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px;
  background: #F8FAFC;
  color: var(--brand-navy);
  font-weight: 900;
  text-align: left;
}

.role-home-action:hover {
  border-color: rgba(166, 27, 27, 0.28);
  background: #FFF7F7;
}

.role-home-action .module-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(166, 27, 27, 0.12);
  background: #FFFFFF;
  color: var(--brand-red);
}

.role-home-student-card .student-mobile-home-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(30, 58, 95, 0.08);
  border-radius: 8px;
  padding: 16px;
  background: #FFFFFF;
}

.role-home-student-card .student-mobile-home-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: var(--brand-navy);
  color: #FFFFFF;
  font-size: 22px;
  font-weight: 900;
}

.role-home-average-list {
  display: grid;
  gap: 10px;
}

.role-home-average-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr);
  align-items: center;
  gap: 14px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px;
  background: #F8FAFC;
}

.role-home-average-row strong,
.role-home-average-row span {
  display: block;
}

.role-home-average-row span {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.role-home-average-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.role-home-average-bar b {
  color: var(--brand-navy);
  text-align: right;
}

.student-filter-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 160px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.study-task-filter-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.item.study-task-empty {
  grid-column: 1 / -1;
  min-height: 140px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  text-align: center;
  background: #F8FAFC;
}

.admin-action-panel {
  min-height: auto;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.34);
}

.drawer-panel {
  position: relative;
  right: 0;
  width: min(520px, calc(100vw - 24px));
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid #E2E8F0;
  background: #FFFFFF;
  padding: 24px;
  box-shadow: -20px 0 44px rgba(15, 23, 42, 0.18);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #F1F5F9;
}

.drawer-title {
  color: #0f172a;
  font-size: 22px;
  font-weight: 900;
}

.drawer-close {
  flex: 0 0 auto;
}

.drawer-form {
  gap: 14px;
}

.filter-count {
  color: #667085;
  font-size: 13px;
  font-weight: 800;
  white-space: normal;
}

.list-limit {
  padding: 8px 2px;
}

.student-profile {
  min-height: 620px;
}

.student-create {
  min-height: 420px;
}

.student-import {
  min-height: 420px;
}

.attendance-sync {
  min-height: 420px;
}

.check-in-panel,
.schedule-panel {
  min-height: 420px;
}

.admin-schedule {
  min-width: 0;
}

.admin-schedule-workspace {
  gap: 14px;
}

.form-row {
  display: grid;
  gap: 12px;
}

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

.form-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-row.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.class-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 8px;
  align-items: center;
  min-height: 54px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 10px;
  background: #F8FAFC;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.class-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-sizing: border-box;
  box-shadow: none;
  transition: none;
  accent-color: #A61B1B;
}

.class-check small {
  grid-column: 2;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.schedule-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.admin-auto-schedule {
  display: grid;
  gap: 12px;
  border: 1px solid #FECACA;
  border-radius: 10px;
  padding: 16px;
  background: #FFF7F7;
}

.admin-auto-schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.admin-auto-schedule textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid #FCA5A5;
  border-radius: 8px;
  padding: 12px;
  background: #FFFFFF;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.65;
}

.admin-auto-schedule-result {
  border-radius: 8px;
  padding: 10px 12px;
  background: #FFFFFF;
}

.admin-broadcast-schedule {
  display: grid;
  gap: 14px;
}

.admin-term-schedule-delete {
  border-color: #FECACA;
  background: #FFF7F7;
}

.admin-term-schedule-delete form {
  border: 1px solid #FEE2E2;
  border-radius: 8px;
  padding: 14px;
  background: #FFFFFF;
}

.admin-live-broadcast-form {
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 14px;
  background: #FFF7F7;
}

.admin-live-broadcast-form textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
}

.admin-broadcast-list {
  gap: 10px;
}

.broadcast-group {
  display: grid;
  gap: 12px;
  border-color: #FECACA;
  background: #FFFDFD;
}

.broadcast-edit-form {
  display: grid;
  gap: 10px;
  border: 1px solid #FEE2E2;
  border-radius: 8px;
  padding: 12px;
  background: #FFFFFF;
}

.broadcast-group-actions {
  display: grid;
  gap: 10px;
}

.broadcast-class-pills,
.broadcast-class-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.broadcast-class-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #FECACA;
  border-radius: 999px;
  padding: 5px 8px 5px 10px;
  background: #FFF5F5;
  color: #A61B1B;
  font-size: 12px;
  font-weight: 900;
}

.broadcast-class-pill button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: #FEE2E2;
  color: #991B1B;
  cursor: pointer;
  font-weight: 900;
}

.broadcast-class-add select {
  min-height: 34px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 0 10px;
  background: #FFFFFF;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.admin-schedule-editor {
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px;
  background: #FFFFFF;
}

.admin-schedule-editor summary {
  cursor: pointer;
  color: #A61B1B;
  font-size: 15px;
  font-weight: 900;
}

.admin-schedule-editor[open] summary {
  margin-bottom: 12px;
}

.admin-schedule-table-wrap {
  overflow-x: auto;
  border: 1px solid #FECACA;
  border-radius: 8px;
  background: #FFFFFF;
}

.admin-schedule-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-schedule-table th,
.admin-schedule-table td {
  border-bottom: 1px solid #FEE2E2;
  border-right: 1px solid #FEE2E2;
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

.admin-schedule-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #FFF5F5;
  color: #A61B1B;
  font-size: 12px;
  font-weight: 900;
}

.admin-schedule-table th:last-child,
.admin-schedule-table td:last-child {
  border-right: 0;
}

.admin-schedule-table tr:last-child td {
  border-bottom: 0;
}

.admin-schedule-table input,
.admin-schedule-table select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 0 8px;
  background: #FFFFFF;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.admin-schedule-table td:nth-child(1) {
  width: 92px;
}

.admin-schedule-table td:nth-child(2) {
  width: 142px;
}

.admin-schedule-table td:nth-child(3),
.admin-schedule-table td:nth-child(4),
.admin-schedule-table td:nth-child(5) {
  width: 170px;
}

.admin-schedule-table td:nth-child(6) {
  width: 96px;
}

[data-add-admin-schedule-row] {
  width: 100%;
  min-height: 42px;
  border-style: dashed;
  border-color: #A61B1B;
  background: #FFF5F5;
}

[data-remove-admin-schedule-row] {
  border-color: transparent;
  background: transparent;
  color: #E02020;
}

.admin-schedule-matrix {
  min-width: 900px;
  table-layout: fixed;
}

.admin-schedule-matrix th,
.admin-schedule-matrix td {
  text-align: center;
}

.admin-schedule-matrix th:first-child,
.admin-schedule-matrix td:first-child {
  width: 118px;
}

.admin-schedule-matrix th:last-child,
.admin-schedule-matrix td:last-child {
  width: 76px;
}

.admin-schedule-matrix td[data-admin-schedule-day] {
  min-width: 104px;
  padding: 6px;
  background: #FFFFFF;
}

.admin-schedule-matrix td[data-admin-schedule-day] input,
.admin-schedule-matrix td[data-admin-schedule-day] select {
  min-height: 30px;
  margin-bottom: 5px;
  padding: 0 6px;
  font-size: 12px;
}

.admin-schedule-matrix td[data-admin-schedule-day] input[data-admin-schedule-field="subject"] {
  min-height: 34px;
  border-color: #E2E8F0;
  background: #FFFDFD;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.admin-schedule-teacher-label {
  min-height: 18px;
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.admin-schedule-break td {
  background: #FFF7ED;
  color: #7C2D12;
  font-weight: 900;
  text-align: center;
}

.check-in-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin: 10px 0;
  border: 1px dashed #b8c0cf;
  border-radius: 8px;
  padding: 0 18px;
  background: #FFF5F5;
  color: #A61B1B;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

.check-in-session-list {
  display: grid;
  gap: 10px;
}

.check-in-session-row {
  display: grid;
  gap: 10px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px;
  background: #FFFFFF;
}

.check-in-row-main,
.check-in-row-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.check-in-row-title {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.check-in-row-meta {
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.check-in-code.compact {
  min-height: 34px;
  margin: 0;
  padding: 0 12px;
  font-size: 14px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.check-in-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.check-in-advanced-options {
  border: 1px dashed #FCA5A5;
  border-radius: 10px;
  padding: 10px 12px;
  background: #FFF7F7;
}

.check-in-advanced-options > summary {
  color: #A61B1B;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.check-in-advanced-options .form {
  margin-top: 12px;
}

.check-in-stat-line {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 220px;
  gap: 6px;
}

.check-in-inline-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  padding: 4px 8px;
  background: #F8FAFC;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.check-in-inline-stat strong {
  display: inline;
  color: #0f172a;
  font-size: 13px;
  line-height: 1;
}

.check-in-inline-stat.risk {
  border-color: #FECACA;
  background: #FEF2F2;
  color: #B91C1C;
}

.check-in-inline-stat.risk strong {
  color: #E02020;
}

.check-in-row-action {
  white-space: nowrap;
}

.check-in-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}

.check-in-page-actions {
  display: flex;
  gap: 8px;
}

.check-in-page-button {
  min-height: 34px;
  border: 1px solid #FCA5A5;
  border-radius: 8px;
  padding: 0 12px;
  background: #FFFFFF;
  color: #A61B1B;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.check-in-page-button:disabled {
  border-color: #E2E8F0;
  color: #94A3B8;
  cursor: not-allowed;
}

.question-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}

.question-page-actions {
  display: flex;
  gap: 8px;
}

.schedule-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 76px 120px minmax(90px, 1fr) minmax(90px, 1fr) 88px;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #F1F5F9;
  padding-top: 8px;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.schedule-row.has-actions {
  grid-template-columns: 76px 120px minmax(90px, 1fr) minmax(90px, 1fr) 88px 72px;
}

.schedule-template-settings-form {
  grid-template-columns: minmax(0, 1fr);
}

.schedule-template-settings-form textarea {
  min-height: 72px;
  resize: vertical;
}

.schedule-template {
  grid-column: 1 / -1;
  overflow: hidden;
  padding: 0;
  border-color: #CBD5E1;
  background: #FFFFFF;
}

.schedule-template-title {
  background: #C40000;
  color: #FFFFFF;
  padding: 12px 18px 10px;
  text-align: center;
  font-size: 30px;
  font-family: "SimSun", "Songti SC", "Microsoft YaHei", serif;
  font-weight: 500;
  line-height: 1.15;
}

.schedule-template-head {
  position: relative;
  background: #C40000;
}

.schedule-template-head .schedule-template-title {
  background: transparent;
  padding-right: 160px;
}

.schedule-copy-button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #FFFFFF;
}

.schedule-template-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border-right: 1px solid #111827;
  border-left: 1px solid #111827;
  padding: 4px 10px;
  color: #111827;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
}

.schedule-template-scroll {
  position: relative;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.schedule-template-scroll::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 32px;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.schedule-template-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
  color: #111827;
  font-family: "SimSun", "Songti SC", "Microsoft YaHei", serif;
  font-size: 15px;
}

.schedule-template-table th,
.schedule-template-table td {
  min-height: 28px;
  border: 1px solid #111827;
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
  line-height: 1.2;
}

.schedule-template-table th:first-child,
.schedule-template-table td:first-child {
  width: 96px;
}

.schedule-template-table th {
  background: #FFFFFF;
  color: #111827;
  font-size: 16px;
  font-weight: 900;
}

.schedule-template-time {
  white-space: nowrap;
  font-weight: 800;
}

.schedule-template-break td {
  height: 28px;
  background: #FFFFFF;
  font-weight: 900;
}

.schedule-template-lesson {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: #111827;
  font-weight: 500;
}

.schedule-template-lesson .small-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.schedule-broadcast-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border-radius: 999px;
  padding: 2px 6px;
  background: #FEE2E2;
  color: #A61B1B;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.schedule-template-lesson .schedule-swap-form {
  width: min(360px, 100%);
  text-align: left;
}

.schedule-template-table tfoot td {
  padding: 6px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}

.schedule-template-published {
  padding: 8px 12px 12px;
  color: #667085;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
}

.schedule-swap-form {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px;
  background: #FFFFFF;
}

.student-schedule-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.student-schedule-row {
  display: grid;
  grid-template-columns: 76px 132px minmax(120px, 1fr);
  gap: 12px;
  align-items: center;
  border-top: 1px solid #F1F5F9;
  padding-top: 10px;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.student-schedule-row strong {
  color: #0f172a;
}

.schedule-note {
  margin-top: -4px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.student-import textarea {
  min-height: 150px;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.attendance-sync textarea,
.schedule-panel textarea,
.admin-schedule textarea {
  min-height: 150px;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.student-create-form {
  max-width: 720px;
}

.admin-schedule-form {
  max-width: none;
}

.communication-form {
  margin-top: 14px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
}

.student-profile-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #F8FAFC;
}

.student-profile-details {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.student-profile-detail-section {
  padding: 12px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
}

.student-profile-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.student-profile-detail-item {
  min-width: 0;
}

.student-profile-detail-label {
  display: block;
  color: #64748B;
  font-size: 12px;
  line-height: 1.4;
}

.student-profile-detail-value {
  display: block;
  margin-top: 3px;
  color: #0F172A;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.student-self-profile {
  max-width: 920px;
}

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

.student-profile-locked-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #F8FAFC;
}

.student-profile-locked-item span {
  display: block;
  color: #64748B;
  font-size: 12px;
  font-weight: 800;
}

.student-profile-locked-item strong {
  display: block;
  margin-top: 4px;
  color: #0F172A;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.student-profile-housing-fields {
  padding: 12px;
  border: 1px dashed #CBD5E1;
  border-radius: 8px;
  background: #F8FAFC;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.profile-record-section {
  min-width: 0;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px;
  background: #FFFFFF;
}

.profile-record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.profile-record-head .sub-title {
  margin-bottom: 0;
}

.profile-record-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.sub-title {
  margin-bottom: 10px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #FFFFFF;
  color: #0f172a;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field input:not([type="checkbox"]):focus,
.field select:focus,
.field textarea:focus,
.admin-schedule-table input:not([type="checkbox"]):focus,
.admin-schedule-table select:focus,
input:not([type="checkbox"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #A61B1B;
  box-shadow: 0 0 0 3px rgba(166, 27, 27, 0.1);
}

.field input[type="file"] {
  padding: 9px 12px;
}

.question-image {
  cursor: pointer;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.attachment-preview {
  padding: 8px 10px;
  border: 1px dashed #CBD5E1;
  border-radius: 8px;
  background: #F8FAFC;
}

.leave-request {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #F1F5F9;
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.list.table-list {
  grid-template-columns: minmax(0, 1fr);
}

.list.compact-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  background: var(--card-bg);
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.05);
  box-sizing: border-box;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.item:hover {
  border-color: var(--border-strong);
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.08);
}

.item.schedule-template {
  padding: 0;
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 8px;
}

.item-title {
  font-weight: 900;
  color: var(--text-main);
}

.compact-list .item,
.profile-record-list .item {
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: none;
}

.compact-list .item-head,
.profile-record-list .item-head {
  align-items: flex-start;
  margin-bottom: 4px;
}

.compact-list .summary-box,
.profile-record-list .summary-box {
  margin-top: 8px;
  padding: 10px;
}

.compact-list .person-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.compact-list .person-card .item-head {
  min-width: 0;
  margin: 0;
}

.compact-list .person-card .actions {
  margin: 0;
  justify-content: flex-end;
}

.compact-list .person-card .risk-detail {
  grid-column: 1 / -1;
  margin-top: 0;
  padding: 8px 10px;
}

.person-card {
  min-width: 0;
}

.staff-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.staff-account-row:hover {
  border-color: rgba(166, 27, 27, 0.24);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.staff-account-card {
  border-left: 3px solid rgba(166, 27, 27, 0.2);
}

.staff-account-card.staff-status-disabled {
  border-left-color: #94A3B8;
  background: #F8FAFC;
}

.staff-account-row:focus-visible {
  outline: none;
  border-color: #A61B1B;
  box-shadow: 0 0 0 3px rgba(166, 27, 27, 0.12);
}

.staff-account-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.staff-account-main .item-title,
.staff-account-main .muted {
  display: block;
}

.staff-account-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.staff-role-tag {
  border-color: rgba(30, 58, 95, 0.16);
  background: #F2F6FA;
  color: var(--brand-navy);
}

.staff-role-tag-teacher {
  border-color: #BFDBFE;
  background: #EFF6FF;
  color: #1D4ED8;
}

.staff-role-tag-adviser {
  border-color: #FECACA;
  background: #FFF5F5;
  color: var(--brand-red);
}

.staff-role-tag-lecturer {
  border-color: #DDD6FE;
  background: #F5F3FF;
  color: #6D28D9;
}

.staff-role-tag-principal {
  border-color: #CBD5E1;
  background: #F8FAFC;
  color: #334155;
}

.staff-role-tag-logistics {
  border-color: #BBF7D0;
  background: #F0FDF4;
  color: #166534;
}

.staff-status-tag.staff-status-active {
  border-color: #BBF7D0;
  background: #F0FDF4;
  color: #166534;
}

.staff-status-tag.staff-status-disabled {
  border-color: #CBD5E1;
  background: #F1F5F9;
  color: #64748B;
}

.staff-account-manage-hint {
  color: #A61B1B;
  font-size: 13px;
  font-weight: 900;
}

.teaching-teacher-workspace {
  gap: 12px;
}

.teaching-teacher-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: auto;
  padding: 16px 20px;
}

.teaching-teacher-toolbar .panel-title {
  margin-bottom: 4px;
}

.teaching-teacher-toolbar .muted {
  max-width: 680px;
}

.teaching-teacher-toolbar .primary-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 18px;
}

.teaching-teacher-list-panel,
.teaching-teacher-sheet-panel {
  min-height: auto;
  padding: 20px;
}

.teaching-teacher-list {
  gap: 10px;
}

.teaching-teacher-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 64px;
  padding: 12px 14px;
  appearance: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.teaching-teacher-row:hover {
  border-color: rgba(166, 27, 27, 0.24);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.teaching-teacher-row:focus-visible {
  outline: none;
  border-color: #A61B1B;
  box-shadow: 0 0 0 3px rgba(166, 27, 27, 0.12);
}

.teaching-teacher-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.teaching-teacher-main .item-title,
.teaching-teacher-main .muted {
  display: block;
}

.teaching-teacher-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.teaching-teacher-edit-button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.teaching-teacher-sheet-panel .item {
  min-height: auto;
  padding: 14px 16px;
  box-shadow: none;
}

.class-management-item {
  padding: 0;
  overflow: hidden;
}

.class-management-card {
  border-left: 3px solid rgba(30, 58, 95, 0.18);
}

.class-term-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
  color: #475467;
  font-size: 13px;
  font-weight: 900;
}

.class-term-toolbar select {
  min-width: 150px;
}

.class-term-sections {
  display: grid;
  gap: 14px;
}

.class-term-section {
  display: grid;
  gap: 8px;
}

.class-term-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--brand-navy);
  font-size: 14px;
  font-weight: 900;
}

.class-term-tag {
  border-color: rgba(166, 27, 27, 0.18);
  background: #FFF4F4;
  color: #A61B1B;
  font-size: 12px;
  font-weight: 900;
}

.class-management-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.class-management-summary::-webkit-details-marker {
  display: none;
}

.class-management-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.class-management-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.class-management-count {
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}

.class-student-count-tag {
  border-color: #D7DEE8;
  background: #F8FAFC;
  color: var(--brand-navy);
}

.class-management-edit-hint {
  color: #A61B1B;
  font-size: 13px;
  font-weight: 900;
}

.class-management-item[open] .class-management-summary {
  border-bottom: 1px solid #F1F5F9;
  background: #FFFDFD;
}

.class-management-item[open] .class-management-edit-hint {
  color: #667085;
}

.class-management-form.compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.class-management-form .class-row-actions {
  align-self: stretch;
  margin-top: 0;
}

.class-management-roster {
  grid-column: 1 / -1;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #F8FAFC;
  padding: 12px;
}

.class-management-roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: #1D2939;
  font-size: 13px;
  font-weight: 900;
}

.class-management-roster-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.class-management-student {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  background: #FFFFFF;
  padding: 8px 10px;
}

.class-management-student-name {
  color: #101828;
  font-size: 13px;
  font-weight: 900;
}

.account-drawer-summary,
.account-drawer-actions {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #F8FAFC;
  padding: 16px;
}

.account-drawer-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.account-drawer-actions .small-button {
  width: 100%;
  justify-content: center;
}

.person-identity {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: center;
}

.person-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #FFF5F5;
  color: #A61B1B;
  font-size: 16px;
  font-weight: 800;
}

.person-avatar.small {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.person-identity.compact .person-avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.notification-item {
  border-left: 4px solid #A61B1B;
  background: #FFFFFF;
}

.notification-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 6px;
}

.audit-log {
  background: #FFFFFF;
  border-left: 4px solid #0f7b45;
}

.audit-filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #F8FAFC;
}

.audit-filter label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.audit-filter-count {
  align-self: center;
  color: #64748B;
  font-weight: 800;
}

.audit-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0 0;
  color: #64748B;
  font-size: 13px;
  font-weight: 800;
}

.course-card {
  background: #FFFFFF;
}

.course-record {
  background: #FFFFFF;
}

.account-management {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
}

.course-detail {
  min-height: 620px;
}

.course-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #F8FAFC;
}

.course-detail-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0;
}

.course-watch-form {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #FFFFFF;
}

.backup-validation {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #FFFFFF;
}

.backup-validation .sub-title {
  order: 1;
}

.backup-validation .compact-form {
  order: 2;
}

.backup-restore-warning {
  order: 3;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid #ffd8de;
  border-radius: 8px;
  background: #fff7f8;
}

#backup-validation-result {
  order: 4;
}

.compact-form {
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: end;
}

.course-question-box {
  margin-top: 16px;
}

.course-meta {
  margin: 5px 0;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.course-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.course-status-row span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #F8FAFC;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}

.course-status-row .small-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.teacher-sheet-panel {
  min-width: 0;
}

.selected-item {
  border-color: #A61B1B;
  background: #FFF5F5;
}

.teacher-sheet-summary {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, auto);
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.teacher-sheet-table-wrap {
  overflow-x: auto;
}

.teacher-sheet-table {
  min-width: 560px;
}

.teacher-sheet-week-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748B;
  font-size: 13px;
}

.teacher-sheet-week-switch select {
  min-width: 132px;
}

.teacher-sheet-grid {
  min-width: 640px;
}

.teacher-sheet-grid th:first-child {
  min-width: 118px;
}

.teacher-sheet-grid th small {
  display: block;
  margin-top: 2px;
  color: #64748B;
  font-weight: 500;
}

.teacher-sheet-grid td {
  min-width: 132px;
  vertical-align: top;
}

.teacher-sheet-lesson {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 6px;
  background: #FFF7F7;
  color: #0F172A;
}

.teacher-sheet-lesson span {
  color: #64748B;
  font-size: 12px;
}

.question-attachment {
  width: min(260px, 100%);
  margin: 10px 0 0;
}

.question-attachment img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
}

.question-attachment figcaption {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.question-message-thread {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.question-message {
  display: grid;
  gap: 4px;
  max-width: min(560px, 100%);
}

.question-message-teacher {
  justify-self: end;
}

.question-message-meta {
  color: #667085;
  font-size: 12px;
}

.question-message-teacher .question-message-meta {
  text-align: right;
}

.question-message-bubble {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 9px 10px;
  background: #F8FAFC;
  color: #1F2937;
  line-height: 1.55;
  word-break: break-word;
}

.question-message-teacher .question-message-bubble {
  border-color: #FECACA;
  background: #FEF2F2;
}

.question-message-media {
  justify-self: start;
}

.question-message-teacher .question-message-media {
  justify-self: end;
}

.question-message-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
}

.question-message-box label {
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}

.question-message-box textarea {
  width: 100%;
  min-height: 64px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 9px 10px;
  resize: vertical;
}

.summary-box {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
}

.summary-box label {
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}

.summary-box textarea {
  width: 100%;
  min-height: 58px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 9px 10px;
  resize: vertical;
}

.question-extra-fields {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  border-top: 1px dashed #E2E8F0;
  padding-top: 8px;
}

.question-extra-fields > summary {
  color: #475569;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.question-extra-fields[open] > summary {
  margin-bottom: 6px;
  color: #A61B1B;
}

.leave-review-note {
  margin-top: 8px;
  border: 1px solid #FED7AA;
  border-radius: 8px;
  padding: 8px 10px;
  background: #FFF7ED;
  color: #9A3412;
  font-size: 13px;
  line-height: 1.55;
}

.leave-return-status {
  margin-top: 6px;
  color: #7F1D1D;
  font-weight: 700;
}

.leave-extension-meta {
  margin-top: 6px;
  color: #475569;
  font-weight: 700;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
}

.summary-readonly {
  color: #475467;
  font-size: 13px;
  line-height: 1.55;
}

.follow-up-result {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.study-task {
  background: #FFFFFF;
}

.study-task-submit {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.study-task-review {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.study-task-submit textarea {
  min-height: 72px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
}

.study-task-review textarea {
  min-height: 72px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
}

.follow-up-result textarea {
  min-height: 72px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 10px 12px;
  color: #0f172a;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  resize: vertical;
}

.risk-detail {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #F1F5F9;
  color: #475467;
  font-size: 13px;
  line-height: 1.55;
}

.risk-detail strong {
  color: #0f172a;
}

.muted {
  color: #667085;
  font-size: 13px;
  line-height: 1.5;
}

.badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #F1F5F9;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.badge.pending,
.badge.unassigned,
.badge.open,
.badge.late,
.badge.leave,
.badge.ready,
.badge.scheduled,
.badge.partial,
.badge.assigned,
.badge.revision_requested,
.badge.not_started {
  background: #FFF5F5;
  color: #A61B1B;
}

.badge.resolved,
.badge.approved,
.badge.stable,
.badge.present,
.badge.submitted,
.badge.verified,
.badge.completed {
  background: #E6FFFB;
  color: #13C2C2;
}

.badge.risk,
.badge.rejected,
.badge.absent,
.badge.missing {
  background: #FEF2F2;
  color: #E02020;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.assignment-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.assignment-row select {
  min-width: 0;
}

.small-button {
  min-height: 34px;
  border: 1px solid #A61B1B;
  border-radius: 6px;
  padding: 0 11px;
  background: #FFFFFF;
  color: #A61B1B;
  font-weight: 800;
  cursor: pointer;
}

.small-button:hover {
  background: #FFF5F5;
}

.small-button.danger {
  border-color: #FECACA;
  color: #E02020;
  background: #FEF2F2;
}

.small-button[data-add-admin-schedule-row] {
  width: 100%;
  min-height: 42px;
  border-style: dashed;
  border-color: #A61B1B;
  background: #FFF5F5;
}

.small-button[data-remove-admin-schedule-row] {
  border-color: transparent;
  background: transparent;
  color: #E02020;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid #F1F5F9;
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.table th {
  color: #667085;
  font-size: 12px;
}

.teacher-comparison-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
}

.teacher-comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.teacher-comparison-table th {
  background: #FFF5F5;
  color: #A61B1B;
  font-weight: 900;
}

.teacher-comparison-table td,
.teacher-comparison-table th {
  padding: 12px;
}

.teacher-comparison-table th:nth-child(1),
.teacher-comparison-table td:nth-child(1) {
  width: 18%;
}

.teacher-comparison-table th:nth-child(2),
.teacher-comparison-table td:nth-child(2) {
  width: 12%;
}

.teacher-comparison-table th:nth-child(n + 3):nth-child(-n + 6),
.teacher-comparison-table td:nth-child(n + 3):nth-child(-n + 6),
.teacher-comparison-table th:nth-child(8),
.teacher-comparison-table td:nth-child(8) {
  width: 10%;
  text-align: right;
}

.teacher-comparison-table th:nth-child(7),
.teacher-comparison-table td:nth-child(7) {
  width: 20%;
}

.rate-cell {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.rate-cell strong {
  color: #0f172a;
  font-size: 12px;
}

.rate-bar {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #F1F5F9;
}

.rate-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #A61B1B, #13C2C2);
}

.risk-text {
  color: #E02020;
  font-weight: 900;
}

@media (max-width: 980px) {
  .topbar,
  .role-tabs {
    flex-direction: column;
    align-items: stretch;
  }

  .login-grid,
  .login-shell,
  .password-change-form,
  .summary-grid,
  .workspace-shell,
  .panel-grid,
  .panel-grid.three,
  .course-detail-stats,
  .compact-form,
  .study-task-filter-bar,
  .profile-grid,
  .form-row.two,
  .form-row.three,
  .form-row.four,
  .teacher-sheet-summary,
  .class-check-list {
    grid-template-columns: 1fr;
  }

  .login-brand-card {
    min-height: 320px;
  }

  .schedule-row,
  .schedule-row.has-actions {
    grid-template-columns: 1fr;
  }

  .summary-grid.module-nav {
    position: static;
  }

  .role-home-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .role-home-panels {
    grid-template-columns: 1fr;
  }

  .drawer-panel {
    width: min(620px, calc(100vw - 12px));
  }
}

@media (max-width: 520px) {
  .app {
    width: min(100vw - 20px, 100%);
    padding: 12px 0 24px;
  }

  .is-login-screen .app {
    width: min(100vw - 20px, 100%);
    min-height: auto;
    align-items: flex-start;
    padding: 12px 0 24px;
  }

  .login-brand-card,
  .login-card {
    padding: 22px;
  }

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

  .login-card-head {
    flex-direction: column;
  }

  .list,
  .daily-report {
    grid-template-columns: 1fr;
  }

  .user-menu,
  .user-menu-button {
    width: 100%;
  }

  .user-dropdown {
    right: 0;
    width: min(380px, calc(100vw - 20px));
  }

  .drawer-backdrop {
    align-items: stretch;
  }

  .drawer-panel {
    width: 100vw;
    padding: 18px;
  }

  .drawer-head {
    flex-direction: column;
  }

  .item-head {
    align-items: flex-start;
  }

  .role-home-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
  }

  .role-home-metrics,
  .role-home-actions,
  .role-home-average-row {
    grid-template-columns: 1fr;
  }

  .role-home-metric {
    min-height: 76px;
  }

  .role-student .app {
    width: 100%;
    padding: 0 10px 22px;
    background: #EFF4F9;
  }

  .role-student .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin: 0 -10px 10px;
    border: 0;
    border-radius: 0 0 18px 18px;
    min-height: 98px;
    padding: 18px 18px;
    background: var(--brand-navy);
    box-shadow: none;
  }

  .role-student .topbar-context {
    gap: 2px;
  }

  .role-student .topbar-title {
    color: #FFFFFF;
    font-size: 24px;
  }

  .role-student .topbar-subtitle {
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
  }

  .role-student .user-menu {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
  }

  .role-student .user-menu-button {
    width: auto;
    min-height: 40px;
    padding: 4px;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
  }

  .role-student .user-menu-text,
  .role-student .menu-chevron {
    display: none;
  }

  .role-student .notification-bell-button {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    box-shadow: none;
  }

  .role-student .workspace-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .role-student.student-home-screen .role-view {
    display: none;
  }

  .role-student:not(.student-home-screen) .summary-grid.module-nav {
    display: none;
  }

  .role-student .summary-grid.module-nav {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: -2px;
    border: 0;
    border-radius: 0 0 18px 18px;
    padding: 16px 14px 18px;
    background: #EFF4F9;
    box-shadow: none;
  }

  .role-student .sidebar-brand {
    display: none;
  }

  .role-student .student-mobile-home-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 18px;
    border: 1px solid rgba(30, 58, 95, 0.08);
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: none;
  }

  .role-student .student-mobile-home-avatar {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: var(--brand-navy);
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 900;
  }

  .role-student .student-mobile-home-main {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  .role-student .student-mobile-home-name {
    color: var(--brand-navy);
    font-size: 19px;
    font-weight: 900;
    line-height: 1.2;
  }

  .role-student .student-mobile-home-meta {
    overflow: hidden;
    color: #667085;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .role-student .student-mobile-status-tag {
    border-radius: 999px;
    padding: 6px 9px;
    background: #ECFDF3;
    color: #027A48;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
  }

  .role-student .brand-logo {
    width: 40px;
    height: 40px;
    border-color: rgba(166, 27, 27, 0.16);
    box-shadow: 0 8px 18px rgba(30, 58, 95, 0.08);
  }

  .role-student .sidebar-title {
    color: var(--brand-navy);
    font-size: 18px;
  }

  .role-student .sidebar-subtitle {
    color: #667085;
    font-size: 14px;
  }

  .role-student .module-nav-item {
    position: relative;
    min-height: 124px;
    --module-accent: var(--brand-navy);
    --module-soft: #EEF4FF;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: flex-start;
    padding: 24px 22px 20px;
    border-color: rgba(30, 58, 95, 0.08);
    border-left: 1px solid rgba(30, 58, 95, 0.08);
    border-radius: 16px;
    background: #FFFFFF;
    color: var(--brand-navy);
    box-shadow: none;
  }

  .role-student .module-nav-item-primary {
    min-height: 124px;
    padding: 24px 22px 20px;
  }

  .role-student .module-nav-item-wide {
    grid-column: 1 / -1;
  }

  .role-student .module-nav-item-secondary {
    min-height: 124px;
    padding: 24px 22px 20px;
  }

  .role-student .module-nav-item-hero {
    grid-column: 1 / -1;
    min-height: 104px;
    padding: 20px 72px 20px 20px;
    border-color: var(--brand-red);
    background: linear-gradient(135deg, var(--brand-red) 0%, #861313 100%);
    color: #FFFFFF;
    box-shadow: 0 18px 32px rgba(166, 27, 27, 0.18);
  }

  .role-student .module-nav-item-has-badge:not(.module-nav-item-hero) {
    padding-right: 22px;
  }

  .role-student .module-nav-item.active {
    border-color: rgba(166, 27, 27, 0.32);
    background: #FFF8F8;
    color: var(--brand-red);
  }

  .role-student .module-nav-item-hero.active {
    border-color: var(--brand-red);
    background: linear-gradient(135deg, var(--brand-red) 0%, #861313 100%);
    color: #FFFFFF;
  }

  .role-student .module-main {
    display: grid;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
  }

  .role-student .module-main > span:last-child {
    min-width: 0;
  }

  .role-student .module-nav-item-has-badge:not(.module-nav-item-hero) .module-main {
    display: grid;
    gap: 8px;
  }

  .role-student .module-nav-item-has-badge:not(.module-nav-item-hero) .module-main > span:last-child {
    display: grid;
    gap: 2px;
  }

  .role-student .module-nav-item-primary .module-main {
    align-items: flex-start;
  }

  .role-student .module-icon,
  .role-student .module-icon svg {
    width: 22px;
    height: 22px;
  }

  .role-student .module-nav-item-primary .module-icon,
  .role-student .module-nav-item-primary .module-icon svg {
    width: 24px;
    height: 24px;
  }

  .role-student .module-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-right: 0;
    border-radius: 12px;
    background: var(--module-soft);
    color: var(--module-accent);
  }

  .role-student .module-nav-item-hero .module-icon {
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
  }

  .role-student .module-nav-item .metric-label {
    display: block;
    color: inherit;
    font-size: 18px;
    font-weight: 900;
    word-break: keep-all;
  }

  .role-student .module-nav-item-primary .metric-label {
    font-size: 18px;
  }

  .role-student .module-nav-item-hero .metric-label {
    font-size: 21px;
  }

  .role-student .module-note {
    margin-top: 4px;
    color: #667085;
    font-size: 14px;
    line-height: 1.3;
  }

  .role-student .module-nav-item-hero .module-note {
    color: #FEE2E2;
    font-size: 13px;
  }

  .role-student .module-nav-item .metric-value {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-color: transparent;
    background: var(--module-accent);
    color: #FFFFFF;
    font-size: 12px;
  }

  .role-student .module-nav-item-hero .metric-value {
    background: #FFFFFF;
    color: var(--brand-red);
  }

  .role-student .module-card-trail {
    position: absolute;
    top: 18px;
    right: 18px;
    display: inline-flex;
  }

  .role-student .module-nav-item-has-badge:not(.module-nav-item-hero) .module-card-trail {
    flex-direction: row;
    gap: 4px;
  }

  .role-student .module-nav-item-has-badge:not(.module-nav-item-hero) .module-arrow {
    width: 24px;
    height: 24px;
  }

  .role-student .module-arrow {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(30, 58, 95, 0.06);
    color: var(--module-accent);
    font-weight: 900;
  }

  .role-student .module-nav-item-hero .module-arrow {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
  }

  .role-student .module-tone-check {
    --module-accent: #027A48;
    --module-soft: #ECFDF3;
  }

  .role-student .module-tone-question {
    --module-accent: var(--brand-red);
    --module-soft: #FFF1F1;
  }

  .role-student .module-tone-task,
  .role-student .module-tone-leave {
    --module-accent: #B54708;
    --module-soft: #FFF7ED;
  }

  .role-student .module-tone-score,
  .role-student .module-tone-schedule {
    --module-accent: #175CD3;
    --module-soft: #EFF8FF;
  }

  .role-student .module-tone-repair,
  .role-student .module-tone-profile,
  .role-student .module-tone-default {
    --module-accent: #475467;
    --module-soft: #F2F4F7;
  }

  .role-student .role-view,
  .role-student .insight-panel {
    min-height: auto;
  }

  .role-student .student-mobile-backbar {
    margin: 10px 0;
  }

  .role-student .student-mobile-backbar .small-button {
    min-height: 38px;
    border-color: rgba(30, 58, 95, 0.14);
    background: #FFFFFF;
    color: var(--brand-navy);
  }

  .role-student .student-mobile-workspace {
    gap: 10px;
  }

  .role-student .panel-grid.student-mobile-workspace {
    grid-template-columns: 1fr;
  }

  .role-student .student-mobile-panel,
  .role-student .insight-panel {
    min-height: auto;
    border-radius: 14px;
    padding: 16px;
  }

  .role-student .panel-title {
    margin-bottom: 12px;
    font-size: 18px;
  }

  .role-student .panel-actions {
    gap: 6px;
  }

  .role-student .student-mobile-identity {
    padding: 12px;
    box-shadow: none;
    background: #F8FAFC;
  }

  .role-student .student-mobile-identity .item-title {
    font-size: 16px;
  }

  .role-student .student-profile-locked {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-student .form {
    gap: 11px;
  }

  .role-student .field input,
  .role-student .field select,
  .role-student .field textarea {
    min-height: 44px;
    font-size: 15px;
  }

  .role-student .field textarea {
    min-height: 108px;
  }

  .role-student .primary-button {
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    font-size: 16px;
  }

  .role-student .check-in-code {
    margin: 12px 0;
    padding: 16px 12px;
    font-size: 24px;
  }

  .role-student .student-mobile-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .role-student .student-mobile-list .item {
    padding: 12px;
    box-shadow: none;
  }

  .role-student .student-mobile-list .item-head {
    gap: 8px;
    margin-bottom: 4px;
  }

  .role-student .schedule-template {
    border-radius: 10px;
  }

  .role-student .schedule-template-title {
    padding: 9px 12px 8px;
    font-size: 21px;
    white-space: nowrap;
  }

  .role-student .schedule-template-meta {
    min-width: 760px;
    font-size: 13px;
  }

  .role-student .schedule-template-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .role-student .schedule-template-table {
    min-width: 760px;
    font-size: 14px;
  }

  .role-student .schedule-template-table th {
    font-size: 14px;
  }

  .role-student .schedule-template-table tfoot td {
    font-size: 14px;
  }

  .role-student .schedule-template-published {
    text-align: left;
  }

  .role-student .attachment-preview {
    font-size: 12px;
    line-height: 1.45;
  }
}

.compact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.03);
}

.compact-row + .compact-row {
  margin-top: 8px;
}

.compact-row:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.student-skin-card {
  border-color: var(--border);
  background: var(--card-bg);
}

.student-skin-card:hover {
  border-color: rgba(166, 27, 27, 0.24);
}

.student-skin-avatar .person-avatar {
  border: 1px solid rgba(166, 27, 27, 0.14);
  background: #FFF5F5;
  color: var(--brand-red);
}

.student-risk-tag {
  border-radius: 999px;
  font-weight: 900;
}

.student-risk-tag.risk-focus {
  border-color: #FCA5A5;
  background: #FDECEC;
  color: #B91C1C;
}

.student-risk-tag.risk-watch {
  border-color: #FED7AA;
  background: #FEF6E9;
  color: #B45309;
}

.student-risk-tag.risk-stable {
  border-color: #BBF7D0;
  background: #EAF6EE;
  color: #166534;
}

.student-risk-tag.risk-neutral {
  border-color: #CBD5E1;
  background: #F8FAFC;
  color: #475569;
}

.compact-main {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.compact-title,
.compact-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-title {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
}

.compact-sub {
  font-size: 12px;
}

.compact-avatar .person-avatar {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.compact-chevron {
  color: #94A3B8;
  font-size: 18px;
  line-height: 1;
}

.view-toggle {
  display: inline-flex;
  overflow: hidden;
  margin-right: 8px;
  border: 1px solid #FCA5A5;
  border-radius: 999px;
  background: #FFFFFF;
}

.view-toggle-btn {
  min-height: 30px;
  padding: 4px 12px;
  border: none;
  background: transparent;
  color: #A61B1B;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.view-toggle-btn.active {
  background: #A61B1B;
  color: #FFFFFF;
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #E2E8F0;
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  background: #FFF5F5;
  color: #7F1D1D;
  font-weight: 800;
}

.data-table tbody tr {
  cursor: pointer;
}

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

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  justify-content: flex-end;
}

.detail-drawer.hidden {
  display: none;
}

.detail-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.detail-drawer-panel {
  position: relative;
  display: flex;
  width: min(520px, 100%);
  height: 100%;
  flex-direction: column;
  background: #FFFFFF;
  box-shadow: -14px 0 34px rgba(15, 23, 42, 0.18);
  animation: drawer-slide-in 0.18s ease-out;
}

.detail-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #E2E8F0;
}

.detail-drawer-title {
  margin: 0;
  color: #0F172A;
  font-size: 18px;
  font-weight: 800;
}

.detail-drawer-close {
  width: 34px;
  height: 34px;
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  background: #FFFFFF;
  color: #475569;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.detail-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.detail-drawer-body .item {
  box-shadow: none;
}

body.drawer-open {
  overflow: hidden;
}

@keyframes drawer-slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.student-profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.student-profile-stat {
  padding: 11px 12px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #F8FAFC;
}

.student-profile-stat.risk {
  border-color: #FECACA;
  background: #FEF2F2;
}

.student-profile-stat.open {
  border-color: #FDE68A;
  background: #FFFBEB;
}

.student-profile-stat .stat-label {
  color: #64748B;
  font-size: 12px;
}

.student-profile-stat .stat-value {
  margin-top: 4px;
  color: #0F172A;
  font-size: 22px;
  font-weight: 800;
}

.student-profile-stat.risk .stat-value {
  color: #B91C1C;
}

.profile-tabs,
.insight-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 14px 0 12px;
  border-bottom: 1px solid #E2E8F0;
}

.profile-tab,
.insight-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.profile-tab.active,
.insight-tab.active {
  border-bottom-color: #A61B1B;
  color: #A61B1B;
  font-weight: 800;
}

.profile-tab-count,
.insight-tab-count {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #FEE2E2;
  color: #A61B1B;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.profile-tab.active .profile-tab-count,
.insight-tab.active .insight-tab-count {
  background: #A61B1B;
  color: #FFFFFF;
}

.profile-tab-body {
  display: grid;
  gap: 8px;
}

@media (max-width: 640px) {
  .detail-drawer {
    align-items: flex-end;
    justify-content: center;
  }

  .detail-drawer-panel {
    width: 100%;
    height: 86vh;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    animation: drawer-slide-up 0.18s ease-out;
  }

  @keyframes drawer-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
}

.schedule-class-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid #E2E8F0;
}

.schedule-class-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
  padding: 8px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: #475569;
  cursor: pointer;
  font: inherit;
}

.schedule-class-tab.active {
  border-bottom-color: #A61B1B;
  color: #A61B1B;
  font-weight: 700;
}

.schedule-class-tab-count {
  border-radius: 999px;
  background: #E2E8F0;
  color: #475569;
  padding: 0 6px;
  font-size: 11px;
}

.schedule-class-tab.active .schedule-class-tab-count {
  background: #A61B1B;
  color: #FFFFFF;
}

.schedule-older-hint {
  margin-top: 12px;
  border-radius: 6px;
  background: #F8FAFC;
  padding: 8px 12px;
  font-size: 12px;
}

.class-comparison-button {
  display: block;
  width: 100%;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  background: #FFFFFF;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 16px;
  text-align: left;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}

.class-comparison-button:hover {
  border-color: #CBD5F5;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.class-comparison-button:active {
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.06);
  transform: translateY(0);
}

.class-students-back {
  margin-bottom: 12px;
}

.detail-drawer-panel .student-profile-stats {
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.detail-drawer-panel .profile-tabs {
  flex-wrap: wrap;
}

.chapter-picker {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: 8px;
  margin-bottom: 12px;
}

.chapter-picker label {
  color: #92400E;
  font-size: 13px;
}

.chapter-picker select,
.chapter-picker .chapter-custom {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #FCD34D;
  border-radius: 6px;
  background: #FFFFFF;
  font-size: 14px;
}

.chapter-picker .chapter-custom.hidden {
  display: none;
}

.question-answer-video {
  margin-top: 10px;
}

.question-answer-video video {
  width: 100%;
  max-width: 480px;
  max-height: 60vh;
  border-radius: 8px;
  background: #000000;
}

.attachment-preview.preview-error {
  color: #B91C1C;
}

@media (max-width: 760px) {
  .schedule-template-meta {
    gap: 4px;
    font-size: 12px;
  }

  .schedule-template-meta::after {
    content: "← 左右滑动查看完整课表 →";
    display: block;
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 4px;
    color: #94A3B8;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
  }

  .schedule-template-scroll::after {
    opacity: 1;
  }

  .schedule-template-table {
    min-width: 640px;
    font-size: 13px;
  }

  .schedule-template-table th,
  .schedule-template-table td {
    padding: 3px 4px;
  }

  .schedule-template-table th {
    font-size: 13px;
  }

  .schedule-template-title {
    font-size: 16px !important;
  }

  .role-student .schedule-template-meta,
  .role-student .schedule-template-table {
    min-width: 640px;
  }
}

@media (max-width: 640px) {
  .chapter-picker {
    gap: 4px;
    margin-bottom: 8px;
    padding: 8px 10px;
  }

  .chapter-picker label {
    font-size: 12px;
  }

  .chapter-picker select,
  .chapter-picker .chapter-custom {
    height: 32px;
    font-size: 13px;
  }

  .summary-box {
    gap: 6px;
    padding: 8px;
  }

  .summary-box label {
    font-size: 12px;
  }

  .summary-box textarea {
    min-height: 60px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .question-extra-fields {
    gap: 5px;
    margin-top: 8px;
    padding-top: 6px;
  }

  .question-extra-fields > summary {
    font-size: 12px;
  }

  .question-extra-fields[open] > summary {
    margin-bottom: 4px;
  }

  .question-extra-fields > label {
    margin-top: 4px;
    font-size: 12px;
  }

  .question-extra-fields > input[type="file"] {
    font-size: 12px;
  }

  .attachment-preview {
    padding: 4px 6px;
    font-size: 12px;
  }

  .checkbox-line {
    font-size: 13px;
  }

  .insight-tabs,
  .schedule-class-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .insight-tabs::-webkit-scrollbar,
  .schedule-class-tabs::-webkit-scrollbar {
    height: 3px;
  }

  .insight-tabs::-webkit-scrollbar-thumb,
  .schedule-class-tabs::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 999px;
  }

  .insight-tab,
  .schedule-class-tab {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .detail-drawer-body .item .actions {
    position: sticky;
    bottom: -16px;
    z-index: 2;
    margin: 8px -16px -16px;
    padding: 12px 16px 16px;
    background: linear-gradient(to top, #FFFFFF 0%, #FFFFFF 70%, rgba(255, 255, 255, 0) 100%);
    backdrop-filter: blur(4px);
  }

  .detail-drawer-body .item .actions .small-button {
    width: 100%;
    height: 44px;
    font-size: 15px;
  }

  .compact-row {
    min-height: 48px;
    gap: 8px;
    padding: 8px 10px;
  }

  .compact-title {
    font-size: 13px;
  }

  .compact-sub {
    font-size: 11px;
  }

  .compact-chevron {
    font-size: 16px;
  }

  .compact-row + .compact-row {
    margin-top: 6px;
  }
}

.list.single-list {
  display: block;
}

.comparison-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  min-width: 760px;
  font-size: 13px;
  border-collapse: collapse;
  table-layout: auto;
}

.comparison-table thead th {
  text-align: left;
  padding: 12px 10px;
  background: #F8FAFC;
  color: #64748B;
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
}

.comparison-table thead th.num,
.comparison-table tbody td.num {
  text-align: right;
}

.comparison-table thead th.pressure-col {
  background: #FEF2F2;
  color: #991B1B;
}

.comparison-table thead th.workload-col {
  background: #FEF3C7;
  color: #92400E;
}

.comparison-table tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #F1F5F9;
}

.comparison-table tbody td.num {
  font-variant-numeric: tabular-nums;
}

.comparison-table tbody td.primary-col {
  color: #1E293B;
  font-weight: 600;
}

.comparison-table tbody td.zero-num {
  color: #94A3B8;
}

.comparison-table tbody td.active-num {
  color: #DC2626;
  font-weight: 700;
}

.comparison-table tbody td.pressure-col.zero-num,
.comparison-table tbody td.workload-col.zero-num {
  background: #F8FAFC;
  color: #64748B;
  font-weight: 600;
}

.comparison-table tbody td.pressure-col.active-num {
  background: #FEF2F2;
  color: #991B1B;
  font-weight: 700;
}

.comparison-table tbody td.workload-col.active-num {
  background: #FEF3C7;
  color: #92400E;
  font-weight: 700;
}

.class-comparison-row {
  cursor: pointer;
}

.class-comparison-row:hover td {
  background: #F8FAFC;
}

.class-comparison-row:hover td.pressure-col.zero-num {
  background: #F1F5F9;
}

.class-comparison-row:hover td.pressure-col.active-num {
  background: #FEE2E2;
}

.today-dashboard {
  display: grid;
  gap: 20px;
}

.today-dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #E2E8F0;
}

.today-dashboard-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: #1E293B;
}

.today-dashboard-subtitle {
  font-size: 12px;
  color: #94A3B8;
}

.today-dashboard-class {
  font-size: 12px;
  white-space: nowrap;
}

.today-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.today-stat {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 10px;
  background: #F8FAFC;
  color: #1E293B;
}

.today-stat-open {
  background: #FFFBEB;
  color: #92400E;
}

.today-stat-risk {
  background: #FEE2E2;
  color: #991B1B;
}

.today-stat-stable {
  background: #F8FAFC;
  color: #1E293B;
}

.today-stat-label {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
}

.today-stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.today-stat-hint {
  font-size: 10px;
  opacity: 0.75;
}

.today-dashboard-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}

.today-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.today-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.today-section-hint {
  font-size: 11px;
}

.today-priority {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 6px;
  padding: 10px 12px;
  border: 0;
  border-left: 3px solid #94A3B8;
  border-radius: 6px;
  background: #F8FAFC;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.today-priority-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-red);
}

.today-priority-icon svg {
  width: 17px;
  height: 17px;
}

.today-priority-high {
  background: #FEF2F2;
  border-left-color: #DC2626;
}

.today-priority-medium {
  background: #FFFBEB;
  border-left-color: #F59E0B;
}

.today-priority-low {
  background: #F8FAFC;
  border-left-color: #94A3B8;
}

.today-priority:hover,
.today-risk-student:hover {
  filter: brightness(0.97);
}

.today-priority-main {
  flex: 1;
  min-width: 0;
}

.today-priority-title {
  font-size: 13px;
  font-weight: 600;
  color: #1E293B;
}

.today-priority-detail {
  margin-top: 2px;
  font-size: 11px;
  color: #64748B;
}

.today-priority-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.today-priority-count {
  font-size: 14px;
  font-weight: 700;
  color: #1E293B;
}

.today-priority-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.today-priority-tag-high {
  background: #FEE2E2;
  color: #991B1B;
}

.today-priority-tag-medium {
  background: #FEF3C7;
  color: #92400E;
}

.today-priority-tag-low {
  background: #E2E8F0;
  color: #475569;
}

.today-risk-student {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 6px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: #F8FAFC;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.today-risk-avatar {
  flex-shrink: 0;
}

.today-risk-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.today-risk-name {
  font-size: 13px;
  font-weight: 600;
  color: #1E293B;
}

.today-risk-reason {
  font-size: 11px;
}

.today-empty {
  padding: 24px;
  border-radius: 8px;
  background: #F8FAFC;
  color: #94A3B8;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 720px) {
  .today-dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .today-dashboard-body {
    grid-template-columns: 1fr;
  }

  .today-dashboard-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .comparison-table {
    font-size: 12px;
  }

  .comparison-table thead th,
  .comparison-table tbody td {
    padding: 10px 6px;
  }
}

.import-students-csv {
  display: grid;
  gap: 14px;
}

.import-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #F8FAFC;
  border-radius: 8px;
}

.import-step .step-num {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #DC2626;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.import-step .step-body {
  flex: 1;
  min-width: 0;
}

.import-step .step-title {
  font-size: 13px;
  font-weight: 600;
  color: #1E293B;
}

.import-step .step-hint {
  font-size: 11px;
  color: #64748B;
  margin-top: 2px;
}

#import-preview-area:empty {
  display: none;
}

.import-preview-stats {
  padding: 10px 12px;
  background: #FFFBEB;
  border-radius: 6px;
  font-size: 13px;
  color: #92400E;
  margin-bottom: 10px;
}

.import-preview-server-error {
  background: #FEF2F2;
  color: #991B1B;
}

.import-preview-scroll {
  overflow-x: auto;
}

.import-preview-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.import-preview-table th,
.import-preview-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #E2E8F0;
  text-align: left;
}

.import-preview-row-ok td {
  color: #1E293B;
}

.import-preview-row-error td {
  background: #FEE2E2;
  color: #991B1B;
}

.import-preview-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.import-note {
  font-size: 12px;
  padding: 8px 12px;
  background: #F1F5F9;
  border-radius: 6px;
}

.student-delete-zone {
  margin-top: 24px;
  padding-top: 16px;
}

.student-delete-divider {
  border: 0;
  border-top: 1px solid #E2E8F0;
  margin: 0 0 14px;
}

.danger-button {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.danger-button:hover {
  background: #FECACA;
}

.student-delete-hint {
  font-size: 11px;
  margin-top: 6px;
}
