/* 全局设计变量与基础重置 - 参考代课系统桌面端视觉规范 */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: #1e293b;
  --radius: 10px;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html, body {
  min-height: 100vh;
  background-color: var(--gray-100);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
}

/* 后台固定外层窗口，长内容在各自区域内滚动 */
body.admin-layout {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
}

.admin-layout .app-container {
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  width: 100%;
}

.admin-layout .main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.admin-layout .content-area {
  min-height: 0;
  overflow: auto;
}

/* 主内容区、名单表格、人员选择列表和弹窗统一使用纵横 6px 细滚动条 */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: #c1c5cb;
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover {
  background: #a8aeb7;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: #c1c5cb transparent;
  }
}

/* 明确选择电脑版时保留侧栏和宽表格，窄窗口可横向滚动 */
body.desktop-view:not(.admin-layout) .app-container {
  min-width: 1080px;
}
/* 布局结构 */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* 深色左侧导航栏 */
.sidebar {
  width: 250px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.sidebar-brand {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
}

.sidebar-brand .brand-title {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.sidebar-menu {
  list-style: none;
  padding: 14px 12px;
  flex: 1;
  overflow-y: auto;
}

.menu-item {
  margin-bottom: 4px;
}

.menu-link {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.2s, color 0.2s;
}

.menu-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.menu-link.active {
  background-color: var(--primary);
  color: #fff;
}

.icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
}

.menu-text {
  flex: 1;
}

.menu-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
}

.menu-link.active .menu-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.sidebar-account {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px;
}

.sidebar-account .user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-account .user-avatar {
  width: 36px;
  height: 36px;
  background-color: rgba(37, 99, 235, 0.24);
  color: #93c5fd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-account .user-info {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.sidebar-account .user-name {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
}

.sidebar-account .user-organization {
  font-size: 12px;
  color: #94a3b8;
}

.sidebar-role-switch {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}

.sidebar-role-switch:hover:enabled {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sidebar-role-switch:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.sidebar-role-switch:disabled {
  color: #64748b;
  opacity: 0.85;
  cursor: wait;
}

.identity-modal {
  max-width: 440px;
}

.identity-account-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-600);
  margin: 0 0 8px;
}

.identity-switch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.identity-switch-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: #fff;
  color: var(--gray-900);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.identity-switch-option:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.identity-switch-option[aria-current="true"] {
  border-color: var(--primary);
  background: var(--primary-light);
}

.identity-switch-option:disabled {
  cursor: default;
}

.identity-option-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.identity-option-role {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}

.identity-option-detail {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
}

.grade-opens-panel {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-50);
}

.grade-opens-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.grade-opens-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-700);
}

.grade-opens-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
}

.grade-opens-item .form-label {
  font-size: 12.5px;
  margin-bottom: 4px;
}

@media (max-width: 900px) {
  .grade-opens-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .grade-opens-grid {
    grid-template-columns: 1fr;
  }
}

/* 白色主内容区 */
.content-area {
  margin: 12px;
  padding: 20px 24px;
  background-color: #fff;
  border-radius: 0;
  min-width: 0;
  flex: 1;
}

.content-area > .card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: #fff;
  margin-bottom: 20px;
}

/* 卡片样式 */
.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: none;
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 按钮通用 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  box-shadow: none !important;
  white-space: nowrap;
}

.btn:hover,
.btn:focus,
.btn:active {
  box-shadow: none !important;
  outline: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
}

.btn-success {
  background-color: var(--success);
  color: #fff;
}
.btn-success:hover:not(:disabled) {
  background-color: #15803d;
}

.btn-warning {
  background-color: var(--warning);
  color: #fff;
}

.btn-danger {
  background-color: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background-color: #b91c1c;
}

.btn-outline-danger {
  background-color: #fff5f5;
  border-color: #ff4d4f;
  color: #ff4d4f;
}
.btn-outline-danger:hover:not(:disabled) {
  background-color: #fff1f0;
  border-color: #f5222d;
  color: #f5222d;
}

.btn-secondary {
  background-color: #fff;
  border-color: var(--gray-300);
  color: var(--gray-700);
}
.btn-secondary:hover:not(:disabled) {
  background-color: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12.5px;
  border-radius: 6px;
}

/* 表单组件 */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background-color: #fff;
  color: var(--gray-900);
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
  user-select: none;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* 状态徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-primary {
  background-color: var(--primary-light);
  color: var(--primary);
}
.badge-pending {
  background-color: var(--warning-light);
  color: var(--warning);
}
.badge-approved {
  background-color: var(--success-light);
  color: var(--success);
}
.badge-rejected {
  background-color: var(--danger-light);
  color: var(--danger);
}
.badge-completed {
  background-color: var(--gray-100);
  color: var(--gray-600);
}

/* 表格样式 */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.table th {
  background-color: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
  vertical-align: middle;
}

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

.table tr:hover td {
  background-color: var(--gray-50);
}

.dean-table {
  table-layout: fixed;
  min-width: 260px;
}

.dean-table th {
  width: 25%;
}

.dean-table th,
.dean-table td {
  white-space: nowrap;
}

.dean-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-layout .content-area > .stats-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-bottom: 0;
}

.admin-layout .stats-section > :not(.stats-results) {
  flex-shrink: 0;
}

.admin-layout .stats-results {
  flex: 1 1 0;
  min-height: 160px;
}

.stats-table th,
.stats-table td {
  padding: 9px 8px;
  text-align: center;
}

.stats-table th:last-child {
  width: 25%;
  min-width: 200px;
}

.stats-grade-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.stats-grade-pills .grade-pill {
  margin: 0;
  padding-inline: 5px;
  white-space: nowrap;
}

.stats-results thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 1px var(--gray-200);
}

.stats-results th [data-stats-sort] {
  width: 100%;
  border: 0;
  padding: 0 12px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: center;
  white-space: nowrap;
}

.stats-sort-label {
  position: relative;
  display: inline-block;
}

.stats-sort-arrow {
  position: absolute;
  inset-inline-start: calc(100% + 3px);
  color: var(--gray-400);
}

.stats-results th [data-stats-sort]:hover,
.stats-results th[aria-sort] .stats-sort-arrow {
  color: var(--primary);
}

.stats-pagination,
.stats-page-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.stats-pagination {
  padding-top: 14px;
  gap: 8px;
}

.stats-page-buttons button {
  min-width: 30px;
  height: 32px;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #fff;
  color: var(--gray-700);
  cursor: pointer;
}

.stats-page-buttons button:hover:enabled,
.stats-page-buttons button[aria-current="page"] {
  border-color: var(--primary);
  color: var(--primary);
}

.stats-page-buttons button:disabled,
.stats-page-ellipsis {
  color: var(--gray-400);
}

.stats-page-buttons button:disabled {
  cursor: default;
}

.stats-pagination #stats-page-size {
  width: auto;
  height: 32px;
  padding: 0 6px;
}

.mobile-page .stats-results {
  border: 0;
  overflow: visible;
}

/* 工具栏与横幅 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

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

.batch-selector,
.batch-actions {
  max-width: 100%;
}

.batch-selector {
  flex-wrap: nowrap;
}

.batch-selector .form-label {
  flex-shrink: 0;
  margin: 0;
  white-space: nowrap;
}

.batch-selector select {
  width: 240px;
  min-width: 0;
  padding: 8px 12px;
}

.batch-actions {
  justify-content: flex-end;
  margin-inline-start: auto;
}

.notice-box {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 16px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.notice-box.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.notice-box.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.notice-box.warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.notice-box.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* 孩子选择器标签页 */
.child-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.child-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-700);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.child-tab:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.child-tab.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.child-tab small {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
}

/* 桌面端课程卡片网格 */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.course-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s;
}

.course-card:hover {
  border-color: #cbd5e1;
}

.course-card.is-selected {
  border-color: #3b82f6;
  background: #f8fbff;
}

.course-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.course-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.4;
}

.course-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 13px;
  color: var(--gray-600);
}

.course-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.course-meta-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quota-text {
  font-size: 13px;
  font-weight: 600;
}

.quota-text.ok { color: var(--success); }
.quota-text.low { color: var(--warning); }
.quota-text.full { color: var(--danger); }

/* 教务同权选人弹窗（参考 daikexitong/public/deans.html） */
.dean-tag {
  display: inline-block;
  color: #1677ff;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.dean-super-tag {
  display: inline-block;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.dean-toolbar { margin-bottom: 20px; }
.dean-picker {
  width: min(780px, calc(100vw - 32px));
  max-width: 780px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.5;
}

.dean-picker-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px;
  min-height: 0;
  overflow: auto;
}

.dean-picker-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dean-picker-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dean-panel {
  background: #f8fafc;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 10px;
  height: 340px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dean-search {
  position: relative;
  margin-bottom: 8px;
}

.dean-search .form-control {
  height: 34px;
  padding: 6px 32px 6px 10px;
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
}

.dean-search svg {
  position: absolute;
  right: 10px;
  top: 9px;
  width: 16px;
  height: 16px;
  color: var(--gray-600);
  pointer-events: none;
}

.dean-select-all {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 2px 8px;
  cursor: pointer;
  color: var(--gray-700);
  font-size: 13px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 6px;
}

.dean-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.dean-breadcrumb button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  cursor: pointer;
}
.dean-department {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 5px;
  padding: 6px 3px;
  background: transparent;
  color: var(--gray-700);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.dean-department:hover { background: #eaf2ff; }
.dean-department svg { flex-shrink: 0; }
.dean-department .next {
  margin-left: auto;
  padding-left: 8px;
  border-left: 1px solid var(--gray-200);
  color: var(--primary);
  white-space: nowrap;
}

.dean-select-all input,
.dean-candidate input {
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.dean-directory-list,
.dean-selected-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}

.dean-candidate {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px;
  border-radius: 5px;
  cursor: pointer;
}

.dean-candidate:hover {
  background: #eaf2ff;
}

.dean-candidate small {
  margin-left: auto;
}

.dean-selected-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-200);
}

.dean-clear {
  background: #fff;
  border: 1px solid #fca5a5;
  border-radius: 5px;
  padding: 3px 8px;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
}

.dean-selected {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
  gap: 10px;
  font-size: 13px;
  color: var(--gray-700);
  border-bottom: 1px dashed var(--gray-200);
}

.dean-selected:last-child {
  border-bottom: none;
}

.dean-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--gray-400);
  border-radius: 50%;
  background: none;
  color: var(--gray-600);
  cursor: pointer;
  width: 18px;
  height: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.dean-remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* 模态弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.active,
.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  border: 1px solid var(--gray-300);
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: modalIn 0.18s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

.modal-close {
  background: none;
  border: none;
  outline: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-600);
  padding: 2px 6px;
}

.modal-close:focus,
.modal-close:focus-visible,
.custom-confirm-close:focus,
.custom-confirm-close:focus-visible,
dialog.native-dialog:focus {
  outline: none;
  box-shadow: none;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--gray-50);
  flex-shrink: 0;
}

/* 原生 dialog 弹窗与行内表单布局 */
dialog.native-dialog {
  margin: auto;
  padding: 0;
  width: min(92vw, 500px);
  max-height: 85dvh;
  border: 1px solid var(--gray-300);
  color: var(--gray-900);
}

dialog.native-dialog.native-dialog-sm {
  width: min(92vw, 420px);
}

dialog.native-dialog:not([open]) {
  display: none;
}

dialog.native-dialog::backdrop {
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}

.native-dialog-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.adjustment-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.adjustment-picker-trigger::after {
  content: '';
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: translateY(-2px) rotate(45deg);
  flex-shrink: 0;
}

.adjustment-picker-trigger:disabled {
  opacity: 0.65;
  cursor: default;
}

.adjustment-picker-search {
  padding: 12px 16px 0;
}

.adjustment-picker-options {
  min-height: 64px;
  max-height: min(56dvh, 420px);
  overscroll-behavior: contain;
  padding: 12px 16px;
}

.adjustment-picker-options button {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--gray-200);
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.adjustment-picker-options button:hover,
.adjustment-picker-options button[aria-pressed="true"] {
  color: var(--primary);
  background: var(--primary-light);
}

.form-inline-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.form-inline-row:last-of-type {
  margin-bottom: 0;
}

.form-inline-row.align-top {
  align-items: start;
}

.form-inline-row.align-top .form-label {
  padding-top: 9px;
}

.form-inline-row .form-label {
  margin-bottom: 0;
  text-align: right;
  font-size: 13.5px;
}

.dialog-error-hint {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-light);
  border: 1px solid #fecaca;
}

.dialog-error-hint:empty {
  display: none;
}

/* 自定义确认弹窗 */
.custom-confirm-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  padding: 16px;
}

.custom-confirm-overlay.show {
  opacity: 1;
  visibility: visible;
}

.custom-confirm-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--gray-300);
  overflow: hidden;
  position: relative;
}

.custom-confirm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 20px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
}

.custom-confirm-body {
  padding: 24px 24px 18px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.custom-confirm-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.custom-confirm-icon-box.danger { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
.custom-confirm-icon-box.warning { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }
.custom-confirm-icon-box.primary,
.custom-confirm-icon-box.info { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }
.custom-confirm-icon-box.success { background: #f0fdf4; color: #16a34a; border: 1px solid #dcfce7; }

.custom-confirm-icon-box svg {
  width: 22px;
  height: 22px;
}

.custom-confirm-content {
  flex: 1;
  min-width: 0;
}

.custom-confirm-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.custom-confirm-message {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.5;
  word-break: break-word;
}

.custom-confirm-footer {
  padding: 10px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fff;
}

/* Toast 提示 */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 11px 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastIn 0.22s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-success { background-color: var(--success); }
.toast-error { background-color: var(--danger); }
.toast-info { background-color: var(--primary); }
.toast-warning { background-color: #b45309; }

/* 登录页面 */
.login-shell {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: #f5f6f9;
}

.auth-card {
  width: min(440px, 100%);
  min-height: 640px;
  background: #fff;
  border-radius: 28px;
  border: 1px solid #0000000a;
  box-shadow: 0 16px 48px #0f172a0d, 0 2px 10px #0f172a05;
  padding: 32px 39px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-tabs {
  display: inline-flex;
  background: #f0f2f5;
  border-radius: 19px;
  padding: 3px;
  margin-bottom: 20px;
}
.auth-tabs button {
  border: 0;
  background: transparent;
  padding: 7px 22px;
  border-radius: 16px;
  color: #595959;
  font: inherit;
  cursor: pointer;
}
.auth-tabs button[aria-pressed="true"] {
  color: #181c1f;
  background: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px #00000014;
}
.auth-tabs[hidden], .auth-remember[hidden] { display: none; }

.auth-logo {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  margin-bottom: 4px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: #181c1f;
  line-height: 1.25;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 14px;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 12px;
}

.auth-panel {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 10px;
}
.auth-panel p { color: #475569; margin: 20px 0 8px; }
.auth-qr {
  width: min(260px, 100%);
  height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #64748b;
  font-size: 13px;
  overflow: hidden;
}
.auth-qr iframe { border: 0; display: block; }
.auth-spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid #cbd5e1;
  border-top-color: #5b9cfd;
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 24px;
  background: #2563c9;
  color: white;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}
.auth-button:hover { background: #1d55b3; }
.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  color: #595959;
  cursor: pointer;
}
.auth-remember input { accent-color: #1677ff; }
.auth-message {
  color: #b91c1c;
  margin-top: 12px;
  font-size: 13px;
}
.auth-message:empty, .auth-actions:empty { display: none; }
@media (max-width: 480px) {
  .auth-card {
    min-height: 500px;
    padding: 26px 20px 28px;
    border-radius: 24px;
  }
}

.auth-actions {
  width: 100%;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--gray-400);
  margin: 4px 0;
}
.demo-divider::before,
.demo-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.demo-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* 导入上传框 */
.upload-dropzone {
  border: 1.5px dashed var(--gray-300);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.2s;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-actions {
  justify-content: center;
  margin-top: 12px;
}

.plan-import-tips {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.75;
  color: #475569;
}

.plan-import-tips code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 12px;
}

.workspace-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--gray-600);
  font-size: 14px;
}

.grade-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12px;
  background: var(--gray-100);
  color: var(--gray-700);
  margin: 2px;
}

.grade-pill.is-full {
  background: var(--danger-light);
  color: var(--danger);
}

.grade-pill.is-shared {
  background: var(--primary-light);
  color: var(--primary);
}

@media (max-width: 768px) {
  .content-area {
    margin: 8px;
    padding: 16px;
  }
  .dean-picker-body {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .dean-panel {
    height: 230px;
  }
}

@media (max-width: 540px) {
  .sidebar {
    width: 166px;
  }
  .sidebar-brand {
    padding-inline: 10px;
    gap: 7px;
  }
  .sidebar-brand .brand-title {
    font-size: 14px;
    letter-spacing: 0;
  }
}
