:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #24324a;
  --muted: #748198;
  --line: #e5eaf2;
  --blue: #4b7bec;
  --blue-soft: #eaf1ff;
  --orange: #f59e42;
  --orange-soft: #fff4e8;
  --green: #35a875;
  --green-soft: #e9f8f1;
  --red: #e16060;
  --red-soft: #fff0f0;
  --shadow: 0 12px 36px rgba(55, 73, 104, 0.10);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(75, 123, 236, 0.08), transparent 28rem),
    var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

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

button {
  color: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(75, 123, 236, 0.28);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.startup-error {
  position: sticky;
  z-index: 9999;
  top: 0;
  padding: 12px 18px;
  color: #7e2525;
  background: #ffe1e1;
  border-bottom: 1px solid #efaaaa;
  font-weight: 700;
  text-align: center;
}

.teacher-app-locked {
  display: none;
}

.teacher-access-gate {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.teacher-access-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(229, 234, 242, 0.9);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 20px 60px rgba(55, 73, 104, 0.16);
}

.teacher-access-mark {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 19px;
  color: #fff;
  background: linear-gradient(145deg, #6d8ef5, #426ed8);
  box-shadow: 0 10px 24px rgba(75, 123, 236, 0.25);
  font-size: 28px;
  font-weight: 800;
}

.teacher-access-card h1 {
  margin: 0 0 24px;
  font-size: clamp(23px, 5vw, 30px);
}

.teacher-access-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.teacher-access-card input {
  width: 100%;
  min-height: 54px;
  padding: 0 15px;
  border: 1px solid #ccd5e3;
  border-radius: 14px;
  color: var(--text);
  background: #fff;
  font-size: 18px;
}

.teacher-access-card button {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(75, 123, 236, 0.22);
  font-weight: 800;
  cursor: pointer;
}

.teacher-access-error {
  min-height: 20px;
  margin: 11px 0 0;
  color: #b84242;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.app-shell {
  width: min(1600px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 24px 36px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid rgba(229, 234, 242, 0.85);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(55, 73, 104, 0.07);
  backdrop-filter: blur(12px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #6d8ef5, #426ed8);
  box-shadow: 0 8px 18px rgba(75, 123, 236, 0.24);
  font-size: 24px;
  font-weight: 800;
}

.brand-block h1 {
  margin: 0;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2;
}

.brand-block p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.class-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
}

.display-controls select {
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  color: var(--text);
  background: #fff;
  padding: 0 34px 0 13px;
  font-weight: 700;
  cursor: pointer;
}

.class-tabs {
  display: flex;
  gap: 5px;
  padding: 3px;
  border-radius: 12px;
  background: #eaf0f8;
}

.class-tab {
  min-width: 92px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: #66758c;
  background: transparent;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.class-tab:hover {
  color: var(--blue);
  background: rgba(255, 255, 255, 0.62);
}

.class-tab.active {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 5px 13px rgba(75, 123, 236, 0.24);
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cloud-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cloud-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9aa7ba;
}

.cloud-button[data-status="saved"] .cloud-dot {
  background: var(--green);
}

.cloud-button[data-status="loading"] .cloud-dot,
.cloud-button[data-status="saving"] .cloud-dot {
  background: var(--orange);
}

.cloud-button[data-status="error"] .cloud-dot {
  background: var(--red);
}

.cloud-button[data-status="conflict"] .cloud-dot {
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(225, 121, 31, 0.14);
}

.cloud-panel {
  text-align: center;
}

.cloud-panel-icon {
  display: grid;
  width: 68px;
  height: 68px;
  margin: 0 auto 13px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 31px;
}

.cloud-panel p {
  margin: 0 0 5px;
  color: var(--muted);
}

.cloud-panel strong {
  font-size: 17px;
}

.cloud-login-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

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

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

.button-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 7px 18px rgba(75, 123, 236, 0.2);
}

.button-display {
  color: #fff;
  background: #34486c;
}

.button-quiet {
  border: 1px solid var(--line);
  background: #fff;
}

.button-praise {
  color: #2459b9;
  background: var(--blue-soft);
}

.button-improve {
  color: #ad611f;
  background: var(--orange-soft);
}

.button-success {
  color: #17714b;
  background: var(--green-soft);
}

.button-danger {
  color: #fff;
  background: var(--red);
}

.button-danger-soft {
  color: #b84242;
  background: var(--red-soft);
}

.button-small {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 14px;
}

.main-tabs {
  display: flex;
  gap: 8px;
  width: fit-content;
  margin: 18px 0 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.82);
}

.main-tab {
  min-height: 43px;
  padding: 0 22px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.main-tab.active {
  color: #fff;
  background: #34486c;
  box-shadow: 0 6px 15px rgba(52, 72, 108, 0.2);
}

.notice-editor-page {
  margin-top: 18px;
}

.notice-editor-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notice-editor-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.notice-editor-heading p,
.notice-preview-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
}

.notice-editor-heading h2 {
  margin: 0;
  font-size: 25px;
}

.notice-editor-heading > span {
  color: var(--muted);
  font-size: 13px;
}

.ticker-editor {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #b9cdf0;
  border-radius: 18px;
  background: linear-gradient(135deg, #f4f8ff, #eef5ff);
}

.ticker-editor-copy {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.ticker-editor-copy strong {
  color: #285fae;
  font-size: 17px;
}

.ticker-editor-copy span {
  color: var(--muted);
  font-size: 13px;
}

.ticker-editor-controls {
  display: flex;
  gap: 9px;
}

.ticker-editor-controls .text-input {
  min-width: 0;
  flex: 1;
}

.ticker-style-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.ticker-style-controls label {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.ticker-style-controls input[type="color"] {
  width: 38px;
  height: 32px;
  padding: 2px;
  border: 0;
  background: transparent;
}

.ticker-style-controls input[type="range"] {
  width: 130px;
}

.ticker-style-controls output {
  min-width: 38px;
  color: var(--text);
  font-weight: 800;
}

.ticker-style-controls select {
  border: 0;
  color: var(--text);
  background: transparent;
  font-weight: 700;
}

.ticker-editor-preview {
  overflow: hidden;
  padding: 10px 14px;
  border: 1px solid #f1c46d;
  border-radius: 12px;
  color: #854400;
  background: #fff2c9;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker-editor-preview.empty {
  border-color: var(--line);
  color: var(--muted);
  background: #fff;
  font-weight: 600;
}

.notice-editor-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(480px, 1.2fr);
  gap: 24px;
  align-items: start;
}

.notice-form {
  display: grid;
  gap: 16px;
}

.notice-form label > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.notice-body-input {
  min-height: 180px;
}

.notice-option-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.notice-option-row .text-input {
  width: 100%;
}

.notice-image-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.notice-image-controls small {
  width: 100%;
  color: var(--muted);
}

.notice-actions {
  display: flex;
  gap: 10px;
}

.notice-slide {
  --notice-accent: #7da3ff;
  --notice-bg-a: #172238;
  --notice-bg-b: #293f68;
  position: relative;
  display: grid;
  min-height: 470px;
  overflow: hidden;
  padding: clamp(34px, 5vw, 72px);
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--notice-accent) 36%, transparent), transparent 38%),
    linear-gradient(145deg, var(--notice-bg-a), var(--notice-bg-b));
  box-shadow: 0 18px 46px rgba(31, 44, 69, 0.24);
  isolation: isolate;
}

.notice-slide::before {
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  content: "";
  pointer-events: none;
}

.notice-slide.theme-orange {
  --notice-accent: #ffc269;
  --notice-bg-a: #3b2517;
  --notice-bg-b: #8a4e20;
}

.notice-slide.theme-green {
  --notice-accent: #83e0bd;
  --notice-bg-a: #15342d;
  --notice-bg-b: #256d5a;
}

.notice-slide.theme-purple {
  --notice-accent: #c9adff;
  --notice-bg-a: #28203f;
  --notice-bg-b: #594582;
}

.notice-slide.theme-red {
  --notice-accent: #ff9b9b;
  --notice-bg-a: #401d26;
  --notice-bg-b: #8b3342;
}

.notice-slide-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  max-width: 100%;
}

.notice-slide.align-center .notice-slide-copy {
  text-align: center;
}

.notice-slide-kicker {
  display: inline-block;
  margin-bottom: 18px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #15223a;
  background: var(--notice-accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.notice-slide h3 {
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.15;
}

.notice-slide-copy > div {
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(17px, 2vw, 26px);
  font-weight: 600;
  line-height: 1.65;
  white-space: pre-wrap;
}

.notice-slide-image {
  position: relative;
  z-index: 2;
  width: min(78%, 700px);
  max-height: 260px;
  align-self: end;
  justify-self: center;
  margin-top: 28px;
  border: 5px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 13px 30px rgba(0, 0, 0, 0.24);
}

.notice-canvas-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.notice-canvas-toolbar label {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.notice-canvas-toolbar select {
  border: 0;
  color: var(--text);
  background: transparent;
  font-weight: 700;
}

.notice-canvas-toolbar input[type="range"] {
  width: 120px;
}

.notice-canvas-toolbar input[type="color"] {
  width: 34px;
  height: 32px;
  padding: 2px;
  border: 0;
  background: transparent;
}

.notice-toolbar-spacer {
  flex: 1;
}

.notice-canvas-help {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.notice-canvas-wrap {
  width: 100%;
  overflow: auto;
  padding: 10px;
  border-radius: 20px;
  background: #e8edf5;
}

.notice-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(31, 44, 69, 0.22);
  container-type: inline-size;
  user-select: none;
}

.notice-canvas.background-white {
  background: #fff;
}

.notice-canvas.background-blue {
  background: linear-gradient(145deg, #172238, #405c91);
}

.notice-canvas.background-orange {
  background: linear-gradient(145deg, #3b2517, #a45d24);
}

.notice-canvas.background-green {
  background: linear-gradient(145deg, #15342d, #2e806b);
}

.notice-canvas.background-purple {
  background: linear-gradient(145deg, #28203f, #6b529b);
}

.notice-canvas.background-red {
  background: linear-gradient(145deg, #401d26, #a13c4e);
}

.notice-canvas-element {
  position: absolute;
  min-width: 5%;
  min-height: 5%;
  overflow: hidden;
  user-select: none;
  cursor: move;
  touch-action: none;
}

.notice-canvas-element.selected {
  outline: 3px solid #4b7bec;
  outline-offset: 2px;
}

.notice-resize-handle {
  position: absolute;
  z-index: 5;
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #4b7bec;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.24);
  touch-action: none;
}

.notice-canvas-element.selected .notice-resize-handle {
  display: block;
}

.handle-nw {
  top: -7px;
  left: -7px;
  cursor: nwse-resize;
}

.handle-ne {
  top: -7px;
  right: -7px;
  cursor: nesw-resize;
}

.handle-sw {
  bottom: -7px;
  left: -7px;
  cursor: nesw-resize;
}

.handle-se {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}

.notice-canvas-text {
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 8px;
  font-weight: 700;
  line-height: 1.25;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
  outline: none;
  cursor: move;
}

.notice-canvas-text[contenteditable="true"] {
  cursor: text;
  user-select: text;
}

.notice-canvas-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  transform-origin: center;
}

.notice-image-viewer {
  position: fixed;
  z-index: 12000;
  inset: 0;
  display: grid;
  padding: 40px;
  place-items: center;
  background: rgba(9, 15, 27, 0.9);
}

.notice-image-viewer img {
  max-width: 94vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
}

.notice-image-viewer button {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  font-size: 30px;
  cursor: pointer;
}

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

.stat-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 106px;
  padding: 18px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-align: left;
  background: var(--surface);
  box-shadow: 0 7px 24px rgba(55, 73, 104, 0.06);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.stat-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  font-size: 20px;
  font-weight: 800;
}

.stat-praise .stat-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.stat-pending .stat-icon {
  color: #c66d1e;
  background: var(--orange-soft);
}

.stat-completed .stat-icon {
  color: var(--green);
  background: var(--green-soft);
}

.stat-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-copy small {
  color: var(--muted);
  font-size: 15px;
}

.stat-copy strong {
  font-size: 34px;
  line-height: 1.1;
}

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

.wall-panel {
  min-height: 400px;
  padding: 22px;
  border: 1px solid rgba(229, 234, 242, 0.9);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 34px rgba(55, 73, 104, 0.07);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 19px;
}

.wall-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.batch-toolbar {
  display: flex;
  position: sticky;
  z-index: 5;
  top: 8px;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid #cad8f4;
  border-radius: 15px;
  background: rgba(241, 246, 255, 0.96);
  box-shadow: 0 8px 22px rgba(55, 73, 104, 0.1);
  backdrop-filter: blur(8px);
}

.batch-toolbar strong {
  margin-right: auto;
}

.eyebrow,
.modal-kicker {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.section-heading h2,
.modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.section-heading .class-wall-title {
  color: #24324a;
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: 0.04em;
}

.wall-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  margin-left: 8px;
  border-radius: 50%;
}

.legend-orange {
  background: var(--orange);
}

.legend-red {
  background: var(--red);
}

.legend-overdue {
  background: #9f2f3b;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(92px, 8.4vw, 122px), 1fr));
  gap: 10px;
}

.student-card {
  position: relative;
  display: flex;
  min-height: 178px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 11px 12px;
  border: 2px solid transparent;
  border-radius: 18px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.roster-student-card {
  min-height: 124px;
  padding: 10px 7px 8px;
  border-color: transparent !important;
  background: var(--surface-soft) !important;
  box-shadow: none !important;
}

.roster-student-card .student-avatar {
  width: 58px;
  height: 58px;
  font-size: 22px;
}

.roster-student-card .student-name {
  margin-top: 6px;
  font-size: 14px;
}

.roster-student-card .student-badges {
  top: 6px;
  right: 6px;
}

.roster-student-card .badge-pending,
.pending-summary-card .badge-pending {
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  background: #d92f43;
  box-shadow: 0 3px 8px rgba(176, 31, 51, 0.22);
  font-size: 13px;
  line-height: 28px;
}

.student-card:hover,
.student-card:focus-visible {
  z-index: 1;
  transform: scale(1.035);
  box-shadow: 0 10px 25px rgba(55, 73, 104, 0.13);
}

.student-card.has-pending {
  border-color: var(--orange);
  background: #fffaf4;
}

.student-card.is-alert {
  border-color: var(--red);
  background: #fff7f7;
}

.student-card.has-overdue {
  border-color: #a83242;
  background: #fff4f5;
  box-shadow: inset 0 0 0 1px rgba(168, 50, 66, 0.12);
}

.student-card.has-weekly-repeat {
  border-color: #c73548;
  background: #fff1f3;
  box-shadow: inset 0 0 0 1px rgba(199, 53, 72, 0.16);
}

.student-card.has-commitment-repeat {
  border-color: #be263d;
  background: #fff0f2;
}

.student-card.is-selected {
  border-color: var(--blue);
  background: #edf3ff;
  box-shadow: 0 0 0 3px rgba(75, 123, 236, 0.16);
}

.student-card.is-selected::before {
  display: grid;
  position: absolute;
  z-index: 2;
  top: 7px;
  left: 7px;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  content: "✓";
  font-size: 15px;
  font-weight: 800;
}

.student-avatar {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 5px 13px rgba(55, 73, 104, 0.16);
  font-size: 25px;
  font-weight: 800;
}

.student-pending-reasons {
  display: flex;
  width: 100%;
  max-height: 66px;
  flex-direction: column;
  gap: 3px;
  margin-top: 7px;
  overflow: hidden;
  color: #9b4d16;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-align: left;
}

.student-pending-reasons span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-pending-reasons small {
  margin-left: 4px;
  color: #8a6e59;
  font-size: 10px;
  font-weight: 700;
}

.date-status {
  display: inline-block;
  margin-left: 3px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  font-style: normal;
}

.date-status.postponed {
  color: #b3283d;
  background: #ffe0e5;
}

.date-status.overdue {
  color: #fff;
  background: #b93849;
}

.student-no-pending {
  margin-top: 7px;
  color: #8794a8;
  font-size: 12px;
}

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

.pending-summary-card {
  width: 100%;
  min-height: 190px;
}

.pending-student-identity {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.pending-card-record {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.pending-card-record input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--orange);
}

.pending-card-record > span {
  min-width: 0;
}

.pending-card-record b {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-card-record small {
  display: block;
  margin: 2px 0 0;
  color: #7b6a5b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
}

.pending-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.pending-card-actions button {
  min-height: 27px;
  padding: 0 7px;
  border: 1px solid #e6c09a;
  border-radius: 7px;
  color: #8d4a14;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.pending-card-actions .button-success {
  border-color: #9fd8c1;
  color: #187653;
  background: #eaf8f2;
}

.pending-card-actions .button-danger-soft {
  border-color: #f0b6bf;
  color: #b83246;
  background: #fff1f3;
}

.student-name {
  width: 100%;
  margin-top: 8px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-number {
  color: var(--muted);
  font-size: 12px;
}

.student-badges {
  display: flex;
  position: absolute;
  top: 7px;
  right: 5px;
  gap: 4px;
  flex-direction: column;
  align-items: flex-end;
}

.mini-badge {
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 25px;
  text-align: center;
}

.badge-praise {
  background: var(--blue);
}

.badge-pending {
  background: var(--orange);
}

.is-alert .badge-pending {
  background: var(--red);
}

.badge-overdue {
  background: #9f2f3b;
}

.weekly-repeat-chip {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #fff;
  background: #c73548;
  font-size: 10px;
  font-weight: 800;
}

.commitment-repeat-chip {
  position: absolute;
  z-index: 2;
  bottom: 7px;
  left: 6px;
  max-width: calc(100% - 12px);
  padding: 4px 7px;
  overflow: hidden;
  border-radius: 999px;
  color: #fff;
  background: #b9273f;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commitment-repeat-chip + .weekly-repeat-chip {
  display: none;
}

.empty-state {
  padding: 70px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  font-size: 20px;
}

.empty-state p {
  margin: 10px 0 20px;
}

.modal-backdrop {
  display: grid;
  position: fixed;
  z-index: 100;
  inset: 0;
  place-items: center;
  padding: 20px;
  background: rgba(24, 36, 58, 0.45);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(760px, 100%);
  max-height: min(90vh, 900px);
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(21, 31, 50, 0.28);
}

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

.modal.modal-small {
  width: min(500px, 100%);
}

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

.icon-button {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 29px;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  max-height: calc(90vh - 86px);
  overflow-y: auto;
  padding: 22px;
}

.student-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-soft);
}

.student-summary .student-avatar {
  width: 78px;
  height: 78px;
  font-size: 29px;
}

.student-summary h3 {
  margin: 0 0 4px;
  font-size: 26px;
}

.student-summary p {
  margin: 0;
  color: var(--muted);
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.summary-stat {
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
}

.summary-stat strong {
  display: block;
  margin-bottom: 4px;
  font-size: 24px;
}

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

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

.large-action {
  min-height: 86px;
  border: 0;
  border-radius: 18px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.large-action span {
  display: block;
  margin-bottom: 3px;
  font-size: 25px;
}

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

.improve-choice-groups {
  display: grid;
  gap: 18px;
}

.improve-choice-group {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf4;
  overflow: hidden;
}

.improve-choice-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px;
  color: #a85a18;
  background: #fff7ed;
  cursor: pointer;
  list-style: none;
}

.improve-choice-group > summary::-webkit-details-marker {
  display: none;
}

.improve-choice-group > summary::before {
  content: "▶";
  font-size: 12px;
  transition: transform 150ms ease;
}

.improve-choice-group[open] > summary::before {
  transform: rotate(90deg);
}

.improve-choice-group > summary strong {
  flex: 1;
  font-size: 16px;
}

.improve-choice-group > summary span {
  padding: 3px 8px;
  border-radius: 999px;
  color: #9b571c;
  background: #ffe2bd;
  font-size: 12px;
  font-weight: 800;
}

.improve-delete-group {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #b24a35;
  background: #ffe0d8;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.improve-choice-group-body {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid rgba(225, 147, 72, 0.18);
}

.improve-drag-help {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.improve-choice-group.is-drop-target {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(225, 121, 31, 0.16);
}

.choice-card.is-long-press-dragging {
  opacity: 0.28;
}

.improve-drag-ghost {
  position: fixed;
  z-index: 10000;
  margin: 0;
  opacity: 0.9;
  pointer-events: none;
  transform: scale(1.03);
  box-shadow: 0 16px 36px rgba(113, 66, 25, 0.26);
}

.improve-add-item-button {
  justify-self: start;
}

.improve-inline-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
}

.improve-new-group-panel {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.improve-add-group-button {
  min-height: 58px;
  border-style: dashed;
  font-size: 16px;
  font-weight: 800;
}

.choice-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 72px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  -webkit-touch-callout: none;
}

.choice-delete {
  display: grid;
  position: absolute;
  top: 5px;
  right: 6px;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: #a14949;
  background: #fff0f0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.choice-emoji {
  font-size: 27px;
  line-height: 1;
}

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.emoji-picker legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.emoji-picker label {
  cursor: pointer;
}

.emoji-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.emoji-picker span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 11px;
  background: var(--surface-soft);
  font-size: 23px;
}

.emoji-picker input:checked + span {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.choice-card.selected {
  border-color: var(--blue);
  color: #2b5ec0;
  background: var(--blue-soft);
}

.choice-card.improve-choice.selected {
  border-color: var(--orange);
  color: #a85a18;
  background: var(--orange-soft);
}

.choice-card.improve-choice {
  touch-action: none;
}

@media (hover: hover) and (pointer: fine) {
  .choice-delete:hover {
    color: #fff;
    background: var(--red);
  }

  .choice-card:hover {
    border-color: var(--blue);
    color: #2b5ec0;
    background: var(--blue-soft);
  }

  .choice-card.improve-choice:hover {
    border-color: var(--orange);
    color: #a85a18;
    background: var(--orange-soft);
  }
}

.praise-score-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.praise-score-button {
  display: grid;
  min-height: 100px;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 2px solid #8db6f1;
  border-radius: 18px;
  color: #255da9;
  background: #edf5ff;
  cursor: pointer;
}

.praise-score-button strong {
  font-size: 30px;
  line-height: 1;
}

.praise-score-button span {
  font-size: 15px;
  font-weight: 800;
}

.praise-score-button:hover,
.praise-score-button:focus-visible {
  border-color: #2e6fd0;
  color: #fff;
  background: #397bd8;
  transform: translateY(-2px);
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 15px;
  font-size: 18px;
}

.step-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 14px;
}

.form-section + .form-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.form-field {
  margin-top: 14px;
}

.custom-input-action {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.custom-input-action .text-input {
  min-width: 0;
  flex: 1;
}

.custom-input-action .button {
  flex: 0 0 auto;
}

.form-field label,
.settings-field > label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.text-input,
.text-area {
  width: 100%;
  border: 1px solid #ccd5e3;
  border-radius: 13px;
  color: var(--text);
  background: #fff;
  padding: 13px 14px;
}

.text-input {
  min-height: 50px;
}

.text-area {
  min-height: 155px;
  resize: vertical;
  line-height: 1.7;
}

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

.modal-navigation {
  justify-content: flex-start;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pending-batch-toolbar {
  position: sticky;
  top: -1px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #f0c694;
  border-radius: 14px;
  background: #fff8ef;
  box-shadow: 0 8px 20px rgba(112, 72, 29, 0.08);
}

.pending-select-all,
.record-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.pending-select-all input,
.record-select input {
  width: 20px;
  height: 20px;
  accent-color: var(--orange);
}

.pending-batch-toolbar strong {
  flex: 1;
  color: #9a581e;
  font-size: 14px;
}

.batch-completion-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.record-date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 5px 0 0;
  color: #6b7b92;
  font-size: 13px;
  font-weight: 800;
}

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

.record-date-divider span {
  padding: 5px 11px;
  border-radius: 999px;
  background: #eef2f7;
}

.record-card {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(220px, 1.6fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 15px;
  background: #fff;
}

.record-card:has(.record-select) {
  grid-template-columns: auto minmax(130px, 0.7fr) minmax(220px, 1.6fr) auto;
}

.record-select {
  align-self: stretch;
  padding: 0 4px;
}

.record-card.pending {
  border-left-color: var(--orange);
}

.record-card.postponed:not(.overdue) {
  border-color: #efc4ca;
  border-left-color: #c95363;
  background: #fff3f5;
}

.record-card.completed {
  border-left-color: var(--green);
}

.record-card.overdue {
  border-color: #e8b3b9;
  border-left-color: #a83242;
  background: #fff7f8;
}

.student-improve-card {
  overflow: hidden;
  border: 1px solid #efb8c0;
  border-left: 5px solid #d04f61;
  border-radius: 16px;
  background: #fff8f9;
}

.student-improve-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid #f1cbd0;
  background: #fff1f3;
}

.student-improve-header > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.student-improve-header strong {
  color: #24324a;
  font-size: 18px;
}

.student-improve-header span,
.student-improve-header small {
  color: #78869b;
  font-size: 12px;
  font-weight: 750;
}

.teacher-pending-count {
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  background: #d92f43;
  box-shadow: 0 3px 8px rgba(176, 31, 51, 0.18);
  font-size: 13px;
}

.record-list .date-status {
  font-size: 11px;
}

.student-improve-items {
  display: flex;
  flex-direction: column;
}

.student-improve-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid #f1dce0;
  background: rgba(255, 255, 255, 0.72);
}

.student-improve-item:last-child {
  border-bottom: 0;
}

.student-improve-item:has(.record-select) {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.student-improve-item.completed {
  background: #f3fbf7;
}

.student-improve-item.overdue {
  background: #fff0f2;
}

.student-improve-reason {
  min-width: 0;
}

.student-improve-reason > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.student-improve-reason > div > strong {
  color: #253550;
  font-size: 16px;
}

.student-improve-reason small {
  display: block;
  margin-top: 4px;
  color: #76849a;
  font-size: 12px;
}

.student-improve-reason p {
  margin: 5px 0 0;
  color: #9a581e;
  font-size: 13px;
  font-weight: 750;
}

.record-status {
  padding: 2px 7px;
  border-radius: 999px;
  color: #a15b18;
  background: #fff0d9;
  font-size: 11px;
  font-weight: 850;
}

.record-status.completed {
  color: #237052;
  background: #ddf5e9;
}

.student-error-history {
  max-height: min(48vh, 460px);
  overflow-y: auto;
}

.student-error-row {
  padding: 11px 13px;
  border-left: 4px solid var(--orange);
  border-radius: 11px;
  background: #fff8ef;
}

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

.student-error-row.completed {
  border-left-color: var(--green);
  background: #f1faf6;
}

.student-error-row > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.student-error-row > span {
  display: block;
  margin-top: 5px;
  color: #738198;
  font-size: 12px;
}

.postponed-label {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #b3283d;
  background: #ffe0e5;
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
}

.commitment-repeat-detail {
  margin-top: 9px;
  padding: 10px 12px;
  border: 1px solid #efb2ba;
  border-radius: 11px;
  color: #7f2634;
  background: #fff1f3;
}

.commitment-repeat-detail > strong {
  color: #b9273f;
}

.commitment-repeat-detail p,
.commitment-completed-detail p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.commitment-completed-detail {
  margin-top: 9px;
  padding: 9px 11px;
  border: 1px solid #bfe3d4;
  border-radius: 11px;
  color: #285f4b;
  background: #f0faf6;
}

.commitment-completed-detail summary {
  color: #237052;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.recent-evaluations {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.recent-evaluations-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.recent-evaluation {
  padding: 11px 12px;
  border-left: 4px solid var(--blue);
  border-radius: 11px;
  background: #fff;
}

.recent-evaluation + .recent-evaluation {
  margin-top: 8px;
}

.recent-evaluation.improve {
  border-left-color: var(--orange);
}

.recent-evaluation.completed {
  border-left-color: var(--green);
}

.recent-evaluation > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.recent-evaluation span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.recent-evaluation p {
  margin: 6px 0 0;
  color: #5c6c82;
  font-size: 13px;
  line-height: 1.5;
}

.recent-evaluation .recent-commitment {
  color: #247052;
}

.recent-evaluation-empty {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.completion-record-summary {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 12px;
  margin-bottom: 18px;
}

.completion-record-summary > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.completion-record-summary span,
.completion-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.completion-field {
  display: block;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.completion-field .text-input + .text-input,
.completion-field .text-input + .text-area {
  margin-top: 9px;
}

.weekly-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 13px 16px;
  border: 1px solid #efb2ba;
  border-radius: 14px;
  color: #a32637;
  background: #fff1f3;
}

.weekly-alert span {
  font-weight: 700;
}

.weekly-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  flex-wrap: wrap;
}

.weekly-summary strong {
  margin-right: 4px;
}

.weekly-summary span {
  padding: 5px 9px;
  border-radius: 999px;
  color: #53647b;
  background: #e8edf4;
  font-size: 13px;
}

.weekly-summary span.is-repeat {
  color: #fff;
  background: #c73548;
  font-weight: 800;
}

.record-person {
  font-weight: 800;
}

.record-person span,
.record-detail small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.record-detail strong {
  display: block;
  margin-bottom: 4px;
}

.record-task {
  color: #5c6c82;
  font-size: 14px;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.list-empty {
  padding: 54px 20px;
  border: 2px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.settings-layout {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 22px;
  min-height: 520px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.settings-nav button {
  min-height: 50px;
  padding: 0 15px;
  border: 0;
  border-radius: 13px;
  text-align: left;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.settings-nav button.active {
  color: #2d61c3;
  background: var(--blue-soft);
}

.settings-content h3 {
  margin: 0 0 6px;
  font-size: 21px;
}

.settings-content > p {
  margin: 0 0 20px;
  color: var(--muted);
}

.settings-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.settings-card + .settings-card {
  margin-top: 13px;
}

.settings-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 10px;
}

.settings-field + .settings-field {
  margin-top: 17px;
}

.item-manager {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.item-row {
  display: grid;
  grid-template-columns: 58px 1fr auto auto;
  gap: 8px;
}

.add-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 9px;
  margin-bottom: 16px;
}

.emoji-select {
  min-height: 48px;
  border: 1px solid #ccd5e3;
  border-radius: 12px;
  background: #fff;
  font-size: 22px;
  text-align: center;
}

.data-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.data-action-card {
  display: flex;
  min-height: 130px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.data-action-card strong {
  font-size: 17px;
}

.data-action-card p {
  margin: 7px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.confirm-box {
  padding: 8px 10px 4px;
  text-align: center;
}

.confirm-symbol {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: 50%;
  color: #b76020;
  background: var(--orange-soft);
  font-size: 31px;
  font-weight: 800;
}

.confirm-box h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.confirm-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.confirm-box .modal-actions {
  justify-content: center;
}

.toast-region {
  display: flex;
  position: fixed;
  z-index: 300;
  top: 22px;
  right: 22px;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  padding: 14px 18px;
  border-radius: 13px;
  color: #fff;
  background: #34486c;
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease-out;
  font-weight: 700;
}

.toast.success {
  background: #23805a;
}

.toast.warning {
  background: #b96520;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.display-overlay {
  display: flex;
  position: fixed;
  z-index: 200;
  inset: 0;
  flex-direction: column;
  color: #eaf0fa;
  background:
    radial-gradient(circle at 15% 0%, rgba(83, 120, 190, 0.3), transparent 35rem),
    #172238;
}

.display-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.display-header p {
  margin: 0 0 3px;
  color: #9fb0ca;
  font-size: 14px;
}

.display-header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(25px, 3vw, 38px);
}

.display-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 8px;
  color: #aebbd0;
  font-size: 13px;
}

.display-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.display-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.display-legend .legend-praise {
  background: #6591ef;
}

.display-legend .legend-pending {
  background: #f59e42;
}

.display-legend .legend-overdue {
  background: #e45262;
}

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

.display-controls label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #aebbd0;
  font-size: 13px;
}

.display-controls select {
  min-height: 42px;
}

.segmented {
  display: flex;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.segmented button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: #aebbd0;
  background: transparent;
  cursor: pointer;
}

.segmented button.active {
  color: #fff;
  background: #4d6fae;
}

.display-close {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.display-main {
  display: grid;
  grid-template-columns: 0.82fr 1.55fr 0.82fr;
  flex: 1;
  gap: 18px;
  min-height: 0;
  padding: 22px 28px;
}

.display-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.055);
}

.display-column.pending {
  border-color: rgba(245, 158, 66, 0.48);
  background: rgba(245, 158, 66, 0.1);
}

.display-column.completed {
  border-color: rgba(53, 168, 117, 0.36);
}

.display-column.praise {
  border-color: rgba(91, 139, 239, 0.4);
}

.display-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 21px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.display-column-header h3 {
  margin: 0;
  font-size: clamp(22px, 2.1vw, 32px);
}

.display-column-header strong {
  display: grid;
  min-width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 27px;
}

.display-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 11px;
  overflow-y: auto;
  padding: 14px;
}

.display-column.pending .display-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
}

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

.display-record-grid.pending {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.display-record-card {
  position: relative;
  display: flex;
  min-height: 172px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 9px 10px;
  border: 2px solid rgba(91, 139, 239, 0.7);
  border-radius: 15px;
  color: #24324a;
  background: #f7faff;
}

button.display-record-card {
  width: 100%;
  font: inherit;
  cursor: pointer;
}

.display-record-card.pending {
  border-color: #ee9a3c;
  background: #fffaf4;
}

.display-record-card.completed {
  border-color: #48a981;
  background: #f3fbf7;
}

.display-record-count {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #fff;
  background: #4f82d4;
  font-size: 10px;
  font-weight: 900;
}

.display-record-card.pending .display-record-count {
  background: #ed922d;
}

.display-record-card.completed .display-record-count {
  background: #2d946b;
}

.display-record-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 5px 13px rgba(55, 73, 104, 0.16);
  font-size: 23px;
  font-weight: 900;
}

.display-record-card > strong {
  margin-top: 7px;
  color: #24324a;
  font-size: 15px;
}

.display-record-reasons {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  color: #485a73;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  text-align: left;
}

.display-record-card.pending .display-record-reasons {
  color: #9a4d13;
}

.display-record-card.completed .display-record-reasons {
  color: #257052;
}

.display-record-reasons > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-record-reasons small {
  margin-left: 3px;
  color: #758198;
  font-size: 9px;
}

.display-column.pending .pending-student-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.display-column.pending .pending-summary-card {
  min-height: 180px;
  border-color: #f0a04a;
  background: #fffaf4;
}

.display-column.pending .pending-summary-card.has-overdue {
  border-color: #c83e52;
  background: #fff3f5;
}

.display-column.pending .student-name {
  color: #24324a;
}

.display-column.pending .student-improve-card {
  flex: 0 0 auto;
  border-color: rgba(255, 139, 152, 0.68);
  background: rgba(130, 31, 47, 0.22);
}

.display-column.pending .student-improve-header {
  border-bottom-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.08);
}

.display-column.pending .student-improve-header strong {
  color: #fff;
}

.display-column.pending .student-improve-header span,
.display-column.pending .student-improve-header small {
  color: #f4cbd2;
}

.display-column.pending .student-improve-item {
  grid-template-columns: 1fr;
  padding: 10px 12px;
  border-bottom-color: rgba(255, 255, 255, 0.1);
  background: transparent;
}

.display-column.pending .student-improve-item .record-actions {
  justify-content: flex-start;
}

.display-column.pending .student-improve-item .button {
  padding: 7px 9px;
  font-size: 12px;
}

.display-column.pending .student-improve-reason > div > strong {
  color: #fff;
}

.display-column.pending .student-improve-reason small {
  color: #c9d3e2;
}

.display-column.pending .student-improve-reason p {
  color: #ffd59b;
}

.display-column.pending .display-empty {
  grid-column: 1 / -1;
}

.display-entry {
  padding: 11px 13px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.09);
  font-size: clamp(14px, 1.08vw, 18px);
  line-height: 1.35;
}

.display-entry.overdue {
  border: 2px solid #ff8b98;
  background: rgba(190, 55, 72, 0.25);
  box-shadow: 0 0 24px rgba(219, 73, 91, 0.16);
}

.display-entry.postponed:not(.overdue) {
  border: 2px solid rgba(255, 139, 152, 0.68);
  background: rgba(190, 55, 72, 0.14);
}

.display-entry strong {
  color: #fff;
}

.display-praise-score {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
  background: #d94b60;
  box-shadow: 0 2px 9px rgba(217, 75, 96, 0.32);
  font-weight: 900;
}

.display-task {
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 9px;
  color: #fff7d6;
  background: rgba(245, 158, 66, 0.22);
  font-size: 0.88em;
  font-weight: 700;
}

.display-task b {
  display: inline-block;
  margin-right: 7px;
  padding: 2px 6px;
  border-radius: 7px;
  color: #38220e;
  background: #ffc56f;
  font-size: 0.76em;
}

.overdue-label {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: #b93849;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.repeat-label {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: #c73548;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.display-entry.repeated {
  border: 2px solid #ff7587;
  background: rgba(199, 53, 72, 0.22);
}

.display-entry small {
  display: block;
  margin-top: 5px;
  color: #bac6d8;
  font-size: 0.68em;
}

.simple-number-list {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 13px;
}

.simple-number {
  display: grid;
  min-width: 76px;
  min-height: 64px;
  padding: 8px 13px;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  font-size: clamp(23px, 2.4vw, 36px);
  font-weight: 800;
  text-align: center;
}

.simple-number small {
  display: block;
  color: #c4cedd;
  font-size: 12px;
  font-weight: 600;
}

.display-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: #9eacc1;
  font-size: 18px;
  text-align: center;
}

.display-footer {
  display: flex;
  justify-content: center;
  padding: 10px 28px 16px;
  color: #8798b1;
  font-size: 14px;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .class-picker {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
  }

  .class-tabs {
    flex: 1;
  }

  .class-tab {
    flex: 1;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    min-height: 92px;
    padding: 13px;
  }

  .stat-arrow {
    display: none;
  }

  .student-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }

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

  .display-header {
    align-items: flex-start;
  }

  .display-main {
    grid-template-columns: 0.78fr 1.5fr 0.78fr;
    gap: 10px;
    padding: 14px;
  }

  .notice-editor-grid {
    grid-template-columns: 1fr;
  }

  .praise-score-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .class-picker {
    justify-content: space-between;
    align-items: stretch;
    flex-direction: column;
  }

  .class-tabs {
    width: 100%;
  }

  .class-tab {
    min-width: 0;
    padding: 0 10px;
  }

  .improve-inline-form {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .improve-inline-form .button {
    grid-column: 1 / -1;
  }

  .header-actions > * {
    flex: 1;
  }

  .main-tabs {
    width: 100%;
  }

  .main-tab {
    flex: 1;
  }

  .notice-editor-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .notice-option-row {
    grid-template-columns: 1fr;
  }

  .notice-slide {
    min-height: 390px;
    padding: 34px 28px;
  }

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

  .stat-card {
    min-height: 80px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .wall-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .batch-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .batch-toolbar strong {
    width: 100%;
  }

  .wall-hint {
    flex-wrap: wrap;
  }

  .large-actions,
  .summary-stats,
  .data-actions {
    grid-template-columns: 1fr;
  }

  .recent-evaluations-heading,
  .recent-evaluation > div {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .record-card:has(.record-select) {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .record-card:has(.record-select) .record-detail,
  .record-card:has(.record-select) .record-actions {
    grid-column: 1 / -1;
  }

  .student-improve-item,
  .student-improve-item:has(.record-select) {
    grid-template-columns: 1fr;
  }

  .student-improve-item .record-select {
    align-self: auto;
  }

  .pending-batch-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .pending-batch-toolbar .button {
    width: 100%;
  }

  .record-actions {
    justify-content: flex-start;
  }

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

  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .settings-nav button {
    flex: 0 0 auto;
  }

  .display-header {
    flex-direction: column;
    padding: 14px;
  }

  .display-controls {
    justify-content: flex-start;
  }

  .display-main {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .display-record-grid.pending {
    grid-template-columns: 1fr;
  }

  .display-column {
    min-height: 320px;
  }
}

@media (max-width: 520px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }

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

  .student-card {
    min-height: 164px;
  }

  .student-avatar {
    width: 54px;
    height: 54px;
  }

  .settings-row,
  .item-row,
  .add-row {
    grid-template-columns: 1fr;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
