:root {
  --bg: #f4f7fb;
  --card: #fff;
  --text: #142033;
  --muted: #617084;
  --line: #dde6f1;
  --line-strong: #cbd5e1;
  --primary: #0f766e;
  --primary-strong: #0a5f59;
  --danger: #b42318;
  --surface: #f7f9fc;
  --sidebar: #122033;
  --sidebar-soft: #1b2b42;
  --shadow: 0 18px 45px rgba(23, 32, 51, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0, rgba(15, 118, 110, .10), transparent 30%),
    linear-gradient(180deg, #edf4fb 0, #f4f7fb 260px, #f4f7fb 100%);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.page {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 24px 20px 42px;
}

.hero {
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(221, 230, 241, .9);
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 14px 32px rgba(20, 32, 51, .06);
  backdrop-filter: blur(10px);
}

.hero h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 7px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.nav a {
  text-decoration: none;
  font-size: 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 12px;
  color: #344054;
  background: transparent;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.nav a.active {
  background: #eef6f4;
  border-color: #c9e2dc;
  color: var(--primary-strong);
  font-weight: 700;
}

.nav-spacer {
  flex: 1;
}

.nav-logout {
  background: #fff4f3;
  color: #7a1d1d;
  border: 1px solid #f1c9c5;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 { margin: 0 0 12px; font-size: 20px; letter-spacing: 0; }
.card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:10px; }

.muted {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.grid2 { display:grid; grid-template-columns: 1fr; gap:12px; }
label span { display:block; margin-bottom:5px; font-size:13px; color:#475467; }

input, select, textarea {
  width:100%;
  min-height:42px;
  border:1px solid var(--line);
  border-radius:10px;
  padding:9px 11px;
  background:#fff;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(20, 108, 92, .14);
  border-color: #8ac1b5;
}

input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.switch-row {
  display: inline-flex;
  width: auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.switch-row span {
  margin: 0;
  color: #344054;
  font-size: 13px;
}

textarea { min-height: 120px; }

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

.btn {
  border:1px solid #d8e0ea;
  border-radius:10px;
  height:40px;
  padding:0 14px;
  background:#fff;
  color:#344054;
  cursor:pointer;
  font-weight: 600;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color:#fff;
  box-shadow: 0 10px 20px rgba(15, 118, 110, .18);
}

.btn.primary:hover { background: var(--primary-strong); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 16px rgba(20, 32, 51, .08); }
.btn.danger { background:#ffebe9; color:var(--danger); }
.btn.ghost { height:34px; background: var(--surface); }
.btn.mini { height:30px; padding:0 10px; font-size:12px; }

.inline-row { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; align-items:center; }
.compact-actions { margin-bottom: 0; justify-content: flex-end; }
.form-actions { margin: 2px 0 0; }
.split { height:1px; background:var(--line); margin:14px 0; }

.section-shortcuts h2 {
  margin-bottom: 10px;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.shortcut-item {
  display: grid;
  gap: 5px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  color: #1d2939;
  background: linear-gradient(180deg, #fff 0, #f8fbfd 100%);
  cursor: pointer;
}

.shortcut-item strong {
  font-size: 15px;
}

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

.shortcut-item.active {
  border-color: #80bdb2;
  background: linear-gradient(180deg, #effaf7 0, #ffffff 100%);
  box-shadow: inset 4px 0 0 var(--primary), 0 14px 26px rgba(15, 118, 110, .10);
}

.panel-body[hidden] {
  display: none;
}

.classes-panel[hidden] {
  display: none;
}

.class-workbench {
  display: grid;
  gap: 14px;
}

.class-subnav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow);
}

.class-subnav-title {
  grid-column: 1 / -1;
  color: #172033;
  font-size: 18px;
  font-weight: 900;
}

.class-workspace {
  min-width: 0;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #e8eef6;
  border-radius: 12px;
  background: #fbfdff;
}

.summary-text {
  margin: 0;
  align-self: center;
  border-radius: 999px;
  padding: 7px 11px;
  background: #effaf7;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 800;
}

.wide-select {
  width: auto;
  min-width: 260px;
}

.batch-bar {
  padding: 12px;
  border: 1px solid #e8eef6;
  border-radius: 12px;
  background: #fbfdff;
}

.adjust-cell {
  display: flex;
  gap: 6px;
  min-width: 260px;
  align-items: center;
}

.adjust-select {
  min-height: 30px;
}

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

.class-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}

.class-card.capacity-full {
  border-color: #f1a6a0;
  background: linear-gradient(180deg, #fff7f6 0, #fff 74%);
}

.class-card.capacity-low {
  border-color: #f6d08d;
  background: linear-gradient(180deg, #fffaf0 0, #fff 74%);
}

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

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

.class-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: #e7f7f1;
  color: #0b6c58;
}

.status-pill.closed {
  background: #f7e9e7;
  color: #9b2c20;
}

.class-status-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.capacity-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef6f4;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
}

.capacity-pill.low {
  background: #fff3d6;
  color: #8a4b04;
}

.capacity-pill.full {
  background: #ffe6e2;
  color: #a4261d;
}

.class-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.metric {
  border-radius: 10px;
  background: var(--surface);
  padding: 8px;
}

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

.metric strong {
  font-size: 15px;
}

.metric.warning {
  background: #fff5dd;
}

.metric.warning strong {
  color: #925004;
}

.metric.danger {
  background: #fff0ee;
}

.metric.danger strong {
  color: #b42318;
}

.class-meta {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  color: #475467;
  font-size: 13px;
}

.class-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.subsection-title {
  margin: 18px 0 10px;
  font-size: 18px;
}

.class-overview-wrap {
  margin-bottom: 18px;
  border-color: #9aa8b7;
}

.class-overview-wrap table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.class-overview-wrap th,
.class-overview-wrap td {
  border: 1px solid #9aa8b7;
  text-align: center;
  vertical-align: middle;
  padding: 8px 7px;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.class-overview-wrap th {
  background: #f3f7fb;
  color: #0f172a;
}

.class-overview-wrap .col-index { width: 4%; }
.class-overview-wrap .col-category { width: 8%; }
.class-overview-wrap .col-class { width: 18%; }
.class-overview-wrap .col-weekday { width: 7%; }
.class-overview-wrap .col-time { width: 9%; }
.class-overview-wrap .col-room { width: 12%; }
.class-overview-wrap .col-lessons { width: 6%; }
.class-overview-wrap .col-fee { width: 5%; }
.class-overview-wrap .col-count { width: 7.75%; }

.overview-row.tone-a {
  background: #ecfbf7;
}

.overview-row.tone-b {
  background: #fff5d9;
}

.overview-row.capacity-low {
  background: #fffaf0;
}

.overview-row.capacity-full {
  background: #fff6f5;
}

.overview-row.capacity-low:hover {
  background: #fff3d6;
}

.overview-row.capacity-full:hover {
  background: #ffece9;
}

.category-cell {
  color: #142033;
  font-weight: 900;
  line-height: 1.55;
}

.category-cell.tone-a {
  background: #77d5ca;
}

.category-cell.tone-b {
  background: #f6bd82;
}

.row-index {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef3f8;
  color: #344054;
  font-weight: 800;
}

.overview-class-name {
  display: inline-block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #0b5f87;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1.45;
  padding: 4px 6px;
  text-align: center;
  border-radius: 8px;
}

.overview-class-name:hover,
.overview-class-name:focus-visible {
  background: rgba(13, 148, 136, 0.12);
  color: #075985;
  outline: none;
  text-decoration: underline;
}

.number-badge {
  display: inline-flex;
  min-width: 40px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef3f8;
  color: #344054;
  font-weight: 800;
}

.number-badge.enrolled {
  background: #ecfdf7;
  color: #0b6c58;
}

.number-badge.quota {
  background: #eef2ff;
  color: #3440a1;
}

.number-badge.remaining.low {
  background: #fff0c2;
  color: #8a4b04;
}

.number-badge.remaining.full {
  background: #ffe1dc;
  color: #a4261d;
}

.table-wrap {
  overflow:auto;
  border:1px solid var(--line);
  border-radius:12px;
  background: #fff;
}

table { width:100%; border-collapse:collapse; min-width:900px; }
th, td { border-bottom:1px solid #edf1f6; text-align:left; padding:10px 12px; font-size:13px; vertical-align: top; }
th { background:#f5f8fc; color:#344054; position:sticky; top:0; font-weight: 800; }
tbody tr:hover { background: #fbfdff; }
.table-compact table { min-width: 0; }

.op { display:flex; align-items:flex-end; }

.att-item {
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px;
  margin-bottom:10px;
  background:#fff;
}

.att-title { font-weight:600; margin-bottom:6px; }

.student-item {
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 0;
  border-top:1px dashed #e7edf6;
  font-size:13px;
}

.student-item:first-child { border-top:0; }
.student-addr { margin:0 0 6px 26px; color:#5e6f89; font-size:12px; }

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

.menu-item {
  text-decoration: none;
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  color: #1d2939;
  background: linear-gradient(180deg, #fff 0, #f9fbfd 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.menu-item:hover {
  transform: translateY(-2px);
  border-color: #a8d3ca;
  box-shadow: 0 18px 36px rgba(15, 118, 110, .10);
}

.menu-item h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.menu-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.login-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-tip {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 128px;
  gap: 8px;
  align-items: center;
}

.captcha-img {
  width: 128px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  background: #f5f9ff;
}

.notice-img {
  margin-top: 10px;
  max-width: 260px;
  border-radius: 10px;
  border: 1px solid #dbe4f0;
}

h3 {
  margin: 0 0 10px;
}

.toast {
  position:fixed;
  left:50%;
  bottom:20px;
  transform:translateX(-50%);
  background:rgba(23,39,61,.92);
  color:#fff;
  padding:10px 14px;
  border-radius:14px;
  font-size:13px;
  max-width: min(520px, calc(100vw - 32px));
  line-height: 1.5;
  text-align: center;
  z-index:99;
}

@media (min-width: 860px) {
  .grid2 { grid-template-columns:1fr 1fr; }
}

@media (max-width: 640px) {
  .card-head {
    flex-direction: column;
  }

  .compact-actions,
  .form-actions {
    justify-content: flex-start;
  }

  .wide-select {
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 1080px) {
  body {
    background:
      linear-gradient(90deg, var(--sidebar) 0, var(--sidebar) 248px, transparent 248px),
      radial-gradient(circle at 34% 0, rgba(15, 118, 110, .10), transparent 32%),
      linear-gradient(180deg, #edf4fb 0, #f4f7fb 260px, #f4f7fb 100%);
  }

  .page {
    width: auto;
    min-height: 100vh;
    margin: 0 0 0 248px;
    padding: 28px 32px 48px;
  }

  .nav {
    position: fixed;
    left: 18px;
    top: 18px;
    bottom: 18px;
    z-index: 20;
    width: 212px;
    margin: 0;
    padding: 16px 12px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)),
      var(--sidebar-soft);
    box-shadow: 0 22px 55px rgba(0,0,0,.22);
  }

  .nav::before {
    content: "报名后台";
    display: block;
    margin: 2px 4px 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    color: #f8fafc;
    font-size: 18px;
    font-weight: 900;
  }

  .nav a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    color: #c8d4e5;
    border-color: transparent;
  }

  .nav a:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
  }

  .nav a.active {
    background: #e9fbf6;
    border-color: transparent;
    color: #0b5f56;
    box-shadow: 0 12px 22px rgba(0,0,0,.18);
  }

  .nav-spacer {
    display: block;
    flex: 1;
  }

  .nav-logout {
    margin-top: auto;
    width: 100%;
    background: rgba(255, 255, 255, .08);
    color: #ffe5e2;
    border-color: rgba(255, 255, 255, .12);
  }

  .hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    min-height: 92px;
  }

  .hero::after {
    content: "管理工作台";
    border: 1px solid #cce5df;
    border-radius: 999px;
    padding: 7px 12px;
    background: #effaf7;
    color: var(--primary-strong);
    font-size: 13px;
    font-weight: 800;
  }

  .class-workbench {
    grid-template-columns: 230px minmax(0, 1fr);
    align-items: start;
  }

  .class-subnav {
    position: sticky;
    top: 28px;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 16px;
  }

  .class-subnav-title {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }

  .class-subnav .shortcut-item {
    min-height: 70px;
  }
}
