:root {
  --brand: #3c9cff;
  --brand-strong: #398ade;
  --brand-disabled: #9acafc;
  --ink: #303133;
  --muted: #606266;
  --secondary: #909399;
  --placeholder: #c0c4cc;
  --line: #e7e6e4;
  --soft: #ecf5ff;
  --page: #f3f4f6;
  --paper: #ffffff;
  --success: #5ac725;
  --warning: #f9ae3d;
  --danger: #f56c6c;
  --info: #909399;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--page);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

button {
  border: 0;
}

a {
  color: inherit;
}

.student-shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: var(--page);
}

.chat-app {
  width: 100%;
  max-width: 680px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.chat-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #fff;
  background: var(--site-color, var(--brand));
}

.topbar-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.topbar-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.topbar-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #3ee18f;
}

.icon-button,
.send-button,
.copy-button,
.small-button,
.primary-button,
.plain-button,
.danger-button {
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
}

button:disabled {
  opacity: 0.62;
  transform: none;
}

[data-busy="true"] input,
[data-busy="true"] textarea,
[data-busy="true"] select {
  opacity: 0.72;
  pointer-events: none;
}

.icon-button:active:not(:disabled),
.send-button:active:not(:disabled),
.copy-button:active:not(:disabled),
.small-button:active:not(:disabled),
.primary-button:active:not(:disabled),
.plain-button:active:not(:disabled),
.danger-button:active:not(:disabled) {
  transform: scale(0.97);
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
}

.welcome {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0 24px;
}

.welcome-avatar {
  width: 128px;
  height: 128px;
  padding: 8px;
  margin: 6px 0 18px;
  border-radius: 20px;
  background: var(--soft);
  box-shadow: 0 8px 18px rgba(48, 49, 51, 0.08);
}

.welcome-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
}

.welcome h1 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.2;
  font-weight: 900;
}

.welcome .subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
}

.welcome .meta {
  margin: 16px 0 0;
  color: var(--secondary);
  font-size: 13px;
}

.knowledge-title {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.profile-points {
  width: min(460px, 100%);
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.profile-points p {
  display: block;
  justify-content: center;
  align-items: baseline;
  gap: 9px;
  margin: 0;
  white-space: nowrap;
}

.profile-points span {
  display: inline-block;
  margin-right: 10px;
  color: var(--brand);
  font-weight: 900;
}

.profile-points a,
.text-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.text-link {
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.welcome-note {
  width: min(460px, 100%);
  margin: 12px 0 0;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.7;
}

.phone-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.phone-line a {
  color: var(--site-color, var(--brand));
  font-weight: 800;
  text-decoration: none;
}

.quick-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.quick-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink);
  background: var(--page);
  text-align: left;
  cursor: pointer;
}

.quick-card:hover {
  background: var(--soft);
}

.quick-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 9px;
  background: #fff;
}

.qr-row {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 22px;
}

.qr-card {
  width: 112px;
  padding: 8px;
  border-radius: 14px;
  background: var(--page);
  cursor: pointer;
}

.qr-card img {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
}

.qr-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.message-row.user {
  justify-content: flex-end;
}

.bubble {
  max-width: 78%;
  padding: 11px 13px;
  border-radius: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.65;
  box-shadow: 0 4px 14px rgba(48, 49, 51, 0.05);
}

.message-row.bot .bubble {
  border-bottom-left-radius: 6px;
  background: var(--soft);
}

.message-row.user .bubble {
  border-bottom-right-radius: 6px;
  color: #fff;
  background: var(--site-color, var(--brand));
}

.bot-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--soft);
  flex-shrink: 0;
}

.bot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related {
  margin: -4px 0 12px 36px;
}

.related-title {
  margin-bottom: 6px;
  color: var(--secondary);
  font-size: 11px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  cursor: pointer;
  font-size: 12px;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--brand-disabled);
  animation: typing 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.12s;
}

.typing span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

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

.loading-text {
  color: var(--secondary);
  font-size: 13px;
}

.type-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  border-radius: 2px;
  background: currentColor;
  vertical-align: -2px;
  animation: cursorBlink 0.85s infinite;
}

@keyframes cursorBlink {
  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

.composer {
  flex-shrink: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.inline-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 8px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.input-row input {
  min-width: 0;
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  outline: none;
  background: var(--soft);
  color: var(--ink);
}

.input-row input:focus {
  border-color: color-mix(in srgb, var(--site-color, var(--brand)) 40%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-color, var(--brand)) 16%, transparent);
}

.send-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--site-color, var(--brand));
  font-size: 18px;
}

.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.notice {
  margin-top: 6px;
  color: var(--secondary);
  text-align: center;
  font-size: 11px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 14, 23, 0.78);
}

.modal-panel {
  position: relative;
  max-width: min(360px, 100%);
  padding: 16px;
  border-radius: 18px;
  background: #fff;
}

.modal-panel img {
  width: 280px;
  max-width: 100%;
  border-radius: 14px;
}

.modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fff;
  background: #1f2937;
  cursor: pointer;
}

.poster-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(10, 14, 23, 0.74);
}

.poster-panel {
  width: min(560px, 100%);
  max-height: calc(100vh - 44px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(10, 14, 23, 0.22);
}

.poster-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.poster-header h3,
.poster-header p {
  margin: 0;
}

.poster-header h3 {
  color: var(--ink);
  font-size: 18px;
}

.poster-header p {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--secondary);
  font-size: 12px;
}

.poster-header .modal-close {
  position: static;
  flex-shrink: 0;
}

.poster-preview {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: var(--page);
  text-align: center;
}

.poster-preview img {
  width: min(360px, 100%);
  height: auto;
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(48, 49, 51, 0.18);
}

.poster-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.brand-line h1 {
  margin: 0;
  font-size: 18px;
}

.brand-line p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.school-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.school-item {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.school-item.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(60, 156, 255, 0.13);
}

.school-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.school-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.side-nav-button {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-weight: 800;
}

.side-nav-button:hover {
  background: var(--soft);
}

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

.content {
  min-width: 0;
  padding: 26px;
}

.workspace-page {
  display: grid;
  gap: 14px;
  max-width: 1040px;
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

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

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 18px;
}

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

.panel-body {
  padding: 18px;
}

.stack {
  display: grid;
  gap: 14px;
}

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

.mini-link-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--page);
}

.mini-link-card span {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 800;
}

.mini-link-card strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-actions a {
  text-align: center;
  text-decoration: none;
}

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

.full {
  grid-column: 1 / -1;
}

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 11px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

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

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(60, 156, 255, 0.12);
}

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

.import-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px dashed var(--placeholder);
  border-radius: 14px;
  background: #fff;
}

.import-box strong {
  display: block;
  font-size: 14px;
}

.import-box p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.import-box.uploading {
  opacity: 0.7;
  pointer-events: none;
}

.upload-field {
  align-self: start;
}

.upload-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 96px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcfe;
}

.upload-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 11px;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.upload-actions {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.upload-hint {
  color: var(--secondary);
  font-size: 12px;
}

.upload-button input {
  display: none;
}

.upload-field.uploading .upload-button {
  opacity: 0.65;
  pointer-events: none;
}

.asset-preview {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  color: var(--secondary);
  background: var(--soft);
  font-size: 12px;
  flex-shrink: 0;
}

.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-button {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.tab-button.active {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.primary-button,
.plain-button,
.danger-button,
.small-button,
.copy-button {
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 11px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--brand);
}

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

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

.small-button {
  min-height: 32px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--soft);
}

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

.link-box {
  display: grid;
  gap: 10px;
}

.link-value {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow-wrap: anywhere;
  color: var(--ink);
  background: var(--soft);
  font-size: 13px;
}

.generated-qr {
  width: 190px;
  max-width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.generated-qr img {
  width: 100%;
  aspect-ratio: 1;
}

.qa-list,
.activity-list {
  display: grid;
  gap: 12px;
}

.qa-card,
.activity-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.activity-card.resolved {
  opacity: 0.64;
}

.qa-card header,
.activity-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.qa-card h4,
.activity-card h4 {
  margin: 0;
  font-size: 14px;
}

.qa-card p,
.activity-card p {
  margin: 6px 0 0;
  color: #465267;
  font-size: 13px;
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  padding: 4px 7px;
  border-radius: 999px;
  color: #4b5563;
  background: var(--soft);
  font-size: 11px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.metric strong {
  display: block;
  font-size: 22px;
}

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

.password-form {
  display: grid;
  gap: 12px;
  max-width: 520px;
}

.success-panel {
  border-color: rgba(90, 199, 37, 0.36);
  background: #f5fff0;
}

.danger-panel {
  border-color: rgba(245, 108, 108, 0.36);
  background: #fef0f0;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(245, 108, 108, 0.36);
  border-radius: 12px;
  background: #fef0f0;
}

.danger-zone strong {
  display: block;
  margin-bottom: 4px;
}

.danger-zone p {
  margin: 0;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.6;
}

.panel-note {
  margin: 0;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.6;
}

.credential-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.credential-row span {
  color: var(--secondary);
  font-size: 12px;
}

.credential-row strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(23, 32, 51, 0.1);
}

.login-panel h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

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

.empty-state {
  padding: 22px;
  border: 1px dashed var(--placeholder);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  background: #fff;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  padding: 12px 14px;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 14px 32px rgba(48, 49, 51, 0.2);
}


/* Admin layout: real sidebar plus dedicated school management table. */
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  background: var(--page);
}

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

.admin-user-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.admin-user-card span {
  overflow: hidden;
  color: var(--secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}

.side-nav-button {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-weight: 800;
}

.side-nav-button:hover {
  background: var(--soft);
}

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

.logout-button {
  width: 100%;
  margin-top: auto;
}

.content {
  min-width: 0;
  padding: 28px clamp(18px, 3vw, 36px);
}

.workspace-page {
  display: grid;
  gap: 16px;
  max-width: 1160px;
  margin: 0 auto;
}

.workspace-page.wide {
  max-width: 1280px;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.module-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
}

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

.admin-metrics {
  margin-bottom: 0;
}

.school-table-wrap {
  max-height: min(560px, calc(100vh - 330px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.school-table {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.school-table th,
.school-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.school-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--secondary);
  background: #fbfcfe;
  font-size: 12px;
  font-weight: 900;
}

.school-table tbody tr:last-child td {
  border-bottom: 0;
}

.school-table tbody tr.selected td {
  background: #f0f7ff;
}

.school-table td strong,
.school-table td span {
  display: block;
}

.school-table td strong {
  max-width: 220px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-table td span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.school-table code {
  padding: 4px 7px;
  border-radius: 7px;
  color: #2567a8;
  background: #eef6ff;
  font-family: inherit;
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.on {
  color: #2f7d1b;
  background: #eefbe8;
}

.status-pill.off {
  color: #9a3412;
  background: #fff3e8;
}

.status-pill.warn {
  color: #9a5b0a;
  background: #fff7e8;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 300px;
}

.table-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.mini-school-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.school-picker-button {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.school-picker-button.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(60, 156, 255, 0.13);
}

.school-picker-button strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-picker-button span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 640px) {
  .chat-topbar {
    gap: 9px;
    padding: 9px 12px;
  }

  .topbar-icon,
  .icon-button {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .topbar-title {
    font-size: 15px;
  }

  .topbar-status {
    font-size: 11px;
  }

  .chat-scroll {
    padding: 12px 16px 8px;
  }

  .welcome {
    min-height: auto;
    padding: 2px 0 10px;
  }

  .welcome-avatar {
    width: 72px;
    height: 72px;
    padding: 4px;
    margin: 0 0 8px;
    border-radius: 16px;
    box-shadow: none;
  }

  .welcome-avatar img {
    border-radius: 12px;
  }

  .welcome h1 {
    font-size: 24px;
  }

  .welcome .subtitle {
    margin-top: 6px;
    font-size: 13px;
  }

  .knowledge-title,
  .profile-points {
    font-size: 12px;
  }

  .knowledge-title {
    margin-top: 2px;
    line-height: 1.3;
  }

  .profile-points {
    margin-top: 5px;
    line-height: 1.55;
  }

  .profile-points span {
    margin-right: 6px;
  }

  .welcome .meta {
    margin-top: 8px;
    font-size: 11px;
  }

  .quick-grid {
    gap: 8px;
    margin-top: 12px;
  }

  .quick-card {
    min-height: 38px;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .quick-card strong {
    font-size: 12px;
    line-height: 1.2;
  }

  .quick-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    font-size: 14px;
  }

  .content {
    padding: 14px;
  }

  .form-grid,
  .metric-row,
  .access-grid {
    grid-template-columns: 1fr;
  }

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

  .qr-row {
    margin-top: 12px;
    gap: 12px;
  }

  .qr-card {
    width: 88px;
    padding: 6px;
    border-radius: 10px;
  }

  .qr-card img {
    width: 76px;
    height: 76px;
  }

  .qr-card span {
    margin-top: 4px;
    font-size: 10px;
  }

  .composer {
    padding: 7px 12px 9px;
  }

  .inline-chips {
    gap: 6px;
    padding-bottom: 6px;
  }

  .chip {
    padding: 6px 8px;
    font-size: 11px;
  }

  .input-row {
    gap: 7px;
  }

  .input-row input {
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
  }

  .send-button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .notice {
    margin-top: 4px;
    font-size: 10px;
  }

}

@media (max-width: 640px) and (max-height: 720px) {
  .welcome-avatar {
    width: 60px;
    height: 60px;
    margin-bottom: 6px;
  }

  .welcome h1 {
    font-size: 22px;
  }

  .welcome .subtitle {
    margin-top: 4px;
  }

  .quick-grid {
    margin-top: 10px;
  }

  .qr-card {
    width: 78px;
  }

  .qr-card img {
    width: 66px;
    height: 66px;
  }
}

@media (max-width: 980px) {
  .admin-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
    gap: 12px;
    padding: 14px;
  }

  .admin-user-card {
    display: none;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 0;
    border-top: 0;
  }

  .side-nav-button {
    text-align: center;
  }

  .logout-button {
    margin-top: 0;
  }

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

  .school-table-wrap {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-actions {
    min-width: 260px;
  }

  .school-table {
    min-width: 820px;
  }
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-metric {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 6px;
}

.dashboard-metric span {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-metric strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.1;
}

.dashboard-metric em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.daily-bars {
  display: grid;
  gap: 10px;
}

.daily-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
}

.daily-row span,
.daily-row strong {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 900;
}

.daily-row strong {
  color: var(--ink);
  text-align: right;
}

.daily-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.daily-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #5ac725);
}

.dashboard-list {
  display: grid;
  gap: 9px;
}

.dashboard-school-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.dashboard-school-row:hover {
  border-color: var(--brand);
  background: #f6fbff;
}

.dashboard-school-row span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.dashboard-school-row strong,
.dashboard-school-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-school-row strong {
  color: var(--ink);
  font-size: 14px;
}

.dashboard-school-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.dashboard-school-row b {
  flex-shrink: 0;
  color: var(--brand);
  font-size: 18px;
}

.update-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.update-alert,
.update-result {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid rgba(249, 174, 61, 0.36);
  border-radius: 12px;
  color: #7c4a09;
  background: #fff9ed;
  font-size: 13px;
  line-height: 1.6;
}

.update-result {
  border-color: rgba(90, 199, 37, 0.34);
  color: #2f7d1b;
  background: #f5fff0;
}

.update-result strong {
  color: var(--ink);
}

.update-result span,
.update-result p {
  margin: 0;
  color: var(--muted);
}

.update-alert strong,
.update-alert span {
  display: block;
}

.update-hero {
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #5a63f6);
  box-shadow: 0 18px 42px rgba(60, 156, 255, 0.16);
}

.update-hero h3,
.update-hero p {
  margin: 0;
}

.update-hero h3 {
  margin-top: 12px;
  font-size: 26px;
}

.update-hero p {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.update-hero .status-pill {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.update-hero .primary-button {
  min-width: 116px;
  color: var(--brand);
  background: #fff;
}

.update-progress-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.update-progress-panel.success {
  border-color: rgba(90, 199, 37, 0.34);
  background: #f5fff0;
}

.update-progress-panel.failed {
  border-color: rgba(245, 108, 108, 0.36);
  background: #fef0f0;
}

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

.update-progress-head strong,
.update-progress-head span {
  display: block;
}

.update-progress-head strong {
  color: var(--ink);
  font-size: 15px;
}

.update-progress-head span,
.update-progress-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.update-progress-head b {
  color: var(--brand);
  font-size: 22px;
}

.update-progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.update-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #5ac725);
  transition: width 0.25s ease;
}

.update-progress-panel.failed .update-progress-bar i {
  background: var(--danger);
}

.update-error-text {
  color: var(--danger) !important;
}

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

.update-card {
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.update-card span {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 900;
}

.update-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-card em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.changelog-box {
  max-height: 560px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #3f4a5f;
  background: #fbfcfe;
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.7 "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.version-list {
  display: grid;
  gap: 9px;
}

.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.version-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.version-row strong,
.version-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-row strong {
  color: var(--ink);
  font-size: 14px;
}

.version-row em {
  color: var(--secondary);
  font-size: 12px;
  font-style: normal;
}

@media (max-width: 980px) {
  .dashboard-grid,
  .dashboard-columns,
  .update-card-grid,
  .update-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .dashboard-metric {
    min-height: 96px;
  }

  .dashboard-metric strong {
    font-size: 24px;
  }
}

/* Admin UI polish: unified desktop shell and mobile management experience. */
:root {
  --line: #dfe7f0;
  --soft: #edf6ff;
  --page: #f5f7fb;
}

.admin-shell {
  grid-template-columns: 244px minmax(0, 1fr);
  background: var(--page);
}

.admin-shell .sidebar {
  gap: 16px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: 8px 0 28px rgba(48, 49, 51, 0.04);
}

.admin-shell .brand-line {
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-shell .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 10px 22px rgba(60, 156, 255, 0.24);
}

.admin-shell .brand-line h1 {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.admin-shell .brand-line p {
  color: var(--secondary);
}

.admin-user-card {
  border-radius: 8px;
  background: #f6faff;
}

.admin-shell .side-nav {
  gap: 7px;
  margin: 0;
  padding: 0;
  border-top: 0;
}

.admin-shell .side-nav-button {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #526173;
  background: transparent;
  font-size: 14px;
}

.admin-shell .side-nav-button:hover {
  border-color: #d6e7fb;
  color: var(--brand-strong);
  background: #f2f8ff;
}

.admin-shell .side-nav-button.active {
  border-color: var(--brand);
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 10px 20px rgba(60, 156, 255, 0.22);
}

.admin-shell .logout-button {
  border-color: #dbe7f3;
  color: #526173;
  background: #fff;
}

.admin-shell .logout-button:hover {
  border-color: rgba(245, 108, 108, 0.34);
  color: var(--danger);
  background: #fff7f7;
}

.admin-shell .content {
  min-width: 0;
  padding: 28px clamp(18px, 3vw, 36px);
}

.admin-shell .workspace-page {
  min-width: 0;
  gap: 16px;
}

.admin-shell .module-header {
  min-height: 42px;
}

.admin-shell .module-header h2 {
  font-size: 22px;
  line-height: 1.25;
}

.admin-shell .module-header p {
  color: var(--secondary);
}

.admin-shell .panel,
.admin-shell .metric,
.admin-shell .dashboard-metric,
.admin-shell .mini-link-card,
.admin-shell .school-picker-button,
.admin-shell .credential-row,
.admin-shell .qa-card,
.admin-shell .activity-card,
.admin-shell .import-box,
.admin-shell .upload-card,
.admin-shell .danger-zone,
.admin-shell .update-progress-panel,
.admin-shell .update-card,
.admin-shell .version-row,
.admin-shell .changelog-box,
.admin-shell .school-table-wrap {
  min-width: 0;
  border-radius: 8px;
  border-color: var(--line);
  box-shadow: 0 10px 24px rgba(48, 49, 51, 0.045);
}

.admin-shell .panel,
.admin-shell .panel-body {
  min-width: 0;
}

.admin-shell .panel,
.admin-shell .metric,
.admin-shell .dashboard-metric,
.admin-shell .mini-link-card,
.admin-shell .qa-card,
.admin-shell .activity-card,
.admin-shell .update-card,
.admin-shell .version-row,
.admin-shell .school-picker-button {
  background: #fff;
}

.admin-shell .panel-header {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.admin-shell .panel-header h2,
.admin-shell .panel-header h3 {
  color: var(--ink);
}

.admin-shell .panel-body {
  padding: 16px;
}

.admin-shell .primary-button,
.admin-shell .plain-button,
.admin-shell .danger-button,
.admin-shell .small-button,
.admin-shell .copy-button,
.admin-shell .upload-button,
.admin-shell .tab-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: none;
  line-height: 1.2;
}

.admin-shell .primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}

.admin-shell .plain-button {
  border: 1px solid var(--line);
  color: #445166;
  background: #fff;
}

.admin-shell .plain-button:hover {
  border-color: #c9def6;
  color: var(--brand-strong);
  background: #f7fbff;
}

.admin-shell .small-button {
  border: 1px solid #cfe3fb;
  color: #2567a8;
  background: #f4f9ff;
}

.admin-shell .copy-button {
  color: #fff;
  background: var(--brand-strong);
}

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

.admin-shell .upload-button {
  background: var(--brand-strong);
}

.admin-shell .field input,
.admin-shell .field textarea,
.admin-shell .field select {
  border-radius: 8px;
  border-color: var(--line);
  background: #fbfdff;
}

.admin-shell .field input:focus,
.admin-shell .field textarea:focus,
.admin-shell .field select:focus {
  border-color: var(--brand);
  background: #fff;
}

.admin-shell .field input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

.admin-shell .metric,
.admin-shell .dashboard-metric,
.admin-shell .update-card {
  min-height: 108px;
}

.admin-shell .metric strong,
.admin-shell .dashboard-metric strong,
.admin-shell .update-card strong {
  color: #1f2d3d;
}

.admin-shell .metric span,
.admin-shell .dashboard-metric span,
.admin-shell .update-card span {
  color: #7c899b;
}

.admin-shell .daily-row div,
.admin-shell .update-progress-bar {
  background: #eaf3ff;
}

.admin-shell .daily-row i,
.admin-shell .update-progress-bar i {
  background: linear-gradient(90deg, var(--brand), var(--brand-disabled));
}

.admin-shell .school-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: #fff;
}

.admin-shell .school-table th {
  color: #7c899b;
  background: #f7fbff;
}

.admin-shell .school-table td {
  border-bottom-color: var(--line);
}

.admin-shell .school-table tbody tr:hover td {
  background: #f8fbff;
}

.admin-shell .school-table tbody tr.selected td {
  background: #edf6ff;
}

.admin-shell .school-table code {
  color: #2567a8;
  background: #edf6ff;
}

.admin-shell .status-pill {
  width: max-content;
  display: inline-flex;
  border-radius: 999px;
}

.admin-shell .status-pill.on {
  color: #2f7d1b;
  background: #effbe9;
}

.admin-shell .status-pill.off {
  color: #b42318;
  background: #fff0f0;
}

.admin-shell .status-pill.warn {
  color: #a15c00;
  background: #fff6e8;
}

.admin-shell .tag {
  color: #526173;
  background: #eef4fb;
}

.admin-shell .danger-zone {
  background: #fff7f7;
}

.admin-shell .success-panel {
  border-color: rgba(90, 199, 37, 0.28);
  background: #f7fff2;
}

.admin-shell .update-hero {
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 16px 34px rgba(60, 156, 255, 0.22);
}

.admin-shell .update-alert {
  border-color: rgba(249, 174, 61, 0.3);
  border-radius: 8px;
  background: #fff8ec;
}

.admin-shell .update-result {
  border-color: rgba(90, 199, 37, 0.28);
  border-radius: 8px;
  background: #f6fff2;
}

.admin-shell .changelog-box {
  background: #fbfdff;
}

.login-panel {
  border-radius: 8px;
  box-shadow: 0 20px 46px rgba(48, 49, 51, 0.1);
}

@media (max-width: 980px) {
  .admin-shell {
    display: block;
    min-height: 100vh;
  }

  .admin-shell .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    min-height: 0;
    gap: 10px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 22px rgba(48, 49, 51, 0.07);
  }

  .admin-shell .brand-line {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .admin-shell .brand-mark {
    width: 34px;
    height: 34px;
  }

  .admin-shell .brand-line h1 {
    font-size: 16px;
  }

  .admin-shell .brand-line p {
    font-size: 11px;
  }

  .admin-shell .admin-user-card {
    display: none;
  }

  .admin-shell .side-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 0 2px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .admin-shell .side-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-shell .side-nav-button {
    width: auto;
    min-width: max-content;
    min-height: 34px;
    flex: 0 0 auto;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    text-align: center;
    font-size: 13px;
  }

  .admin-shell .side-nav-button.active {
    border-color: var(--brand);
  }

  .admin-shell .logout-button {
    width: auto;
    min-height: 34px;
    align-self: flex-start;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
  }

  .admin-shell .content {
    padding: 14px 12px 28px;
  }

  .admin-shell .workspace-page,
  .admin-shell .workspace-page.wide {
    max-width: none;
    gap: 12px;
  }

  .admin-shell .module-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .admin-shell .module-header h2 {
    font-size: 20px;
  }

  .admin-shell .module-header p {
    font-size: 12px;
  }

  .admin-shell .dashboard-grid,
  .admin-shell .update-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .admin-shell .dashboard-columns,
  .admin-shell .update-layout,
  .admin-shell .content-grid,
  .admin-shell .form-grid,
  .admin-shell .access-grid {
    grid-template-columns: 1fr;
  }

  .admin-shell .metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-shell .metric,
  .admin-shell .dashboard-metric,
  .admin-shell .update-card {
    min-height: 92px;
    padding: 12px;
  }

  .admin-shell .metric strong,
  .admin-shell .dashboard-metric strong,
  .admin-shell .update-card strong {
    font-size: 24px;
  }

  .admin-shell .panel-header {
    padding: 13px 14px;
  }

  .admin-shell .panel-body {
    padding: 14px;
  }

  .admin-shell .school-table-wrap {
    max-height: none;
    max-width: 100%;
    overflow: auto;
  }

  .admin-shell .mini-school-picker {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .admin-shell .update-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .admin-shell .update-hero h3 {
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  .admin-shell .content {
    padding: 12px 10px 24px;
  }

  .admin-shell .dashboard-grid,
  .admin-shell .update-card-grid,
  .admin-shell .mini-school-picker {
    grid-template-columns: 1fr;
  }

  .admin-shell .metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-shell .metric {
    min-height: 74px;
    padding: 9px;
  }

  .admin-shell .metric strong {
    font-size: 19px;
  }

  .admin-shell .metric span {
    font-size: 11px;
    line-height: 1.25;
  }

  .admin-shell .dashboard-metric,
  .admin-shell .update-card {
    min-height: 88px;
  }

  .admin-shell .school-table {
    min-width: 0;
    border-collapse: separate;
    background: transparent;
  }

  .admin-shell .school-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .admin-shell .school-table thead {
    display: none;
  }

  .admin-shell .school-table tbody {
    display: grid;
    gap: 10px;
  }

  .admin-shell .school-table tbody tr {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .admin-shell .school-table tbody tr.selected {
    border-color: #c9def6;
    background: #edf6ff;
  }

  .admin-shell .school-table th,
  .admin-shell .school-table td {
    display: block;
    padding: 0;
    border: 0;
    background: transparent !important;
  }

  .admin-shell .school-table td::before {
    display: block;
    margin-bottom: 4px;
    color: #7c899b;
    font-size: 11px;
    font-weight: 900;
  }

  .admin-shell .school-table td:nth-child(1)::before {
    content: "学校";
  }

  .admin-shell .school-table td:nth-child(2)::before {
    content: "分站标识";
  }

  .admin-shell .school-table td:nth-child(3)::before {
    content: "状态";
  }

  .admin-shell .school-table td:nth-child(4)::before {
    content: "数据";
  }

  .admin-shell .school-table td:nth-child(5)::before {
    content: "操作";
  }

  .admin-shell .school-table td strong {
    max-width: none;
    white-space: normal;
  }

  .admin-shell .table-actions {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-shell .table-actions > * {
    width: 100%;
    min-height: 34px;
    padding: 7px 8px;
  }

  .admin-shell .field.full .primary-button,
  .admin-shell .password-form .primary-button,
  .admin-shell .update-actions > button,
  .admin-shell .form-actions > button,
  .admin-shell .link-box > .copy-button {
    width: 100%;
  }

  .admin-shell .mini-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-shell .mini-actions > * {
    width: 100%;
  }

  .admin-shell .upload-card {
    align-items: flex-start;
  }

  .admin-shell .changelog-box {
    max-height: 320px;
    padding: 12px;
    font-size: 12px;
  }
}
