.workspace-view[hidden] {
  display: none !important;
}

.workspace-switch {
  display: inline-flex;
  width: max-content;
  min-width: 0;
  justify-self: start;
  gap: 3px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  padding: 3px;
}

.workspace-tab {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.workspace-tab .ui-icon {
  width: 14px;
  height: 14px;
}

.workspace-tab:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.workspace-tab.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.workspace-tab:active {
  transform: translateY(1px);
}

.workspace-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.grade-workspace {
  min-width: 0;
  font-size: 14px;
}

.grade-command-bar {
  display: grid;
  grid-template-columns: 180px 200px minmax(0, 1fr) 180px;
  margin-bottom: 14px;
  overflow: visible;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background:
    var(--glass-sheen-soft),
    var(--glass-fill);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.grade-command-block {
  min-width: 0;
  padding: 14px 16px;
}

.grade-import-block {
  border-right: 1px solid var(--line);
}

.grade-stage-block {
  border-right: 1px solid var(--line);
}

.grade-export-block {
  border-left: 1px solid var(--line);
}

.grade-command-head,
.grade-command-title,
.grade-import-actions,
.grade-stage-controls,
.grade-exam-head-controls,
.grade-sidebar-head,
.grade-panel-head,
.grade-panel-head > div {
  display: flex;
  align-items: center;
}

.grade-command-head,
.grade-panel-head {
  justify-content: space-between;
}

.grade-command-title {
  gap: 8px;
  margin-bottom: 12px;
}

.grade-command-head .grade-command-title {
  margin-bottom: 0;
}

.grade-command-title > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--accent);
}

.grade-command-title .ui-icon {
  width: 14px;
  height: 14px;
}

.grade-command-title h2 {
  font-size: 15px;
  font-weight: 750;
}

.grade-import-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.grade-import-actions > * {
  width: 100%;
  min-width: 0;
}

.grade-import-actions .compact,
.grade-file-button {
  min-height: 36px;
  justify-content: center;
  padding: 0 9px;
  font-size: 13px;
}

.grade-template-download {
  position: relative;
  width: 100%;
}

.grade-template-download > button {
  width: 100%;
}

.grade-template-menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 7px;
  background:
    var(--glass-sheen-soft),
    var(--glass-fill-strong);
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.grade-template-menu[hidden] {
  display: none;
}

.grade-template-option {
  display: grid;
  min-height: 54px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 7px 10px;
  color: var(--ink);
  text-align: left;
}

.grade-template-option + .grade-template-option {
  border-top: 1px solid var(--line);
}

.grade-template-option:hover,
.grade-template-option:focus-visible {
  border-color: transparent;
  outline: 0;
  background: color-mix(in srgb, var(--surface-soft) 68%, transparent);
}

.grade-template-option > .ui-icon {
  width: 18px;
  height: 18px;
  justify-self: center;
  color: var(--accent);
}

.grade-template-option > span:not(.ui-icon) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.grade-template-option strong {
  font-size: 13px;
  font-weight: 760;
}

.grade-template-option small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.grade-file-button > span:not(.ui-icon) {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.grade-data-status {
  min-height: 18px;
  margin: 10px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-stage-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.grade-command-head {
  gap: 12px;
  margin-bottom: 10px;
}

.grade-delete-exam-button {
  width: 30px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-panel);
  color: var(--muted);
}

.grade-delete-exam-button .ui-icon {
  width: 14px;
  height: 14px;
}

.grade-delete-exam-button:hover:not(:disabled),
.grade-delete-exam-button:focus-visible:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--accent);
}

.grade-delete-exam-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.grade-exam-head-controls {
  justify-content: flex-end;
  gap: 7px;
}

.grade-exam-head-controls > * {
  width: 136px;
  min-width: 136px;
  min-height: 36px;
}

.grade-score-mode-description {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.grade-score-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(320px, 100%);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-panel);
  padding: 3px;
}

.grade-score-mode-options button {
  min-height: 34px;
  border-color: transparent;
}

.grade-score-mode-options button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.grade-score-mode-description {
  min-height: 20px;
  margin: 8px 0 13px;
}

.grade-context-select {
  display: grid;
  grid-template-columns: 46px minmax(74px, 1fr);
  align-items: center;
  min-height: 36px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-panel);
}

.grade-context-select > span {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.grade-context-select select {
  min-height: 34px;
  border: 0;
  background: transparent;
  padding: 5px 23px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-align-last: center;
}

.grade-context-select select:hover,
.grade-context-select select:focus {
  border: 0;
}

.grade-file-button.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.grade-export-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.grade-export-actions .compact {
  width: 100%;
  min-height: 36px;
  justify-content: center;
  padding: 0 10px;
  font-size: 12px;
}

.exam-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 2px 1px 4px;
}

.exam-track-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-panel);
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease, transform 180ms ease;
}

.exam-track-item.has-data {
  opacity: 1;
}

.exam-track-item.is-empty {
  border-style: dashed;
  background: transparent;
  opacity: 0.52;
}

.exam-track-item.is-empty:hover,
.exam-track-item.is-empty:focus-within {
  opacity: 0.84;
}

.exam-track-item.is-empty.is-active {
  opacity: 0.72;
}

.exam-track-item.is-active {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 3px 0 var(--accent);
}

.exam-order-button {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: grab;
}

.exam-order-button:active {
  cursor: grabbing;
}

.exam-order-button:hover {
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.exam-track-item.is-active .exam-order-button {
  color: var(--accent);
}

.exam-track-item.is-exam-dragging {
  opacity: 0.42;
  transform: scale(0.98);
}

.exam-track-item.is-exam-drop-target {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.exam-name-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  min-width: 0;
}

.exam-part-select {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 7px 18px 7px 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-align-last: center;
}

.exam-custom-type-input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: inset 0 -2px 0 var(--accent);
  padding: 7px 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.exam-custom-type-input:hover,
.exam-custom-type-input:focus {
  border: 0;
  outline: 0;
}

.exam-stage-select {
  border-left: 1px solid var(--line);
}

.exam-part-select:hover,
.exam-part-select:focus {
  border: 0;
}

.exam-stage-select:hover,
.exam-stage-select:focus {
  border-left: 1px solid var(--line);
}

.exam-add-slot {
  display: grid;
  width: 100%;
  min-height: 44px;
  place-items: center;
  border: 1px dashed transparent;
  border-radius: 6px;
  background: transparent;
  padding: 0;
  color: transparent;
  opacity: 0;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.exam-add-slot .ui-icon {
  width: 18px;
  height: 18px;
}

.exam-add-slot:hover,
.exam-add-slot:focus-visible {
  border-color: var(--line-strong);
  outline: 0;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
  color: var(--muted);
  opacity: 1;
}

.exam-add-slot:active {
  transform: scale(0.98);
}

@media (hover: none) {
  .exam-add-slot {
    border-color: var(--line);
    color: var(--muted);
    opacity: 0.72;
  }
}

.grade-dashboard {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: calc(100vh - 122px);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background:
    var(--glass-sheen-soft),
    var(--glass-fill);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.grade-sidebar {
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-panel) 58%, transparent);
  padding: 0;
}

.grade-sidebar-section {
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.grade-sidebar-section:last-child {
  border-bottom: 0;
}

.grade-sidebar .grade-import-block,
.grade-sidebar .grade-stage-block {
  border-right: 0;
}

.grade-subject-section {
  padding-top: 18px;
}

.grade-sidebar-head {
  margin-bottom: 12px;
}

.grade-section-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.grade-sidebar-head h2 {
  font-size: 17px;
}

.grade-sidebar-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.grade-inline-score-mode {
  margin-bottom: 10px;
  min-width: 0;
}

.grade-score-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  width: 100%;
}

.grade-score-toolbar button {
  display: flex;
  min-width: 0;
  min-height: 34px;
  justify-content: center;
  gap: 6px;
  padding: 0 7px;
  font-size: 13px;
  width: 100%;
}

.grade-score-toolbar button .ui-icon {
  order: -1;
  width: 13px;
  height: 13px;
}

.grade-score-toolbar .grade-score-settings-icon-button {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.grade-score-settings-icon-button .ui-icon {
  width: 15px;
  height: 15px;
}

.grade-score-mode-toggle {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.grade-score-mode-toggle.is-raw {
  border-color: #2563eb;
  background: #2563eb;
  color: var(--surface);
}

.grade-score-mode-toggle.is-converted {
  border-color: #16803b;
  background: #16803b;
  color: #ffffff;
}

.grade-score-mode-toggle.is-raw:hover,
.grade-score-mode-toggle.is-raw:focus-visible {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px color-mix(in srgb, #2563eb 18%, transparent);
}

.grade-score-mode-toggle.is-converted:hover,
.grade-score-mode-toggle.is-converted:focus-visible {
  border-color: #116832;
  background: #116832;
  color: #ffffff;
  outline: 2px solid #16803b;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px color-mix(in srgb, #16803b 18%, transparent);
}

.grade-inline-score-mode .grade-score-mode-description {
  min-height: 0;
  margin: 5px 1px 0;
  font-size: 11px;
  line-height: 1.45;
}

.grade-subject-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.grade-subject-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.grade-subject-button {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-color: var(--line);
  background: var(--surface);
  padding: 0 34px;
  font-size: 13px;
  cursor: grab;
  transition: border-color 220ms ease, background-color 220ms ease, color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

html.has-liquid-glass .grade-subject-button {
  overflow: hidden;
  border-color: var(--glass-border);
  background: var(--glass-sheen-soft), var(--glass-fill);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
}

html.has-liquid-glass .grade-subject-button::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 0 28%, color-mix(in srgb, #ffffff 38%, transparent) 46%, transparent 66%);
  content: "";
  opacity: 0;
  transform: translateX(-70%);
  transition: opacity 220ms ease, transform 420ms cubic-bezier(.2,.8,.2,1);
}

html.has-liquid-glass .grade-subject-button:hover::before,
html.has-liquid-glass .grade-subject-button.is-active::before {
  opacity: 0.72;
  transform: translateX(38%);
}

html.has-liquid-glass .grade-subject-button:hover {
  transform: translateY(-1px);
}

html.has-liquid-glass .grade-subject-button.is-active {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  color: var(--surface);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--ink) 16%, transparent), inset 0 1px 0 color-mix(in srgb, #ffffff 24%, transparent);
}

.grade-subject-row .grade-subject-button {
  width: 100%;
  min-width: 0;
}

.grade-subject-button:active {
  cursor: grabbing;
}

.grade-subject-icon {
  position: absolute;
  left: 9px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  opacity: 0.82;
  pointer-events: none;
}

.grade-subject-button.is-active .grade-subject-icon {
  color: inherit;
  opacity: 1;
}

.grade-subject-label {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.grade-subject-button.is-dragging {
  opacity: 0.42;
  transform: scale(0.98);
}

.grade-subject-button.is-drop-target {
  border-color: #16803b;
  box-shadow: inset 3px 0 0 #16803b;
}

.grade-subject-button.is-no-score {
  border-style: dashed;
  background: var(--surface-soft);
  color: var(--muted);
}

.grade-subject-status {
  position: absolute;
  right: 9px;
  color: inherit;
  font-size: 9px;
  font-weight: 750;
  opacity: 0.82;
}

.grade-total-subject {
  cursor: pointer;
}

.grade-subject-button[data-subject="total"] {
  grid-column: auto;
}

.grade-total-subject-row {
  margin-top: 3px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.grade-total-subject {
  cursor: pointer;
}

.grade-subject-button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--ink) 16%, transparent), inset 0 1px 0 color-mix(in srgb, #ffffff 24%, transparent);
}

html.has-liquid-glass::view-transition-old(root),
html.has-liquid-glass::view-transition-new(root) {
  animation-duration: 220ms;
  animation-timing-function: cubic-bezier(.2,.8,.2,1);
}

.grade-score-key {
  display: grid;
  gap: 9px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.grade-score-settings-dialog {
  width: min(660px, 100%);
}

.grade-score-settings-dialog .modal-head p {
  max-width: 470px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.grade-score-settings-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.grade-score-settings-table-head,
.grade-score-setting-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.35fr) repeat(2, minmax(120px, 1fr));
  gap: 10px;
  align-items: center;
}

.grade-score-settings-table-head {
  min-height: 36px;
  background: var(--surface-panel);
  padding: 0 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

.grade-score-settings-table-head span:first-child {
  text-align: left;
}

.grade-score-setting-row {
  min-height: 48px;
  border-top: 1px solid var(--line);
  padding: 5px 12px;
}

.grade-score-setting-subject {
  display: flex;
  min-width: 0;
  gap: 9px;
  align-items: center;
}

.grade-score-setting-subject > span {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
}

.grade-score-setting-subject .ui-icon {
  width: 14px;
  height: 14px;
}

.grade-score-setting-subject strong {
  font-size: 12px;
}

.grade-score-setting-row label {
  margin: 0;
}

.grade-score-setting-row input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.grade-score-settings-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.grade-score-settings-footer button {
  min-width: 112px;
}

.grade-score-key strong {
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 12px;
}

.grade-score-key > div {
  display: flex;
  gap: 7px;
  align-items: center;
}

.score-key-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.score-key-dot.is-excellent {
  background: #16803b;
}

.score-key-dot.is-elite {
  background: #7a52a1;
}

.score-key-dot.is-pass {
  background: #2563eb;
}

.score-key-dot.is-watch {
  background: var(--accent);
}

.grade-analysis-main {
  min-width: 0;
  padding: 12px 22px 22px;
}

.grade-analysis-workspace {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 12px;
  align-items: start;
}

.grade-analysis-content {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.grade-trend-ai-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 10px;
}

.grade-analysis-lower-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(480px, 1.35fr) minmax(300px, 0.65fr);
  gap: 10px;
  align-items: start;
}

.grade-kpi-rail {
  position: sticky;
  top: 12px;
  min-width: 0;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--glass-sheen-soft), var(--glass-fill-strong);
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight);
  padding: 10px;
  backdrop-filter: blur(18px) saturate(155%);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
}

.grade-kpi-rail > header {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 0 3px 9px;
}

.grade-kpi-rail > header > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--accent);
}

.grade-kpi-rail > header h3 {
  margin: 0;
  font-size: 14px;
}

.grade-dataset-title {
  display: block;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.grade-dataset-current,
.grade-dataset-empty {
  display: flex;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 10px;
  color: var(--ink);
  line-height: 1;
}

.grade-dataset-current > .ui-icon,
.grade-dataset-empty > .ui-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--accent);
}

.grade-dataset-current strong,
.grade-dataset-empty strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-dataset-empty {
  color: var(--muted);
}

.grade-dataset-title select {
  display: block;
  width: 100%;
  height: 40px;
  min-height: 40px;
  border-color: var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 30px 0 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 38px;
  text-align: center;
  text-align-last: center;
}

.grade-dataset-title-controls {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 6px;
}

.grade-dataset-order-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}

.grade-dataset-order-button .ui-icon {
  width: 15px;
  height: 15px;
}

.grade-kpi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  margin: 9px 0 0;
}

.grade-kpi {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-panel);
  padding: 8px 10px;
}

.grade-kpi.is-actionable {
  width: 100%;
  height: 100%;
  appearance: none;
  color: inherit;
  font-weight: inherit;
  text-align: left;
}

.grade-kpi.is-actionable:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.grade-kpi.is-actionable:active {
  transform: translateY(0);
}

.grade-kpi.is-active-filter {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--ink) 4%, var(--surface-panel));
  box-shadow: inset 0 0 0 1px var(--ink);
}

.grade-kpi-main {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.grade-kpi-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
}

.grade-kpi-icon .ui-icon {
  width: 13px;
  height: 13px;
}

.grade-kpi.is-positive {
  border-top-color: #16803b;
}

.grade-kpi.is-positive .grade-kpi-icon,
.grade-kpi.is-excellent .grade-kpi-icon {
  color: #16803b;
}

.grade-kpi.is-negative {
  border-top-color: var(--accent);
}

.grade-kpi.is-negative .grade-kpi-icon,
.grade-kpi.is-low .grade-kpi-icon {
  color: var(--accent);
}

.grade-kpi.is-elite {
  border-top-color: #7a52a1;
}

.grade-kpi.is-elite .grade-kpi-icon {
  color: #7a52a1;
}

.grade-kpi.is-excellent {
  border-top-color: #16803b;
}

.grade-kpi.is-pass {
  border-top-color: #2563eb;
}

.grade-kpi.is-pass .grade-kpi-icon {
  color: #2563eb;
}

.grade-kpi.is-fail {
  border-top-color: #b45309;
}

.grade-kpi.is-fail .grade-kpi-icon {
  color: #b45309;
}

.grade-kpi.is-low {
  border-top-color: var(--accent);
}

.grade-kpi.is-progress {
  border-top-color: #16803b;
}

.grade-kpi.is-progress .grade-kpi-icon {
  color: #16803b;
}

.grade-kpi.is-decline {
  border-top-color: #b45309;
}

.grade-kpi.is-decline .grade-kpi-icon {
  color: #b45309;
}

.grade-kpi-label {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-kpi-value {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.grade-kpi-note {
  display: block;
  min-height: 14px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}

.grade-kpi-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.grade-student-insight-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 438px;
  height: auto;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.grade-student-insight-main {
  min-width: 0;
  min-height: 0;
  overflow: visible;
  border-right: 0;
  padding: 12px 14px 10px;
}

.grade-selected-student-head {
  text-align: center;
}

.grade-selected-student-head p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
}

.grade-selected-student-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 780;
}

.grade-selected-student-score {
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: baseline;
  min-height: 35px;
  margin-top: 5px;
}

.grade-selected-student-score strong {
  color: var(--ink);
  font-size: 28px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.grade-selected-student-score span {
  color: var(--muted);
  font-size: 13px;
}

.grade-student-trend-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.grade-student-trend-stat {
  display: grid;
  min-width: 0;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: center;
  gap: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-panel);
  padding: 6px 7px;
  color: var(--muted);
  font-size: 12px;
}

.grade-student-trend-stat-icon {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 4px;
  background: var(--surface);
  color: #2563eb;
}

.grade-student-trend-stat > span:not(.grade-student-trend-stat-icon) {
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-student-trend-stat-icon .ui-icon {
  width: 11px;
  height: 11px;
}

.grade-student-trend-stat strong {
  grid-column: 1 / -1;
  justify-self: center;
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.grade-student-trend-stat small {
  min-width: 0;
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-student-trend-chart {
  min-height: 272px;
  margin-top: 10px;
}

.grade-student-trend-svg {
  display: block;
  width: 100%;
  height: 272px;
  overflow: visible;
}

.grade-student-trend-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.grade-student-trend-grid.is-threshold {
  stroke-dasharray: 4 4;
}

.grade-student-trend-axis,
.grade-student-trend-score,
.grade-student-trend-exam {
  fill: var(--muted);
  font-family: "Helvetica Neue", "Microsoft YaHei", "PingFang SC", Helvetica, Arial, sans-serif;
  font-size: 11px;
}

.grade-student-trend-score {
  fill: var(--ink);
  font-weight: 750;
}

.grade-student-trend-area {
  fill: url(#gradeTrendAreaGradient);
  opacity: 1;
}

.grade-student-trend-line {
  fill: none;
  stroke: #2563eb;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  filter: drop-shadow(0 3px 5px color-mix(in srgb, #2563eb 24%, transparent));
  animation: grade-trend-line-enter 520ms cubic-bezier(.22, .8, .3, 1) both;
}

.grade-student-trend-point {
  fill: var(--surface);
  stroke: #2563eb;
  stroke-width: 2.5;
}

@keyframes grade-trend-line-enter {
  from { stroke-dasharray: 0 1; }
  to { stroke-dasharray: 1 0; }
}

@media (prefers-reduced-motion: reduce) {
  .grade-student-trend-line {
    animation: none;
  }
}

.grade-subject-ai-panel {
  display: grid;
  min-width: 0;
  min-height: 438px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--glass-sheen-soft), var(--glass-fill-strong);
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--glass-highlight);
  padding: 16px;
  backdrop-filter: blur(18px) saturate(155%);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
}

.grade-subject-ai-panel > header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.grade-subject-ai-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, #2563eb 28%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, #2563eb 8%, transparent);
  color: #2563eb;
}

.grade-subject-ai-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.grade-subject-ai-panel header span:last-child {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.grade-subject-ai-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
}

.grade-subject-ai-panel button {
  width: 100%;
  min-height: 38px;
  justify-content: center;
}

.grade-subject-ai-panel button[aria-busy="true"] {
  cursor: wait;
  opacity: 0.68;
}

.grade-student-trend-point.is-active {
  fill: #2563eb;
  stroke: var(--ink);
}

.grade-student-insight-aside {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface-panel);
  padding: 14px 12px;
}

.grade-student-insight-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding: 0 2px 10px;
}

.grade-student-insight-list-head strong {
  font-size: 13px;
}

.grade-student-insight-list-head span {
  color: var(--muted);
  font-size: 10px;
}

.grade-student-insight-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding-top: 10px;
  scrollbar-width: thin;
}

.grade-student-name-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 9px;
  color: var(--ink);
  font-size: 11px;
  text-align: left;
}

.grade-student-name-card span {
  overflow: hidden;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-student-name-card strong {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.grade-student-name-card.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.grade-student-name-card.is-active strong {
  color: color-mix(in srgb, var(--surface) 72%, transparent);
}

.grade-student-card-empty {
  padding: 28px 8px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

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

.grade-analysis-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.grade-analysis-side {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.grade-analysis-detail-grid > .grade-student-panel,
.grade-analysis-side > .grade-student-insight-panel,
.grade-analysis-side > .grade-distribution-panel {
  width: 100%;
  grid-column: auto;
  justify-self: stretch;
}

.grade-analysis-detail-grid > .grade-student-panel,
.grade-analysis-side > .grade-distribution-panel {
  padding: 12px;
}

.grade-analysis-detail-grid > .grade-student-panel {
  overflow: visible;
  padding: 0 12px 12px;
}

.grade-analysis-side > .grade-student-insight-panel {
  height: 360px;
}

.grade-dataset-order-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 40px));
}

.grade-dataset-order-list {
  display: grid;
  gap: 7px;
  max-height: min(520px, calc(100vh - 190px));
  overflow-y: auto;
  padding: 16px;
}

.grade-dataset-order-item {
  display: grid;
  min-width: 0;
  min-height: 48px;
  grid-template-columns: 28px 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 6px 7px 6px 9px;
  cursor: grab;
  transition: border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.grade-dataset-order-item:hover {
  border-color: var(--line-strong);
}

.grade-dataset-order-item.is-dragging {
  opacity: 0.42;
}

.grade-dataset-order-item.is-drop-target {
  box-shadow: inset 3px 0 0 #2563eb;
}

.grade-dataset-order-handle {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--muted);
}

.grade-dataset-order-handle .ui-icon {
  width: 15px;
  height: 15px;
}

.grade-dataset-order-index {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.grade-dataset-order-item strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-dataset-order-actions {
  display: flex;
  gap: 4px;
}

.grade-dataset-order-actions .icon-button {
  width: 30px;
  height: 30px;
}

.grade-dataset-order-actions .grade-dataset-delete-button {
  color: var(--accent);
}

.grade-dataset-order-actions .grade-dataset-delete-button:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.grade-dataset-order-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 12px 16px 16px;
}

.grade-dataset-order-footer button {
  min-width: 96px;
}

.grade-analysis-side > .grade-distribution-panel {
  height: 306px;
}

.grade-chart-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  padding: 16px;
}

.grade-trend-panel {
  grid-column: span 8;
}

.grade-distribution-panel {
  grid-column: 1 / -1;
  width: min(520px, 100%);
  justify-self: center;
}

.grade-subject-panel,
.grade-student-panel {
  grid-column: 1 / -1;
}

.grade-panel-head {
  min-height: 32px;
  gap: 12px;
  margin-bottom: 13px;
}

.grade-panel-head > div {
  min-width: 0;
  gap: 8px;
}

.grade-panel-index {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.grade-panel-head h3 {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-panel-head > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.grade-trend-chart {
  min-height: 252px;
}

.grade-trend-svg {
  display: block;
  width: 100%;
  height: 252px;
  overflow: visible;
}

.grade-trend-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.grade-trend-axis-label,
.grade-trend-point-label,
.grade-trend-exam-label {
  fill: var(--muted);
  font-family: "Helvetica Neue", "Microsoft YaHei", "PingFang SC", Helvetica, Arial, sans-serif;
  font-size: 11px;
}

.grade-trend-point-label {
  fill: var(--ink);
  font-weight: 700;
}

.grade-trend-area {
  fill: var(--accent);
  opacity: 0.055;
}

.grade-trend-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.grade-trend-point {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2.5;
}

.grade-trend-point.is-active {
  fill: var(--accent);
  stroke: var(--ink);
}

.grade-distribution-chart {
  display: grid;
  min-height: 244px;
  gap: 8px;
  align-content: center;
}

.distribution-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.distribution-label {
  color: var(--muted);
  white-space: nowrap;
}

.distribution-track {
  height: 8px;
  overflow: hidden;
  background: var(--surface-soft);
}

.distribution-fill {
  display: block;
  height: 100%;
  min-width: 0;
  background: var(--ink);
  transition: width 240ms ease;
}

.distribution-row.is-excellent .distribution-fill {
  background: #16803b;
}

.distribution-row.is-elite .distribution-fill {
  background: #7a52a1;
}

.distribution-row.is-watch .distribution-fill {
  background: var(--accent);
}

.distribution-row.is-pass .distribution-fill {
  background: #2563eb;
}

.distribution-row.is-attention .distribution-fill {
  background: #d59a22;
}

.distribution-row.is-low .distribution-fill {
  background: var(--accent);
}

.distribution-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.grade-subject-chart {
  display: grid;
  grid-template-columns: repeat(10, minmax(54px, 1fr));
  min-height: 230px;
  gap: 8px;
  align-items: end;
  padding-top: 16px;
}

.subject-bar-item {
  display: grid;
  min-width: 0;
  min-height: 210px;
  grid-template-rows: 20px 160px 24px;
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
}

.subject-bar-item:hover {
  border: 0;
  background: transparent;
}

.subject-bar-value {
  align-self: end;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.subject-bar-track {
  position: relative;
  display: flex;
  width: min(34px, 72%);
  height: 160px;
  justify-self: center;
  align-items: end;
  background: var(--surface-soft);
}

.subject-bar-fill {
  width: 100%;
  min-height: 2px;
  background: var(--ink);
  transition: height 240ms ease, background-color 140ms ease;
}

.subject-bar-item:hover .subject-bar-fill,
.subject-bar-item.is-active .subject-bar-fill {
  background: var(--accent);
}

.subject-bar-item.is-active .subject-bar-track {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.subject-bar-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-student-table-wrap {
  max-height: none;
  overflow: visible;
  border-top: 0;
}

.grade-student-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.grade-student-table th,
.grade-student-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 10px;
  text-align: left;
}

.grade-student-table th:first-child,
.grade-student-table td:first-child {
  width: 34%;
}

.grade-student-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.grade-student-table th:nth-child(n + 2),
.grade-student-table td:nth-child(n + 2) {
  text-align: right;
}

.grade-table-sort-button {
  display: flex;
  width: 100%;
  min-height: 28px;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: inherit;
}

.grade-student-table th:nth-child(n + 2) .grade-table-sort-button {
  justify-content: flex-end;
}

.grade-table-sort-button:hover,
.grade-table-sort-button:focus-visible {
  border-color: transparent;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--ink);
  transform: none;
}

.grade-table-sort-button:focus-visible {
  outline: 2px solid color-mix(in srgb, #2563eb 38%, transparent);
  outline-offset: 1px;
}

.grade-table-sort-button.is-active {
  color: var(--ink);
}

.grade-table-sort-arrows {
  display: grid;
  width: 11px;
  flex: 0 0 11px;
  grid-template-rows: repeat(2, 7px);
  place-items: center;
}

.grade-table-sort-arrow {
  display: grid;
  width: 10px;
  height: 7px;
  place-items: center;
  color: var(--muted);
  opacity: 0.28;
}

.grade-table-sort-arrow .ui-icon {
  width: 10px;
  height: 10px;
}

.grade-table-sort-arrow.is-active {
  color: #2563eb;
  opacity: 1;
}

.grade-student-table tbody tr:hover {
  background: var(--surface-soft);
}

.grade-student-table tbody tr[data-grade-student-id] {
  cursor: pointer;
}

.grade-student-table tbody tr.is-active-student {
  background: color-mix(in srgb, #2563eb 6%, var(--surface));
  box-shadow: inset 3px 0 0 #2563eb;
}

.grade-student-table tbody tr.is-kpi-located {
  animation: grade-student-locate 760ms ease-out;
}

@keyframes grade-student-locate {
  0%, 100% {
    background: color-mix(in srgb, #2563eb 6%, var(--surface));
    box-shadow: inset 3px 0 0 #2563eb;
  }

  45% {
    background: color-mix(in srgb, #2563eb 16%, var(--surface));
    box-shadow: inset 5px 0 0 #2563eb;
  }
}

@media (prefers-reduced-motion: reduce) {
  .grade-student-table tbody tr.is-kpi-located {
    animation: none;
  }
}

.student-score-name {
  color: var(--ink);
  font-weight: 750;
  white-space: nowrap;
}

.grade-rank-trend {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 74px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.grade-rank-trend .ui-icon {
  order: -1;
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}

.grade-score-trend {
  display: inline-flex;
  min-width: 68px;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.grade-score-trend .ui-icon {
  width: 13px;
  height: 13px;
}

.grade-score-trend.is-positive { color: #16803b; }
.grade-score-trend.is-negative { color: #c43a3a; }
.grade-score-trend.is-neutral { color: var(--muted); }

.grade-rank-trend-compact {
  display: none;
}

.grade-rank-trend.is-positive {
  color: #16803b;
}

.grade-rank-trend.is-negative {
  color: #c43a3a;
}

.student-change {
  font-weight: 750;
}

.student-change.is-positive {
  color: #16803b;
}

.student-change.is-negative,
.student-status.is-watch {
  color: var(--accent);
}

.student-status {
  font-size: 13px;
  font-weight: 700;
}

.student-status.is-excellent {
  color: #16803b;
}

.grade-empty-state {
  display: grid;
  min-height: 210px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.grade-table-empty {
  padding: 30px !important;
  color: var(--muted);
  text-align: center !important;
}

@media (max-width: 1600px) {
  .exam-timeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1700px) {
  .grade-analysis-workspace {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
}

@media (max-width: 1450px) {
  .grade-trend-ai-grid {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .grade-analysis-lower-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1300px) {
  .exam-timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .grade-dashboard {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .grade-analysis-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .grade-kpi-rail {
    position: static;
  }

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

  .grade-analysis-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .grade-analysis-side {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  }
}

@media (max-width: 760px) {
  .workspace-switch {
    gap: 3px;
  }

  .workspace-tab {
    padding: 0 9px;
    font-size: 12px;
  }

  .grade-dashboard {
    grid-template-columns: 1fr;
  }

  .grade-import-block,
  .grade-stage-block,
  .grade-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .grade-sidebar {
    padding: 0;
  }

  .grade-score-key {
    display: none;
  }

  .grade-subject-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .grade-score-toolbar {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .grade-subject-button[data-subject="total"] {
    grid-column: auto;
  }

  .grade-analysis-main {
    padding: 12px 14px 14px;
  }

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

  .grade-trend-ai-grid,
  .grade-analysis-lower-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .grade-subject-ai-panel {
    min-height: 260px;
  }

  .grade-student-insight-panel {
    grid-template-columns: 1fr;
    height: 340px;
  }

  .grade-student-insight-main {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 12px 10px;
  }

  .grade-student-trend-chart {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .grade-student-trend-svg {
    width: 620px;
    max-width: none;
  }

  .grade-student-insight-aside {
    grid-template-rows: auto auto;
  }

  .grade-student-insight-list {
    grid-auto-columns: 132px;
    grid-auto-flow: column;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
  }

  .grade-chart-grid,
  .grade-compact-analysis-row {
    display: block;
  }

  .grade-analysis-side {
    display: block;
  }

  .grade-analysis-side > * + * {
    margin-top: 8px;
  }

  .grade-compact-analysis-row > .grade-student-insight-panel,
  .grade-compact-analysis-row > .grade-distribution-panel,
  .grade-compact-analysis-row > .grade-student-panel {
    width: 100%;
    height: auto;
  }

  .grade-compact-analysis-row > * + * {
    margin-top: 8px;
  }

  .grade-chart-panel + .grade-chart-panel {
    margin-top: 8px;
  }

  .grade-subject-chart {
    overflow-x: auto;
    grid-template-columns: repeat(10, 58px);
  }
}

html.no-liquid-glass .grade-kpi-rail,
html.no-liquid-glass .grade-subject-ai-panel,
html.no-liquid-glass .grade-subject-button {
  border-color: var(--line);
  background: var(--surface-panel);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (max-width: 520px) {
  .brand-hero {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .workspace-switch {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
  }

  .workspace-tab {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .grade-command-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .grade-exam-head-controls {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .grade-subject-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .grade-score-toolbar {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .grade-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .grade-kpi-value {
    font-size: 21px;
  }

  .grade-panel-head {
    align-items: flex-start;
  }

  .grade-student-table {
    min-width: 0;
    font-size: 12px;
  }

  .grade-student-table th,
  .grade-student-table td {
    padding: 8px 3px;
  }

  .grade-student-table th {
    font-size: 11px;
  }

  .student-score-name {
    white-space: normal;
  }

  .grade-rank-trend {
    min-width: 0;
    justify-content: center;
    gap: 1px;
    font-size: 11px;
  }

  .grade-rank-trend .ui-icon {
    width: 9px;
    height: 9px;
  }

  .grade-rank-trend-full {
    display: none;
  }

  .grade-rank-trend-compact {
    display: inline;
  }

  .grade-score-settings-dialog {
    padding: 14px;
  }

  .grade-score-settings-table-head,
  .grade-score-setting-row {
    grid-template-columns: minmax(86px, 1.15fr) repeat(2, minmax(68px, 1fr));
    gap: 6px;
  }

  .grade-score-settings-table-head,
  .grade-score-setting-row {
    padding-right: 8px;
    padding-left: 8px;
  }

  .grade-score-setting-subject {
    gap: 5px;
  }

  .grade-score-setting-subject > span {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  .grade-score-setting-subject strong,
  .grade-score-setting-row input {
    font-size: 11px;
  }

  .grade-score-settings-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grade-score-settings-footer button {
    min-width: 0;
  }
}

@media print {
  #gradeWorkspace:not([hidden]) .grade-command-bar,
  #gradeWorkspace:not([hidden]) .grade-sidebar {
    display: none;
  }

  #gradeWorkspace:not([hidden]) .grade-dashboard {
    display: block;
    border: 0;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  #gradeWorkspace:not([hidden]) .grade-chart-panel {
    background: #ffffff;
  }

  #gradeWorkspace:not([hidden]) .grade-analysis-main {
    padding: 0;
  }
}

/* Focused single-subject analysis: filters and names lead directly to one large chart. */
.grade-analysis-workspace {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.grade-student-filterbar {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  min-height: 84px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-panel) 68%, transparent);
  padding: 7px 8px;
}

.grade-score-sort-control,
.grade-band-filters {
  display: contents;
}

.grade-score-sort-control button,
.grade-band-filter,
.grade-average-summary {
  display: inline-grid;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  place-items: center;
  border-color: var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  padding: 0;
  color: var(--muted);
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.grade-score-sort-control button .ui-icon,
.grade-band-filter .ui-icon,
.grade-band-filter > span,
.grade-average-summary .ui-icon {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
}

.grade-score-sort-control button.is-active,
.grade-band-filter.is-active,
.grade-average-summary.is-active {
  border-color: color-mix(in srgb, var(--accent) 74%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.grade-score-sort-control button:hover,
.grade-band-filter:hover,
.grade-average-summary:hover {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  color: var(--accent);
  transform: translateY(-1px);
}

.grade-average-summary {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  font-variant-numeric: tabular-nums;
}

.grade-average-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.grade-average-summary .ui-icon {
  width: 13px;
  height: 13px;
}

.grade-average-summary strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.grade-average-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.grade-average-summary.is-active strong,
.grade-average-summary.is-active small,
.grade-average-summary.is-active .grade-average-main {
  color: var(--accent);
}

.grade-student-analysis-layout {
  display: grid;
  min-width: 0;
  grid-template-columns: 244px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.grade-student-selector-panel,
.grade-student-trend-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: var(--shadow-soft);
}

.grade-student-selector-panel {
  position: sticky;
  top: 12px;
  display: grid;
  height: var(--grade-student-selector-height, calc(100dvh - 180px));
  min-height: 280px;
  max-height: none;
  grid-template-rows: auto minmax(0, 1fr);
}

.grade-student-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 48%, transparent) transparent;
}

.grade-student-list::-webkit-scrollbar {
  width: 8px;
}

.grade-student-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  background-clip: padding-box;
}

.grade-student-list-item {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 38px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border-color: transparent;
  background: transparent;
  padding: 0 10px 0 14px;
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.grade-student-list-item::before {
  position: absolute;
  inset: 7px auto 7px 5px;
  width: 3px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  opacity: .72;
}

.grade-student-seat {
  display: inline-grid;
  min-width: 24px;
  height: 21px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.grade-student-seat.is-empty {
  visibility: hidden;
}

.grade-student-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-student-list-item > strong {
  color: currentColor;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.grade-student-list-item.is-elite { color: #7651a7; }
.grade-student-list-item.is-excellent { color: #d91f3d; }
.grade-student-list-item.is-pass { color: #2563eb; }
.grade-student-list-item.is-fail { color: var(--ink); }
.grade-student-list-item.is-low { color: var(--accent); }

.grade-student-list-item:hover {
  border-color: var(--line);
  background: var(--surface-panel);
  transform: translateX(2px);
}

.grade-student-list-item.is-active {
  border-color: color-mix(in srgb, currentColor 48%, var(--line));
  background: color-mix(in srgb, currentColor 8%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 20%, transparent);
}

.grade-student-list-empty {
  display: grid;
  min-height: 190px;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.grade-student-analysis-detail {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.grade-student-trend-panel {
  min-height: 430px;
  padding: 16px 18px 10px;
}

.grade-student-trend-chart {
  min-height: 390px;
  margin: 0;
}

.grade-student-trend-svg {
  width: 100%;
  height: 390px;
  overflow: visible;
}

.grade-student-trend-band rect {
  stroke: none;
}

.grade-student-trend-band text {
  fill: var(--muted);
  font-family: "Helvetica Neue", "Microsoft YaHei", "PingFang SC", Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 720;
  opacity: .72;
}

.grade-student-trend-band.is-elite rect { fill: color-mix(in srgb, #7651a7 6%, transparent); }
.grade-student-trend-band.is-excellent rect { fill: color-mix(in srgb, #d91f3d 4%, transparent); }
.grade-student-trend-band.is-pass rect { fill: color-mix(in srgb, #2563eb 4%, transparent); }
.grade-student-trend-band.is-fail rect { fill: color-mix(in srgb, var(--muted) 3%, transparent); }
.grade-student-trend-band.is-low rect { fill: color-mix(in srgb, var(--accent) 6%, transparent); }

.grade-student-trend-column {
  stroke: color-mix(in srgb, var(--line) 72%, transparent);
  stroke-dasharray: 2 7;
  stroke-width: 1;
}

.grade-student-trend-chart.is-total-trend {
  min-height: 520px;
}

.grade-student-trend-chart.is-total-trend + * {
  margin-top: 0;
}

.grade-student-trend-panel:has(.grade-student-trend-chart.is-total-trend) {
  min-height: 560px;
}

.grade-total-trend-svg {
  display: block;
  width: 100%;
  height: 520px;
  overflow: visible;
}

.grade-total-trend-lane-bg {
  fill: color-mix(in srgb, var(--surface-panel) 62%, transparent);
  stroke: var(--line);
  stroke-width: 1;
}

.grade-total-trend-grid {
  stroke: var(--line);
  stroke-dasharray: 4 5;
  stroke-width: 1;
}

.grade-total-trend-title,
.grade-total-trend-hint,
.grade-total-trend-axis-label,
.grade-total-trend-value,
.grade-total-trend-empty,
.grade-total-trend-exam {
  fill: var(--muted);
  font-family: "Helvetica Neue", "Microsoft YaHei", "PingFang SC", Helvetica, Arial, sans-serif;
}

.grade-total-trend-title {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.grade-total-trend-hint,
.grade-total-trend-axis-label,
.grade-total-trend-empty,
.grade-total-trend-exam {
  font-size: 10px;
}

.grade-total-trend-value {
  font-size: 11px;
  font-weight: 750;
}

.grade-total-trend-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.grade-total-trend-line.is-total,
.grade-total-trend-point.is-total {
  stroke: #e4002b;
}

.grade-total-trend-line.is-class-rank,
.grade-total-trend-point.is-class-rank {
  stroke: #2563eb;
}

.grade-total-trend-line.is-grade-rank,
.grade-total-trend-point.is-grade-rank {
  stroke: #16803b;
}

.grade-total-trend-point {
  fill: var(--surface);
  stroke-width: 2.5;
}

.grade-total-trend-point.is-active {
  stroke-width: 4;
}

.grade-total-trend-value.is-total { fill: #c91536; }
.grade-total-trend-value.is-class-rank { fill: #2563eb; }
.grade-total-trend-value.is-grade-rank { fill: #16803b; }

.grade-student-trend-score {
  font-size: 13px;
}

.grade-student-trend-score.is-elite { fill: #7651a7; }
.grade-student-trend-score.is-excellent { fill: #d91f3d; }
.grade-student-trend-score.is-pass { fill: #2563eb; }
.grade-student-trend-score.is-fail { fill: var(--ink); }
.grade-student-trend-score.is-low { fill: var(--accent); }

.grade-student-trend-score-bg {
  fill: color-mix(in srgb, var(--surface) 88%, transparent);
  stroke: var(--line);
  stroke-width: 1;
}

.grade-student-trend-point.is-elite { stroke: #7651a7; }
.grade-student-trend-point.is-excellent { stroke: #d91f3d; }
.grade-student-trend-point.is-pass { stroke: #2563eb; }
.grade-student-trend-point.is-fail { stroke: var(--ink); }
.grade-student-trend-point.is-low { stroke: var(--accent); }

.grade-student-trend-halo {
  fill: none;
  stroke-width: 5;
  opacity: .14;
}

.grade-student-trend-halo.is-elite { stroke: #7651a7; }
.grade-student-trend-halo.is-excellent { stroke: #d91f3d; }
.grade-student-trend-halo.is-pass { stroke: #2563eb; }
.grade-student-trend-halo.is-fail { stroke: var(--ink); }
.grade-student-trend-halo.is-low { stroke: var(--accent); }

.grade-student-trend-delta rect {
  fill: color-mix(in srgb, var(--surface) 92%, transparent);
  stroke: var(--line);
  stroke-width: 1;
}

.grade-student-trend-delta text {
  font-family: "Helvetica Neue", "Microsoft YaHei", "PingFang SC", Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
}

.grade-student-trend-delta.is-positive text { fill: #16803b; }
.grade-student-trend-delta.is-negative text { fill: var(--accent); }
.grade-student-trend-delta.is-neutral text { fill: var(--muted); }

.grade-student-trend-point.is-active {
  fill: var(--surface);
  stroke-width: 4;
}

.grade-student-analysis-detail .grade-subject-ai-panel {
  min-height: 0;
  grid-template-columns: minmax(185px, auto) minmax(0, 1fr) 108px;
  grid-template-rows: auto;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
}

.grade-student-analysis-detail .grade-subject-ai-panel p {
  font-size: 13px;
  line-height: 1.7;
}

.grade-student-analysis-detail .grade-subject-ai-panel button {
  min-width: 108px;
}

html.no-liquid-glass .grade-student-analysis-detail .grade-subject-ai-panel {
  border-color: var(--line);
  background: var(--surface-panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (max-width: 1360px) {
  .grade-student-analysis-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

@media (max-width: 1060px) {
  .grade-student-analysis-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .grade-student-selector-panel {
    position: static;
    width: 100%;
    height: min(360px, calc(100dvh - 220px));
    min-height: 280px;
  }

  .grade-student-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grade-student-analysis-detail .grade-subject-ai-panel {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .grade-student-analysis-detail .grade-subject-ai-panel p {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
