:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f4f6fb;
  --text: #171923;
  --muted: #697386;
  --line: #dde2ea;
  --line-strong: #c8d0dc;
  --blue: #3f63e6;
  --blue-strong: #274bd6;
  --blue-soft: #edf2ff;
  --green: #19a05f;
  --green-soft: #eaf8ef;
  --orange: #f08a28;
  --orange-soft: #fff2e5;
  --red: #f04438;
  --red-soft: #fff0ef;
  --ink: #071426;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --nav-height: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  -webkit-font-smoothing: antialiased;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.app-root {
  min-height: 100vh;
}

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

.brand-mark-button {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 14px;
  background: transparent;
}

.brand-mark-button:hover {
  background: var(--surface-soft);
}

.brand-mark-button:focus-visible {
  outline: 3px solid rgba(63, 99, 230, 0.26);
  outline-offset: 3px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 14px;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: -3px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1fr);
  padding: 32px;
  gap: 0;
}

.auth-preview,
.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: calc(100vh - 64px);
}

.auth-preview {
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 56px 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-panel {
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: min(100%, 420px);
}

.auth-title {
  margin: 0 0 28px;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
}

.overview-title {
  margin: 44px 0 16px;
  font-size: 17px;
  font-weight: 800;
  border-left: 4px solid var(--blue);
  padding-left: 10px;
}

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

.mini-stat,
.preview-row,
.notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.mini-stat {
  padding: 16px;
}

.mini-stat strong {
  display: block;
  font-size: 24px;
  margin-top: 8px;
}

.mini-stat span,
.preview-row span,
.notice {
  color: var(--muted);
  font-size: 13px;
}

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

.preview-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
}

.subject-tag {
  min-width: 38px;
  text-align: center;
  padding: 8px 9px;
  border-radius: 6px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 13px;
  font-weight: 800;
}

.notice {
  padding: 14px 16px;
  background: #f8f6f2;
}

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

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

.field label {
  font-size: 14px;
  font-weight: 750;
}

.control {
  display: flex;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 14px;
  gap: 10px;
}

.control:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(63, 99, 230, 0.14);
}

.control input,
.control select,
.control textarea {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  min-width: 0;
}

.control textarea {
  padding: 14px 0;
  resize: vertical;
  min-height: 92px;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

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

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

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

.choice-item {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.publish-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
}

.publish-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.publish-section-head strong {
  font-size: 16px;
}

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

.radio-grid.compact {
  grid-template-columns: repeat(2, minmax(120px, 180px));
}

.radio-card {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.radio-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.radio-card span {
  display: grid;
  gap: 3px;
}

.radio-card small {
  color: var(--muted);
  line-height: 1.35;
}

.conditional-panel {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.schedule-entry {
  padding: 14px 16px;
}

.schedule-entry-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.publish-section-head.compact {
  justify-content: flex-start;
  margin-bottom: 4px;
}

.schedule-summary {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

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

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

.publish-asset-list {
  display: grid;
  gap: 12px;
}

.publish-asset-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.publish-asset-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.publish-asset-title {
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.publish-asset-preview {
  min-height: 132px;
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  overflow: hidden;
}

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

.weekday-item {
  min-height: 38px;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 750;
}

.assignment-manage-list {
  display: grid;
  gap: 12px;
}

.assignment-manage-entry {
  padding: 16px;
}

.assignment-manage-entry-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.assignment-manage-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
}

.assignment-manage-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.assignment-manage-title {
  font-size: 17px;
  font-weight: 850;
  line-height: 1.35;
}

.assignment-manage-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.assignment-manage-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

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

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.36);
}

.sheet-panel {
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.sheet-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 850;
}

.sheet-close {
  min-width: 82px;
}

.sheet-body {
  overflow: auto;
  padding: 16px 18px 18px;
}

.logo-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 20, 38, 0.68);
}

.logo-preview-panel {
  position: relative;
  display: grid;
  place-items: center;
  padding: 36px;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(7, 20, 38, 0.28);
}

.logo-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
}

.logo-preview-close:hover {
  background: var(--line);
}

.logo-preview-image {
  width: auto;
  height: auto;
  max-width: min(72vw, 420px);
  max-height: min(72vh, 420px);
  object-fit: contain;
  border-radius: 24px;
}

.role-moment {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 90;
  width: min(600px, calc(100vw - 24px));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.role-moment-card {
  position: relative;
  padding: 22px 58px 23px 24px;
  overflow: visible;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
  animation: roleMomentIn 220ms ease-out both, roleMomentBreath 720ms ease-out 260ms both;
  isolation: isolate;
  pointer-events: auto;
}

.role-moment-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--blue);
  z-index: 0;
}

.role-moment-card::after {
  content: "";
  position: absolute;
  inset: -42% -64%;
  z-index: 0;
  background: linear-gradient(115deg, transparent 34%, rgba(255, 246, 184, 0.08) 43%, rgba(255, 206, 82, 0.58) 50%, rgba(255, 248, 202, 0.12) 58%, transparent 68%);
  opacity: 0;
  transform: translateX(-58%) rotate(8deg);
  pointer-events: none;
}

.role-moment-particles {
  position: absolute;
  inset: -48px -56px;
  z-index: 0;
  display: block;
  border-radius: calc(var(--radius) + 24px);
  background:
    radial-gradient(circle at 5% 24%, rgba(255, 232, 134, 1) 0 3px, transparent 5px),
    radial-gradient(circle at 13% 70%, rgba(255, 247, 194, 0.96) 0 2px, transparent 4px),
    radial-gradient(circle at 22% 96%, rgba(255, 211, 76, 0.92) 0 2.5px, transparent 5px),
    radial-gradient(circle at 36% 4%, rgba(255, 238, 156, 0.9) 0 2px, transparent 4px),
    radial-gradient(circle at 58% 112%, rgba(255, 216, 92, 0.9) 0 3px, transparent 5px),
    radial-gradient(circle at 66% 0%, rgba(255, 245, 186, 0.88) 0 2px, transparent 4px),
    radial-gradient(circle at 82% 13%, rgba(255, 220, 96, 1) 0 3px, transparent 5px),
    radial-gradient(circle at 92% 46%, rgba(255, 244, 180, 0.94) 0 2px, transparent 4px),
    radial-gradient(circle at 98% 82%, rgba(255, 214, 78, 0.95) 0 3px, transparent 5px),
    radial-gradient(circle at 45% 52%, rgba(255, 255, 220, 0.32) 0 36%, transparent 62%);
  opacity: 0;
  transform: scale(0.96);
  filter: drop-shadow(0 0 18px rgba(245, 190, 72, 0.82));
  pointer-events: none;
}

.role-moment-kicker {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.role-moment-text {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.45;
}

.role-moment-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.role-moment--student .role-moment-card {
  background: linear-gradient(135deg, #f0fff6 0%, #eff7ff 62%, #fff7d6 100%);
}

.role-moment--student .role-moment-card::before {
  background: #20b875;
}

.role-moment--guardian .role-moment-card {
  background: linear-gradient(135deg, #fffdf7 0%, #eef8ef 58%, #fff2e5 100%);
}

.role-moment--guardian .role-moment-card::before {
  background: #77a878;
}

.role-moment--teacher .role-moment-card,
.role-moment--admin .role-moment-card {
  background: linear-gradient(135deg, #f7fbff 0%, #eef7f4 60%, #fff8df 100%);
}

.role-moment--teacher .role-moment-card::before,
.role-moment--admin .role-moment-card::before {
  background: #4e8fba;
}

.role-moment-card--mist {
  border-color: rgba(230, 181, 66, 0.42);
}

.role-moment-card--mist {
  box-shadow: 0 24px 66px rgba(15, 23, 42, 0.16), 0 0 52px rgba(245, 190, 72, 0.5), 0 0 112px rgba(255, 226, 126, 0.48);
  animation: roleMomentOracleFade 8200ms ease-in-out infinite, roleMomentFloatSoft 4200ms ease-in-out infinite, roleMomentOuterGlow 2800ms ease-in-out infinite;
}

.role-moment-card--mist .role-moment-particles {
  animation: roleMomentParticleGlow 3600ms ease-in-out infinite;
}

.role-moment-card--mist::after {
  opacity: 1;
  animation: roleMomentGoldSweep 6200ms ease-in-out 600ms infinite;
}

@keyframes roleMomentIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes roleMomentBreath {
  0% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(-2px) scale(1.012);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes roleMomentOracleFade {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
    filter: blur(2px);
  }
  12%,
  84% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0.18;
    transform: translateY(-8px) scale(0.992);
    filter: blur(1px);
  }
}

@keyframes roleMomentGoldSweep {
  0% {
    opacity: 0;
    transform: translateX(-58%) rotate(8deg);
  }
  22% {
    opacity: 0.95;
  }
  52% {
    opacity: 0.55;
    transform: translateX(58%) rotate(8deg);
  }
  100% {
    opacity: 0;
    transform: translateX(74%) rotate(8deg);
  }
}

@keyframes roleMomentOuterGlow {
  0%,
  100% {
    box-shadow: 0 22px 58px rgba(15, 23, 42, 0.14), 0 0 42px rgba(245, 190, 72, 0.42), 0 0 92px rgba(255, 226, 126, 0.38);
  }
  50% {
    box-shadow: 0 28px 78px rgba(15, 23, 42, 0.18), 0 0 68px rgba(245, 190, 72, 0.68), 0 0 132px rgba(255, 226, 126, 0.58);
  }
}

@keyframes roleMomentParticleGlow {
  0% {
    opacity: 0.1;
    transform: scale(0.95) rotate(-1deg);
    filter: drop-shadow(0 0 8px rgba(245, 190, 72, 0.42));
  }
  22%,
  72% {
    opacity: 1;
    transform: scale(1.03) rotate(0deg);
    filter: drop-shadow(0 0 20px rgba(245, 190, 72, 0.95));
  }
  100% {
    opacity: 0.32;
    transform: scale(1.08) rotate(1deg);
    filter: drop-shadow(0 0 12px rgba(245, 190, 72, 0.52));
  }
}

@keyframes roleMomentFloatSoft {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.01);
  }
}

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

.primary,
.secondary,
.ghost,
.danger {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(63, 99, 230, 0.24);
}

.primary:hover {
  background: var(--blue-strong);
}

.secondary {
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #b8c6ff;
}

.ghost {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}

.danger {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #ffc7c2;
}

.muted-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.step-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin-bottom: 38px;
}

.step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #d7dbe3;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.step-dot.active {
  background: var(--blue);
}

.step-bar {
  height: 2px;
  background: var(--line);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.role-select {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 700;
}

.side-nav,
.bottom-nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: transparent;
  color: #263247;
  font-weight: 750;
}

.nav-button.active {
  background: var(--ink);
  color: #fff;
}

.sidebar-spacer {
  flex: 1;
}

.main {
  min-width: 0;
  padding-bottom: 34px;
}

.topbar {
  height: 74px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.mobile-brand {
  display: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.identity-badge {
  min-width: 0;
  max-width: 230px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.identity-badge:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.identity-mark {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 850;
}

.identity-mark .icon {
  width: 15px;
  height: 15px;
}

.identity-text {
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
  line-height: 1.1;
}

.identity-role {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.identity-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
}

.identity-badge--student .identity-mark {
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.identity-badge--guardian .identity-mark {
  background: var(--green-soft);
  color: var(--green);
}

.identity-badge--teacher .identity-mark {
  background: var(--orange-soft);
  color: #b85f10;
}

.identity-badge--admin .identity-mark {
  background: var(--red-soft);
  color: var(--red);
}

.content {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 24px 28px;
}

.content.wide {
  width: min(100%, 1380px);
}

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

.page-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.content > .page-head .page-title {
  display: none;
}

.date-pill,
.role-chip,
.status-chip {
  min-height: 30px;
  border-radius: 6px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.date-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.role-chip {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-chip.done,
.status-chip.active {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #b9ebce;
}

.status-chip.pending {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #ffc7c2;
}

.status-chip.late {
  background: var(--orange-soft);
  color: var(--orange);
  border: 1px solid #ffd3a8;
}

.status-chip.neutral {
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

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

.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.summary-card strong {
  font-size: 30px;
  line-height: 1;
}

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

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

.profile-actions .secondary,
.profile-actions .danger {
  min-width: 132px;
}

.progress-panel,
.panel,
.drawer,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.progress-panel {
  min-height: 122px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 22px;
  margin-bottom: 16px;
}

.ring {
  width: 82px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--blue) var(--progress, 0%), #eef1f6 0);
  position: relative;
  font-weight: 800;
  font-size: 24px;
}

.ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--surface);
}

.ring span {
  position: relative;
  z-index: 1;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 16px;
}

.tab {
  min-height: 44px;
  border-radius: 6px;
  background: transparent;
  font-weight: 800;
  color: var(--text);
}

.tab.active {
  color: #fff;
  background: var(--blue);
}

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

.report-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.teacher-date-head {
  align-items: flex-start;
}

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

.date-step {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.teacher-today-button {
  min-height: 42px;
}

.month-control {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.month-control input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-weight: 750;
}

.panel {
  padding: 20px;
  margin-bottom: 16px;
}

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

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 21px;
  font-weight: 850;
}

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

.task-row {
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.task-row.pending {
  border-left-color: var(--red);
}

.task-row.done {
  border-left-color: var(--green);
}

.task-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.task-title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.32;
}

.task-meta,
.muted {
  color: var(--muted);
  font-size: 14px;
}

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

.draft-methods {
  justify-content: flex-start;
}

.draft-submit-actions {
  margin-top: 14px;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  min-height: 128px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 24px;
  background: #fbfcff;
}

.empty.compact {
  min-height: 86px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.detail-description {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.submission-meta {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.submission-files {
  display: grid;
  gap: 14px;
}

.submission-file {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.submission-file-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.submission-preview {
  min-height: 120px;
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.draft-preview {
  min-height: 220px;
}

.submission-image {
  display: block;
  width: 100%;
  max-height: min(58vh, 520px);
  object-fit: contain;
  background: #f8fafc;
}

.submission-audio {
  width: min(100%, 560px);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.teacher-summary-table {
  min-width: 860px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
}

th {
  color: #334155;
  font-weight: 850;
  background: #fbfcff;
}

tr.selected {
  background: #f0f4ff;
}

.drawer {
  padding: 20px;
  position: sticky;
  top: 92px;
}

.drawer-title {
  margin: 0 0 18px;
  font-size: 22px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.copy-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.copy-role-tabs {
  margin-bottom: 16px;
}

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

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.copy-row--disabled {
  opacity: 0.58;
}

.copy-row-main {
  min-width: 0;
}

.copy-row-text {
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.45;
  white-space: normal;
}

.copy-admin-drawer textarea {
  min-height: 112px;
}

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

.result-box {
  border: 1px solid #b8c6ff;
  background: var(--blue-soft);
  color: var(--blue-strong);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.admin-reset-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -8px 0 16px;
}

.admin-reset-result > div {
  display: grid;
  gap: 4px;
}

.admin-reset-result code {
  font-size: 18px;
  font-weight: 850;
  color: #111827;
  letter-spacing: 0;
}

.admin-reset-result small,
.admin-reset-result span {
  color: #4b5563;
}

.admin-reset-result--copied {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.warning-box {
  border: 1px solid #ffc7c2;
  background: var(--red-soft);
  color: #b42318;
  border-radius: var(--radius);
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.reminder-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  min-width: 220px;
  max-width: calc(100vw - 40px);
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bottom-nav {
  display: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .auth-page {
    display: block;
    padding: 0;
    background: var(--surface);
  }

  .auth-preview {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    padding: 34px 20px;
  }

  .auth-title {
    font-size: 24px;
  }

  .shell {
    display: block;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  }

  .sidebar {
    display: none;
  }

  .topbar {
    height: 64px;
    padding: 0 16px;
  }

  .mobile-brand {
    display: flex;
  }

  .topbar .page-title {
    display: none;
  }

  .content,
  .content.wide {
    width: 100%;
    padding: 18px 16px;
  }

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

  .admin-reset-result {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-date-head {
    flex-direction: column;
  }

  .teacher-date-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .teacher-date-control {
    flex: 1 1 178px;
  }

  .teacher-date-control input {
    width: 100%;
  }

  .page-title {
    font-size: 24px;
  }

  .content > .page-head .page-title {
    display: block;
  }

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

  .summary-card {
    min-height: 96px;
    padding: 16px;
  }

  .summary-card strong {
    font-size: 26px;
  }

  .progress-panel {
    grid-template-columns: auto 1fr;
    padding: 18px;
  }

  .progress-panel .date-pill {
    grid-column: 1 / -1;
    width: fit-content;
  }

  .split,
  .admin-layout,
  .copy-admin-layout {
    grid-template-columns: 1fr;
  }

  .drawer {
    position: static;
  }

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

  .filters .primary {
    grid-column: 1 / -1;
  }

  .publish-section-head {
    display: grid;
    gap: 4px;
  }

  .radio-grid,
  .form-grid,
  .publish-choice-list,
  .publish-attachment-actions {
    grid-template-columns: 1fr;
  }

  .radio-grid.compact {
    grid-template-columns: 1fr 1fr;
  }

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

  .assignment-manage-main {
    grid-template-columns: 1fr;
  }

  .publish-asset-main {
    grid-template-columns: 1fr;
  }

  .assignment-manage-entry-main {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-entry-main {
    align-items: stretch;
    flex-direction: column;
  }

  .assignment-manage-actions {
    justify-content: flex-start;
  }

  .sheet-backdrop {
    align-items: end;
    place-items: end stretch;
    padding: 12px;
  }

  .sheet-panel {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  .task-main {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 0;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
    z-index: 10;
  }

  .bottom-nav .nav-button {
    min-height: 52px;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 0 4px;
    font-size: 12px;
  }

  .bottom-nav .nav-button.active {
    color: var(--blue);
    background: transparent;
  }
}

@media (max-width: 1180px) and (min-width: 981px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-layout .drawer {
    position: static;
  }
}

@media (max-width: 520px) {
  .brand-name {
    font-size: 18px;
  }

  .top-actions .ghost span,
  .top-actions .secondary span {
    display: none;
  }

  .identity-badge {
    max-width: 126px;
    min-height: 40px;
    padding: 4px 9px;
  }

  .identity-mark {
    display: none;
  }

  .identity-role {
    font-size: 10px;
  }

  .identity-name {
    font-size: 12px;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .tabs {
    gap: 6px;
    padding: 6px;
  }

  .tab {
    min-height: 40px;
  }

  .panel {
    padding: 16px;
  }

  .task-actions .primary,
  .task-actions .secondary,
  .task-actions .ghost,
  .assignment-manage-actions .primary,
  .assignment-manage-actions .secondary,
  .assignment-manage-actions .ghost,
  .assignment-manage-actions .danger,
  .sheet-actions .primary,
  .sheet-actions .ghost,
  .profile-actions .secondary,
  .profile-actions .danger {
    flex: 1 1 132px;
  }

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

  .radio-grid.compact,
  .weekday-grid {
    grid-template-columns: 1fr 1fr;
  }
}
