:root {
  color-scheme: light;
  --blue: #1677ff;
  --blue-hover: #4096ff;
  --blue-soft: #e6f4ff;
  --text: #1f1f1f;
  --text-secondary: #595959;
  --text-muted: #8c8c8c;
  --line: #f0f0f0;
  --line-strong: #d9d9d9;
  --canvas: #f5f5f5;
  --surface: #ffffff;
  --success: #52c41a;
  --warning: #fa8c16;
  --danger: #ff4d4f;
  --purple: #722ed1;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
  color: var(--text);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 1180px;
  min-height: 100%;
  margin: 0;
}

body {
  font-size: 14px;
  background: var(--canvas);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

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

.topbar {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto 0;
  height: 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

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

.brand strong {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-block;
  overflow: hidden;
  border-radius: 2px;
  background: linear-gradient(135deg, #3535f3, #137cff);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark i::before,
.brand-mark i::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border: 2px solid #fff;
  border-radius: 50%;
}

.brand-mark::before { left: 7px; top: 7px; }
.brand-mark::after { right: 6px; bottom: 6px; }
.brand-mark i::before { right: 6px; top: 6px; }
.brand-mark i::after { left: 6px; bottom: 6px; }
.brand-mark b,
.brand-mark b::after {
  position: absolute;
  content: "";
  left: 8px;
  top: 15px;
  width: 17px;
  height: 2px;
  background: #fff;
  transform: rotate(43deg);
  transform-origin: center;
}
.brand-mark b::after { left: 0; top: 0; transform: rotate(94deg); }

.operator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.operator-icon {
  position: relative;
  width: 15px;
  height: 15px;
  border: 1.5px solid #a6a6a6;
  border-radius: 50%;
}

.operator-icon::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 8px;
  left: -2.5px;
  top: 10px;
  border: 1.5px solid #a6a6a6;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #fff;
}

.sidebar {
  position: fixed;
  z-index: 10;
  inset: 59px auto 0 0;
  width: 274px;
  padding: 12px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.sidebar nav {
  display: grid;
  gap: 3px;
}

.nav-item {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border: 0;
  border-radius: 6px;
  color: #5f6368;
  background: transparent;
  text-align: left;
  cursor: default;
}

.nav-item.active {
  color: #303030;
  background: #f2f2f2;
  font-weight: 500;
}

.nav-icon {
  position: relative;
  width: 15px;
  height: 15px;
  display: inline-block;
  flex: 0 0 15px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  opacity: 0.85;
}

.nav-icon.chart::after,
.nav-icon.list::after,
.nav-icon.config::after,
.nav-icon.gear::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
}

.nav-icon.book { border-radius: 1px 4px 4px 1px; }
.nav-icon.tag { transform: rotate(45deg); border-radius: 3px 1px 3px 1px; }
.nav-icon.chat { border-radius: 7px; }
.nav-icon.announce { transform: skewY(-8deg); }
.nav-icon.branch { border-width: 0 0 1.5px 1.5px; border-radius: 0; }

.sidebar-collapse {
  position: absolute;
  right: -14px;
  top: 20px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #b2b2b2;
  background: #fff;
  font-size: 21px;
  line-height: 22px;
}

.sidebar-pattern {
  position: absolute;
  inset: auto auto 0 0;
  width: 160px;
  height: 150px;
  opacity: 0.35;
  background-image:
    linear-gradient(30deg, #cde5ff 12%, transparent 12.5%, transparent 87%, #cde5ff 87.5%, #cde5ff),
    linear-gradient(150deg, #cde5ff 12%, transparent 12.5%, transparent 87%, #cde5ff 87.5%, #cde5ff);
  background-size: 36px 62px;
}

.workspace {
  min-height: 100vh;
  margin-left: 274px;
  padding: 81px 26px 32px;
}

.page-card {
  min-height: calc(100vh - 113px);
  padding: 0 26px 36px;
  background: #fff;
  border-radius: 8px 8px 0 0;
}

.management-page {
  padding: 0;
  background: transparent;
}

.management-view-tabs {
  height: 50px;
  display: flex;
  align-items: flex-end;
  gap: 32px;
  padding: 0 4px;
}

.management-view-tabs[hidden] { display: none; }

.management-view-tab {
  position: relative;
  height: 44px;
  padding: 0 2px;
  border: 0;
  color: #737373;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.16s;
}

.management-view-tab:hover { color: var(--blue); }
.management-view-tab.active { color: #262626; font-weight: 600; }
.management-view-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 24px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
  transform: translateX(-50%);
}

.page-content.detail-page {
  padding: 0 26px 36px;
  border-radius: 8px 8px 0 0;
  background: #fff;
}

.detail-header {
  position: relative;
  height: 78px;
  display: flex;
  align-items: center;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
}

.back-button span { font-size: 18px; }

.room-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: baseline;
  gap: 9px;
  white-space: nowrap;
}

.room-title h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.room-type {
  padding: 2px 7px;
  border-radius: 3px;
  color: #7c3aed;
  background: #f5efff;
  font-size: 12px;
}

.room-id { color: var(--text-muted); font-size: 13px; }

.tabs {
  height: 42px;
  display: flex;
  align-items: stretch;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  padding: 0 0 11px;
  border: 0;
  color: #4f4f4f;
  background: transparent;
  cursor: pointer;
}

.tab.active {
  color: var(--blue);
  font-weight: 500;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--blue);
}

.page-content { min-height: 560px; }

.filter-card,
.room-filter-card,
.list-card {
  border-radius: 8px;
  background: #fff;
}

.filter-card { margin-top: 16px; padding: 22px 26px; }
.list-card { margin-top: 16px; padding: 0 26px 20px; }

.list-card-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.list-card-header h2 { margin: 0; font-size: 17px; font-weight: 600; }
.list-actions { display: flex; align-items: center; gap: 12px; }

.table-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.table-tool-button {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  color: #454545;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.table-tool-button:hover { color: var(--blue); background: #f5f5f5; }
.table-tool-button.active { color: var(--blue); }
.table-tool-button.active::before {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 0;
  left: 5px;
  height: 2px;
  background: var(--blue);
}

.table-tool-button::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 40;
  right: 50%;
  bottom: calc(100% + 10px);
  padding: 7px 10px;
  border-radius: 6px;
  color: #fff;
  background: rgb(0 0 0 / 84%);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(50%) translateY(3px);
  transition: opacity 0.15s, transform 0.15s;
}

.table-tool-button:hover::after { opacity: 1; transform: translateX(50%) translateY(0); }
.gear-symbol { font-size: 20px; }

.refresh-tool.spinning span { animation: refresh-spin 0.32s linear; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }

.table-tool-popover {
  position: absolute;
  z-index: 35;
  top: 38px;
  right: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
}

.density-popover { width: 142px; }
.density-option {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: #333;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.density-option:hover { background: #f5f5f5; }
.density-option.selected { color: var(--blue); background: var(--blue-soft); }

.column-popover { width: 272px; padding: 12px 14px 14px; }
.column-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--line);
}
.column-popover-header label { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.column-popover-header button {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
}
.column-popover input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.column-option-list { max-height: 360px; overflow-y: auto; padding-top: 6px; }
.column-option {
  min-height: 40px;
  display: grid;
  grid-template-columns: 24px 18px 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  border-radius: 6px;
  cursor: pointer;
}
.column-option:hover { background: #fafafa; }
.drag-handle { color: #c8c8c8; font-size: 18px; letter-spacing: -3px; }

.student-layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.class-panel {
  min-height: 620px;
  padding: 0 12px 20px;
  border-right: 1px solid var(--line);
}

.create-class-button,
.class-item {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
}

.create-class-button {
  margin-bottom: 12px;
  border: 1px dashed var(--line-strong);
  color: #303030;
  text-align: center;
}

.create-class-button span { margin-right: 6px; font-size: 20px; vertical-align: -1px; }

.class-item {
  margin-bottom: 5px;
  padding: 0 15px;
  cursor: default;
}

.class-item.active {
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 500;
}

.student-main { min-width: 0; }

.student-heading {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 14px;
}

.student-heading h2 { margin: 0; font-size: 17px; }
.student-heading span { color: var(--text-muted); font-size: 13px; }
.student-heading strong { color: var(--text); font-weight: 500; }

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

.summary-card {
  min-height: 78px;
  display: grid;
  place-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-muted);
  background: #fafafa;
  text-align: center;
}

.summary-card strong { font-size: 24px; font-weight: 600; line-height: 1; }
.summary-card span { font-size: 13px; }
.summary-card.pending strong { color: #8c8c8c; }
.summary-card.trial { border-color: #ffd591; background: #fffaf0; }
.summary-card.trial strong { color: var(--warning); }
.summary-card.paid { border-color: #b7eb8f; background: #f8fff2; }
.summary-card.paid strong { color: var(--success); }
.summary-card.unpaid { border-color: #ffccc7; background: #fff7f6; }
.summary-card.unpaid strong { color: var(--danger); }

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

.parent-toolbar { margin: 0; }
.student-toolbar { margin-bottom: 12px; }
.teacher-toolbar { margin: 34px 16px 16px; }

.room-filter-card { margin-top: 16px; padding: 24px 26px 26px; }

.room-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 22px 26px;
}

.room-filter-grid label { display: grid; gap: 9px; }
.room-filter-grid label > span { color: #333; font-size: 13px; }
.room-filter-grid .control { width: 100%; }
.plain-input { padding: 0 12px; }

.room-filter-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 14px;
}

.collapse-link {
  height: 36px;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
}

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-filter,
.status-filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.filter-label {
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.status-filter select.control { min-width: 112px; }

.inline-filter input.filter-input {
  width: 190px;
  padding: 0 12px;
}

.search-box {
  position: relative;
  width: 350px;
}

.student-search { width: 214px; }
.narrow-search { width: 172px; }

.search-box::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 12px;
  top: 10px;
  width: 11px;
  height: 11px;
  border: 1.5px solid #bfbfbf;
  border-radius: 50%;
}

.search-box::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 22px;
  top: 21px;
  width: 6px;
  height: 1.5px;
  background: #bfbfbf;
  transform: rotate(45deg);
}

.control {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

input.control {
  width: 100%;
  padding: 0 34px 0 34px;
}

select.control {
  min-width: 132px;
  padding: 0 34px 0 12px;
}

.control:hover { border-color: var(--blue-hover); }
.control:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgb(22 119 255 / 10%); }
.control::placeholder { color: #bfbfbf; }

.search-clear {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 22px;
  height: 22px;
  display: none;
  border: 0;
  color: #bfbfbf;
  background: transparent;
  cursor: pointer;
}

.search-box.has-value .search-clear { display: block; }

.primary-button,
.secondary-button {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: #333;
  background: #fff;
}

.primary-button:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.secondary-button:hover { color: var(--blue); border-color: var(--blue); }
.download-icon { font-size: 17px; line-height: 1; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.data-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.data-table th {
  height: 48px;
  padding: 0 14px;
  color: #333;
  background: #fafafa;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  min-height: 64px;
  padding: 14px;
  border-top: 1px solid var(--line);
  color: #3f3f3f;
  line-height: 1.45;
  vertical-align: middle;
  word-break: break-word;
}

.data-table[data-density="loose"] th { height: 56px; }
.data-table[data-density="loose"] td { padding-top: 18px; padding-bottom: 18px; }
.data-table[data-density="middle"] th { height: 48px; }
.data-table[data-density="middle"] td { padding-top: 14px; padding-bottom: 14px; }
.data-table[data-density="compact"] th { height: 40px; }
.data-table[data-density="compact"] td { padding-top: 9px; padding-bottom: 9px; }

.data-table tbody tr:first-child td { border-top: 0; }
.data-table tbody tr:hover td { background: #fafcff; }

.cell-primary { color: #262626; font-weight: 500; }
.cell-secondary { display: block; margin-top: 3px; color: var(--text-muted); font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }

.status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 8px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}

.status-tag.success { color: #389e0d; border-color: #b7eb8f; background: #f6ffed; }
.status-tag.warning { color: #d46b08; border-color: #ffd591; background: #fff7e6; }
.status-tag.danger { color: #cf1322; border-color: #ffa39e; background: #fff1f0; }
.status-tag.neutral { color: #595959; border-color: #d9d9d9; background: #fafafa; }
.status-tag.purple { color: #531dab; border-color: #d3adf7; background: #f9f0ff; }

.linked-students {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
  color: #262626;
  line-height: 1.7;
}

.empty-value { color: var(--text-muted); }

.room-list-type {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 12px;
  white-space: nowrap;
}
.room-list-type.online { color: #1677ff; background: #e6f4ff; }
.room-list-type.offline { color: #7c3aed; background: #f5efff; }

.compact-parent-table { min-width: 1000px; }
.room-table { min-width: 1320px; }
.student-table { min-width: 1420px; }
.teacher-table { min-width: 1150px; }
.wrap-code { overflow-wrap: anywhere; }
.subject-cell { color: #4d4d4d; line-height: 1.65; }

.row-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.link-button {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.link-button:hover { color: var(--blue-hover); }
.danger-link { color: var(--danger); }
.danger-link:hover { color: #ff7875; }

.empty-state {
  min-height: 300px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  text-align: center;
}

.empty-state span {
  display: block;
  width: 54px;
  height: 42px;
  margin: 0 auto 12px;
  border: 2px solid #d9d9d9;
  border-radius: 6px;
  background: #fafafa;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.page-button {
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
  background: #fff;
}

.drawer-mask {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgb(0 0 0 / 32%);
  opacity: 0;
  transition: opacity 0.22s;
}

.drawer-mask.visible { opacity: 1; }

.drawer {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  width: min(720px, calc(100vw - 32px));
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -10px 0 30px rgb(0 0 0 / 12%);
  transform: translateX(102%);
  transition: transform 0.24s ease;
}

.drawer.open { transform: translateX(0); }

.drawer-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 { margin: 0; font-size: 18px; }

.icon-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 5px;
  color: var(--text-muted);
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.icon-button:hover { background: #f5f5f5; }

.drawer-content {
  overflow-y: auto;
  padding: 22px 24px 36px;
}

.drawer-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.drawer-title-row h3 { margin: 0; font-size: 20px; }

.detail-section { margin-top: 26px; }
.detail-section:first-child { margin-top: 0; }
.detail-section h4 {
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 3px solid var(--blue);
  font-size: 14px;
  font-weight: 600;
}

.description-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
  overflow: hidden;
}

.description-item {
  min-height: 62px;
  padding: 10px 13px;
  background: #fff;
}

.description-item.full-width { grid-column: 1 / -1; }
.description-item label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 12px; }
.description-item div { color: #333; overflow-wrap: anywhere; }
.description-item .login-phone { color: #262626; font-size: 16px; font-weight: 600; }

.relation-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.relation-card + .relation-card { margin-top: 10px; }

.relation-card-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}

.student-title,
.student-relation-value {
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-title span,
.student-relation-value span,
.relation-detail label {
  color: var(--text-muted);
  font-size: 12px;
}

.student-title strong { color: #262626; font-size: 14px; font-weight: 600; }
.student-relation-value strong { min-width: 36px; color: #333; font-size: 13px; font-weight: 500; }

.relation-card-details {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(250px, 0.95fr);
}

.relation-detail { min-width: 0; }
.relation-detail label { display: block; margin-bottom: 6px; }
.relation-detail strong { display: block; overflow-wrap: anywhere; color: #333; font-size: 13px; font-weight: 500; }

.student-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(110px, 0.65fr);
  gap: 16px 28px;
  padding: 14px;
}

.room-relation-detail {
  min-width: 0;
  padding: 14px;
  border-left: 1px solid var(--line);
}

.relation-room-heading { display: flex; align-items: flex-start; gap: 7px; min-width: 0; }
.relation-room-heading strong { flex: 1; min-width: 0; }
.relation-room-id { display: block; margin-top: 4px; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }

.relation-empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--text-muted);
  background: #fafafa;
}

@media (max-width: 1440px) {
  .sidebar { width: 220px; }
  .workspace { margin-left: 220px; }
  .search-box { width: 300px; }
  .student-search { width: 200px; }
  .narrow-search { width: 160px; }
  .student-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .room-filter-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
}

@media (max-width: 720px) {
  .relation-card-details { grid-template-columns: 1fr; }
  .room-relation-detail { border-top: 1px solid var(--line); border-left: 0; }
}
