:root {
  --primary: #176b87;
  --primary-strong: #0f5067;
  --teal: #0f9f8f;
  --accent: #f2a33a;
  --danger: #d64545;
  --success: #16845b;
  --ink: #17252f;
  --muted: #657784;
  --line: #e5eaee;
  --surface: #ffffff;
  --canvas: #f4f7f9;
  --sidebar: #102e3a;
  --sidebar-soft: #1b4350;
  --shadow: 0 16px 44px rgba(15, 48, 61, 0.09);
  --radius: 14px;
  --radius-sm: 9px;
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  font-size: 14px;
  line-height: 1.6;
}

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

button {
  cursor: pointer;
}

.app-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.boot-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.boot-mark img {
  width: 42px;
  height: 42px;
  animation: breathe 1.8s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    transform: scale(0.94);
    opacity: 0.72;
  }
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr minmax(380px, 0.9fr);
  background:
    radial-gradient(circle at 12% 12%, rgba(242, 163, 58, 0.18), transparent 30%),
    linear-gradient(145deg, #10343f, #176b87 65%, #2c8b91);
}

.login-story {
  color: #fff;
  padding: clamp(44px, 7vw, 96px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-story::after {
  content: "";
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 48% 52% 55% 45%;
  position: absolute;
  right: -180px;
  bottom: -180px;
  box-shadow:
    0 0 0 60px rgba(255, 255, 255, 0.025),
    0 0 0 130px rgba(255, 255, 255, 0.02);
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  font-size: 18px;
}

.brand-line img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.login-copy {
  max-width: 620px;
  margin: 80px 0;
}

.login-copy h1 {
  font-size: clamp(35px, 4.5vw, 62px);
  line-height: 1.16;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
}

.login-copy p {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.72);
  max-width: 540px;
}

.login-features {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.login-features span {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  padding: 8px 13px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.login-panel {
  background: rgba(255, 255, 255, 0.97);
  display: grid;
  place-items: center;
  padding: 32px;
  backdrop-filter: blur(20px);
}

.login-card {
  width: min(400px, 100%);
}

.login-card h2 {
  font-size: 28px;
  margin: 0 0 8px;
}

.login-card > p {
  color: var(--muted);
  margin: 0 0 30px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}

.field > label {
  font-weight: 600;
  font-size: 13px;
}

.field small,
.form-help {
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #ccd6dc;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 10px 12px;
  transition:
    border-color 0.16s,
    box-shadow 0.16s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.12);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.button {
  border: 0;
  border-radius: 9px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

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

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

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

.button.secondary:hover {
  border-color: #b9c7cf;
  background: #f8fafb;
}

.button.ghost {
  background: transparent;
  color: var(--primary);
}

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

.button.success {
  background: var(--success);
}

.button.wide {
  width: 100%;
  padding: 12px;
}

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

.sidebar {
  min-height: 100vh;
  position: sticky;
  top: 0;
  background:
    radial-gradient(circle at 20% 0, rgba(34, 151, 148, 0.27), transparent 34%),
    var(--sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 9px 24px;
  font-weight: 700;
}

.sidebar .brand img {
  width: 37px;
  height: 37px;
  border-radius: 11px;
}

.nav-group {
  margin-bottom: 10px;
}

.nav-label {
  color: rgba(255, 255, 255, 0.36);
  font-size: 11px;
  padding: 12px 13px 7px;
  letter-spacing: 0.12em;
}

.nav-link {
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  padding: 10px 12px;
  margin: 2px 0;
  transition: 0.16s;
}

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

.nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(46, 170, 164, 0.34), rgba(46, 170, 164, 0.08));
  box-shadow: inset 3px 0 0 #59d1c7;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  opacity: 0.9;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 8px 2px;
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #23a6a1, #1e7894);
  font-weight: 700;
}

.user-mini strong {
  display: block;
  font-size: 13px;
}

.user-mini small {
  color: rgba(255, 255, 255, 0.48);
}

.main {
  min-width: 0;
}

.topbar {
  height: 70px;
  background: rgba(244, 247, 249, 0.82);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(221, 229, 234, 0.8);
  padding: 0 clamp(22px, 3.5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  font-size: 20px;
  margin: 0;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.page {
  padding: 30px clamp(22px, 3.5vw, 48px) 60px;
  max-width: 1700px;
  margin: 0 auto;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.page-heading h2 {
  margin: 0 0 6px;
  font-size: 25px;
  letter-spacing: -0.02em;
}

.page-heading p {
  color: var(--muted);
  margin: 0;
}

.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

/* 课程详情页操作工具栏：滚动时固定在顶栏下方，老师不用上滑找「导入试题」等入口 */
.course-toolbar {
  position: sticky;
  top: 70px;
  z-index: 15;
  margin: -12px 0 20px;
  padding: 10px 14px;
  background: rgba(244, 247, 249, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(20, 52, 64, 0.06);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(20, 52, 64, 0.035);
}

.card-pad {
  padding: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.stat-card {
  padding: 19px 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  width: 54px;
  height: 54px;
  border-radius: 50%;
  position: absolute;
  right: -14px;
  top: -16px;
  background: rgba(23, 107, 135, 0.07);
}

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

.stat-card strong {
  display: block;
  font-size: 30px;
  line-height: 1.3;
  margin-top: 5px;
}

.stat-card small {
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  gap: 18px;
}

.section-title {
  padding: 18px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title h3 {
  margin: 0;
  font-size: 16px;
}

.section-title a {
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
}

.quick-list {
  padding: 14px 20px 20px;
}

.quick-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.quick-row:last-child {
  border-bottom: 0;
}

.quick-row span {
  color: var(--muted);
}

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

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

.filters input,
.filters select {
  width: auto;
  min-width: 150px;
  padding: 8px 10px;
}

.table-wrap {
  overflow-x: auto;
}

/* 弹窗里的表格：全局 table 有 760px 的最小宽度（列表页要保证列不挤成一团），
   但弹窗正文只有 ~640px，照搬会把最后一列挤出可视区、还多出一条横向滚动条。
   需要放进弹窗的表格加 compact 即可解除这个下限。 */
.table-wrap.compact table {
  min-width: 0;
}

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

th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
  background: #fafcfd;
}

td {
  padding: 14px 17px;
  border-bottom: 1px solid #edf1f3;
  vertical-align: middle;
}

tbody tr:hover {
  background: #fbfdfe;
}

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

.cell-main {
  font-weight: 600;
}

.cell-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  background: #edf2f5;
  color: #50616c;
  white-space: nowrap;
}

.badge.green {
  background: #e8f8f0;
  color: var(--success);
}

.badge.blue {
  background: #eaf4fb;
  color: #166b9a;
}

.badge.orange {
  background: #fff4e3;
  color: #ad6710;
}

.badge.red {
  background: #fff0f0;
  color: var(--danger);
}

.text-link {
  color: var(--primary);
  background: transparent;
  border: 0;
  padding: 0;
  font-weight: 600;
}

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

.empty-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: #edf3f5;
  font-size: 25px;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
}

.loading {
  min-height: 230px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.loading::after {
  content: "";
  width: 24px;
  height: 24px;
  border: 2px solid #cbd8de;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal {
  border: 0;
  padding: 0;
  border-radius: 18px;
  width: min(680px, calc(100vw - 30px));
  max-height: min(86vh, 900px);
  background: #fff;
  box-shadow: 0 30px 90px rgba(8, 35, 47, 0.23);
}

.modal::backdrop {
  background: rgba(8, 26, 34, 0.48);
  backdrop-filter: blur(5px);
}

.modal-shell {
  display: flex;
  flex-direction: column;
  max-height: min(86vh, 900px);
}

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

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

.modal-body {
  padding: 22px;
  overflow-y: auto;
}

.modal-error {
  margin: 14px 22px 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #f0bcbc;
  background: #fdeeee;
  color: #9e2d2d;
  font-size: 13.5px;
  line-height: 1.6;
}

.modal-error[hidden] {
  display: none;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.icon-button {
  border: 0;
  background: transparent;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 22px;
  color: var(--muted);
}

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

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

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid .section-divider {
  grid-column: span 2;
  margin: 10px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: #f7fafb;
}

.editor-toolbar button {
  min-width: 34px;
  border: 1px solid #d5dfe4;
  border-radius: 7px;
  background: #fff;
  padding: 5px 10px;
  color: #40535d;
}

.rich-editor {
  min-height: 220px;
  overflow-y: auto;
  border: 1px solid #ccd6dc;
  border-radius: 0 0 9px 9px;
  background: #fff;
  padding: 16px;
  line-height: 1.8;
  outline: 0;
}

.rich-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.12);
}

.rich-editor img {
  max-width: 100%;
  border-radius: 8px;
}

.form-field-row {
  display: grid;
  grid-template-columns: 1.05fr 0.9fr 0.85fr 1.4fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.form-field-row input,
.form-field-row select {
  min-width: 0;
  padding: 8px;
}

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

.homepage-preview-wrap {
  position: sticky;
  top: 92px;
  text-align: center;
}

.phone-frame {
  width: 330px;
  height: 680px;
  margin: 0 auto 10px;
  border: 9px solid #132d38;
  border-radius: 38px;
  background: #132d38;
  box-shadow: 0 24px 60px rgba(10, 38, 50, 0.2);
  position: relative;
  overflow: hidden;
}

.phone-notch {
  width: 100px;
  height: 18px;
  border-radius: 0 0 14px 14px;
  background: #132d38;
  position: absolute;
  z-index: 2;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
}

.phone-screen {
  height: 100%;
  overflow-y: auto;
  padding: 24px 12px 18px;
  border-radius: 29px;
}

.phone-screen::-webkit-scrollbar {
  width: 0;
}

.preview-hero {
  min-height: 150px;
  border-radius: 18px;
  padding: 20px 16px;
  color: #fff;
  text-align: left;
  box-sizing: border-box;
}

.preview-hero small {
  font-size: 10px;
  opacity: 0.72;
}

.preview-hero h3 {
  font-size: 22px;
  line-height: 1.25;
  margin: 10px 0 0;
}

.preview-hero-button {
  display: inline-flex;
  margin-top: 13px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 10px;
}

.preview-countdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  border-radius: 14px;
  margin-top: 10px;
  padding: 12px 10px;
  text-align: center;
}

.preview-countdown small {
  font-size: 10px;
  color: #7b929a;
}

.preview-countdown div {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.preview-countdown span {
  flex: 1 1 0;
  max-width: 52px;
  border-radius: 9px;
  background: rgba(23, 107, 135, 0.08);
  padding: 5px 0;
  display: flex;
  flex-direction: column;
}

.preview-countdown b {
  font-size: 15px;
  color: #104f64;
}

.preview-countdown i {
  font-style: normal;
  font-size: 9px;
  color: #7b929a;
}

.preview-countdown em {
  font-style: normal;
  font-size: 11px;
  color: #b4453f;
}

.preview-countdown-empty {
  color: #96a6ad;
  border: 1px dashed #cfdbdf;
  background: #f7fafb;
}

.preview-stats {
  display: flex;
  background: #fff;
  border-radius: 14px;
  margin-top: 10px;
  padding: 12px 5px;
}

.preview-stats div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-stats b {
  color: #183744;
  font-size: 17px;
}

.preview-stats span {
  color: #8b989f;
  font-size: 9px;
}

.preview-section {
  background: #fff;
  border-radius: 14px;
  margin-top: 10px;
  padding: 12px 8px;
}

.preview-quick {
  display: grid;
  gap: 7px;
}

.preview-quick > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.preview-quick span,
.preview-quick img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f3f5;
  color: #176b87;
  object-fit: cover;
  font-size: 12px;
  font-weight: 700;
}

.preview-quick small {
  color: #556871;
  font-size: 9px;
}

.preview-banner {
  position: relative;
  margin-top: 10px;
  border-radius: 14px;
  min-height: 92px;
  overflow: hidden;
  background: linear-gradient(135deg, #dceef1, #f7f1e2);
  color: #263e49;
  text-align: left;
  padding: 14px;
  box-sizing: border-box;
}

.preview-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.preview-banner strong,
.preview-banner small {
  position: relative;
  display: block;
}

.preview-banner strong {
  margin-top: 20px;
  font-size: 14px;
}

.preview-banner small {
  margin-top: 3px;
  font-size: 9px;
}

.preview-block {
  background: #fff;
  border-radius: 14px;
  margin-top: 10px;
  padding: 12px;
}

.preview-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.preview-block-head b {
  font-size: 13px;
}

.preview-block-head span {
  color: #78909a;
  font-size: 9px;
}

.preview-course {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid #edf1f3;
  text-align: left;
}

.preview-course > i {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f3f5;
  color: #176b87;
  font-style: normal;
  font-size: 10px;
}

.preview-course > div {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.preview-course b {
  font-size: 10px;
}

.preview-course small {
  color: #87949b;
  font-size: 8px;
}

.preview-course > span {
  color: #9aa8ae;
}

.preview-notice {
  border-radius: 10px;
  background: #fff5e4;
  color: #866528;
  padding: 12px;
  text-align: left;
  font-size: 10px;
}

.preview-rich {
  border-radius: 14px;
  margin-top: 10px;
  padding: 12px;
  font-size: 10px;
  text-align: left;
  overflow-wrap: anywhere;
}

.preview-rich img {
  max-width: 100%;
}

.homepage-block-editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: #fff;
}

.homepage-block-editor.disabled {
  opacity: 0.58;
}

.homepage-block-fields {
  margin-top: 12px;
}

.homepage-items {
  display: grid;
  gap: 10px;
}

.homepage-item-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fafcfd;
}

@media (max-width: 1050px) {
  .homepage-builder {
    grid-template-columns: 1fr;
  }
  .homepage-preview-wrap {
    position: static;
  }
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #41545f;
}

/* 勾选框与单选框必须跳出上面那条「文本框」规则。
   2026-11-15 的截图里，外部用户转学员弹窗的 radio 被拉成整行宽的椭圆——
   因为 `input, select, textarea { width: 100%; border; border-radius }` 也命中了
   radio：宽度吃满 flex 行、圆角加描边就成了空心胶囊。之前只在 `.check` 里补了
   width:auto，凡是没套 `.check` 的地方（这个弹窗、表格里的全选框）都会变形成这样。
   这里按类型兜底，不依赖调用方记得加类；flex:none 再挡住 flex 容器的拉伸。 */
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  accent-color: var(--primary);
  flex: none;
  cursor: pointer;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: none;
  outline: 2px solid rgba(23, 107, 135, 0.35);
  outline-offset: 2px;
}

/* 转学员弹窗里的候选人列表 */
.convert-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line, #e3eaee);
  border-radius: var(--radius-sm, 8px);
  background: #fff;
}

.convert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  font-size: 13px;
}

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

.convert-item:hover {
  background: #f5fafb;
}

.convert-item:has(input:checked) {
  background: rgba(23, 107, 135, 0.08);
}

.convert-item.is-bound {
  color: var(--muted, #7d8f9a);
  cursor: not-allowed;
  background: #fafbfc;
}

.convert-item .convert-name {
  font-weight: 600;
  color: var(--ink, #22314a);
}

.convert-item .convert-phone {
  color: var(--muted, #7d8f9a);
  font-variant-numeric: tabular-nums;
}

.convert-item .convert-tag {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted, #7d8f9a);
  border: 1px solid var(--line, #e3eaee);
  border-radius: 999px;
  padding: 1px 8px;
}

.convert-empty {
  padding: 14px 12px;
  color: var(--muted, #7d8f9a);
  font-size: 13px;
}

.toast-region {
  position: fixed;
  right: 24px;
  top: 22px;
  z-index: 1000;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 260px;
  max-width: 420px;
  background: #172b35;
  color: #fff;
  padding: 12px 15px;
  border-radius: 10px;
  box-shadow: 0 14px 35px rgba(10, 37, 48, 0.2);
  animation: toast-in 0.22s ease-out;
}

.toast.error {
  background: #9e2d2d;
}

.toast.success {
  background: #116c4b;
}

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

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

.detail-item {
  background: #f7fafb;
  border: 1px solid #ebf0f2;
  border-radius: 10px;
  padding: 12px;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-item strong {
  display: block;
  margin-top: 2px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.tab {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}

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

.question-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.question-card h4 {
  margin: 0 0 8px;
}

.answer-sheet {
  white-space: pre-wrap;
  word-break: break-word;
}

.review-row {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.review-row:first-child {
  border-top: 0;
}

.review-row .review-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
}

.danger-text {
  color: var(--danger);
}

/* 课程封面预览（课程设置弹窗内） */
.course-cover-preview {
  margin-top: 8px;
}
.course-cover-preview img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* 弹窗里的表单小字说明（课程类型/有效期等字段的解释） */
.field small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 76px 1fr;
  }
  .sidebar .brand span,
  .nav-label,
  .nav-link span:not(.nav-icon),
  .user-mini > div {
    display: none;
  }
  .sidebar .brand {
    justify-content: center;
  }
  .nav-link {
    justify-content: center;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-page {
    grid-template-columns: 1fr;
  }
  .login-story {
    display: none;
  }
  .login-panel {
    min-height: 100vh;
  }
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    z-index: 100;
    inset: auto 0 0;
    min-height: auto;
    height: 66px;
    flex-direction: row;
    overflow-x: auto;
    padding: 6px;
  }
  .sidebar .brand,
  .sidebar-footer,
  .nav-label {
    display: none;
  }
  .nav-group {
    display: flex;
    margin: 0;
  }
  .nav-link {
    width: 56px;
    height: 54px;
    flex: 0 0 auto;
  }
  .nav-link.active {
    box-shadow: inset 0 -3px 0 #59d1c7;
  }
  .main {
    padding-bottom: 70px;
  }
  .topbar {
    height: 58px;
    padding: 0 16px;
  }
  .page {
    padding: 20px 14px 40px;
  }
  .page-heading {
    display: block;
  }
  .page-heading .actions {
    margin-top: 14px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card strong {
    font-size: 24px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span-2 {
    grid-column: auto;
  }
  .form-field-row {
    grid-template-columns: 1fr 1fr;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .filters {
    width: 100%;
  }
  .filters input,
  .filters select {
    flex: 1;
    width: 100%;
    min-width: 120px;
  }
}

/* ── 界面风格切换（两种主题通用，配色全部走变量）───────────── */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--line);
}

.theme-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.16s;
}

.theme-switch button:hover {
  color: var(--ink);
}

.theme-switch button.on {
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* 窄屏只留图标式短标签，避免把顶栏挤爆 */
@media (max-width: 720px) {
  .theme-switch button {
    padding: 5px 9px;
    font-size: 11px;
  }
  .topbar-meta > span {
    display: none;
  }
}

/* ── 窄屏表格卡片化（两种主题通用）─────────────────────────
 * 原来 table 有 min-width:760px，手机上必须左右拖动才能看全：3 列的表还凑合，
 * 题库那种 8 列的表基本没法用。窄屏下改成「一行 = 一张卡片」。
 * 列名不在模板里重复写，由 core.js 的 decorateTables() 从 thead 抠出来塞进
 * 每个 td 的 data-label —— 表头是唯一数据源，改列名时不会漏。 */
@media (max-width: 760px) {
  .table-wrap {
    overflow-x: visible;
  }
  table {
    min-width: 0;
  }
  /* 表头在小屏上没有意义了（每格自带标签），直接收起来 */
  table thead {
    display: none;
  }
  table,
  table tbody,
  table tr,
  table td {
    display: block;
    width: auto;
  }
  table tbody tr {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    padding: 2px 0;
    background: var(--surface);
  }
  table td {
    padding: 7px 14px;
    border-bottom: 1px dashed #eef2f4;
    min-width: 0;
    /* 长内容（题干、备注）必须能折行，否则卡片会被撑出屏幕 */
    overflow-wrap: anywhere;
  }
  table tbody tr td:last-child {
    border-bottom: 0;
  }
  table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 1px;
  }
  table td:not([data-label])::before {
    content: none;
  }
  /* 占满整行的单元格（「暂无数据」之类）居中显示，不加标签 */
  table td.cell-full,
  table td[colspan] {
    text-align: center;
    color: var(--muted);
  }
  table td.cell-full::before,
  table td[colspan]::before {
    content: none;
  }
  /* 操作按钮在卡片里要能换行，否则 4 个按钮会横着溢出 */
  table td .row-actions,
  table td .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* ---------- 题目修订记录 ----------
 * 弹窗里一列版本、一列变更摘要；摘要必须能一眼扫出「哪个字段从什么变成什么」，
 * 所以标签和前后值分开排版，长文本允许换行但不撑破表格。 */
.revision-change {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0;
}

.revision-change:first-child {
  margin-top: 0;
}

.revision-diff {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
  word-break: break-word;
}

.revision-arrow {
  color: var(--primary);
  padding: 0 2px;
}

.revision-card {
  margin: 0;
  border: 1px dashed var(--line);
  background: var(--canvas);
}

/* 移动端把 td[colspan] 强制居中并置灰，这里的快照要正常左对齐、正常墨色 */
table td.revision-cell,
table td.revision-cell[colspan] {
  text-align: left;
  color: var(--ink);
  padding: 12px;
  background: var(--canvas);
}

/* 时间和操作列不许折行：「2026/11/05 15:37」和「查看快照」一折断就变成两行，
   四列挤在一起看着像表格错位 */
.revision-when,
.revision-view {
  white-space: nowrap;
}

/* 时间和操作列不许折行：「2026/11/05 15:37」和「查看快照」一折断就变成两行，
   四列挤在一起看着像表格错位 */
.revision-when,
.revision-view {
  white-space: nowrap;
}
