
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {

  --primary: #10b981;

  --primary-dark: #059669;

  --primary-soft: #ecfdf5;

  --text: #0f172a;

  --text-sub: #475569;

  --text-light: #94a3b8;

  --bg: #f1f5f9;

  --border: #e2e8f0;

  --border-light: #f1f5f9;

  --danger: #ef4444;

  --warn: #f59e0b;

  --shadow-sm: 0 1px 3px rgba(15,23,42,.06);

  --shadow-md: 0 4px 6px -1px rgba(15,23,42,.07);

  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,.08);

  --shadow-xl: 0 20px 25px -5px rgba(15,23,42,.1);

}

html, body { height: 100%; }

body {

  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;

  color: var(--text);

  background: var(--bg);

  font-size: 14px;

  line-height: 1.55;

  -webkit-font-smoothing: antialiased;

}

a { color: var(--primary); text-decoration: none; transition: color .15s; }

a:hover { color: var(--primary-dark); }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }

::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }



/* ===================== 登录页 ===================== */

body.login-page {

  background: linear-gradient(135deg, #0f2027 0%, #1a3d3d 50%, #0d1b1b 100%);

  position: relative;

}

.login-wrap {

  min-height: 100vh;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 40px 20px;

}

.login-card {

  width: 100%;

  max-width: 480px;

  background: #ffffff;

  border-radius: 20px;

  box-shadow: 0 25px 60px -10px rgba(0,0,0,.5);

  padding: 48px 44px 32px;

}

.login-logo { text-align: center; margin-bottom: 24px; }

.login-logo img { height: 64px; max-width: 220px; object-fit: contain; }

.login-logo .fallback { font-size: 32px; font-weight: 800; color: #10b981; letter-spacing: 2px; }



.login-title {

  text-align: center;

  font-size: 26px;

  font-weight: 700;

  color: #0f172a;

  margin-bottom: 8px;

  letter-spacing: .5px;

}

.login-subtitle {

  text-align: center;

  font-size: 12px;

  color: #94a3b8;

  margin-bottom: 36px;

  letter-spacing: 2.5px;

  font-weight: 500;

}



.form-group { margin-bottom: 22px; }

.form-group label {

  display: block;

  font-size: 14px;

  color: #334155;

  margin-bottom: 10px;

  font-weight: 600;

}

.input-wrap { position: relative; }

.input-wrap .input-icon {

  position: absolute;

  left: 16px;

  top: 50%;

  transform: translateY(-50%);

  width: 20px !important;

  height: 20px !important;

  color: #94a3b8;

  pointer-events: none;

  transition: color .2s;

}

.input-wrap input {

  width: 100%;

  height: 52px;

  padding: 0 16px 0 48px;

  border: 1.5px solid #e2e8f0;

  border-radius: 12px;

  font-size: 15px;

  color: #0f172a;

  background: #fff;

  outline: none;

  transition: all .2s;

}

.input-wrap input::placeholder { color: #cbd5e1; }

.input-wrap input:hover { border-color: #cbd5e1; }

.input-wrap input:focus {

  border-color: #10b981;

  box-shadow: 0 0 0 4px rgba(16,185,129,.14);

}

.input-wrap input:focus ~ .input-icon { color: #10b981; }



.btn-login {

  width: 100%;

  height: 56px;

  border: none;

  border-radius: 12px;

  background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);

  color: #fff;

  font-size: 18px;

  font-weight: 700;

  letter-spacing: 8px;

  text-indent: 8px;

  cursor: pointer;

  transition: all .2s;

  box-shadow: 0 8px 20px -4px rgba(16,185,129,.5);

  margin-top: 6px;

}

.btn-login:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -4px rgba(16,185,129,.6); }

.btn-login:active { transform: translateY(0); }

.btn-login:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }



.error-tip {

  color: #ef4444;

  font-size: 13px;

  text-align: center;

  min-height: 18px;

  margin: 8px 0 12px;

}

.login-hint {

  text-align: center;

  margin-top: 18px;

  font-size: 13px;

  color: #94a3b8;

}

.login-hint code {

  background: #ecfdf5;

  color: #059669;

  padding: 3px 10px;

  border-radius: 6px;

  font-size: 12px;

  margin: 0 3px;

  font-weight: 600;

}

.login-footer {

  text-align: center;

  margin-top: 28px;

  padding-top: 22px;

  border-top: 1px dashed #e2e8f0;

  color: #94a3b8;

  font-size: 13px;

  line-height: 1.7;

}

.login-footer .company { color: #64748b; margin-bottom: 4px; }

.login-footer .copy { color: #cbd5e1; font-size: 12px; }



@media (max-width: 520px) {

  .login-card { padding: 36px 26px 24px; border-radius: 16px; }

  .login-title { font-size: 22px; }

  .login-logo img { height: 52px; }

}



/* ===================== 主框架 ===================== */

.layout { display: flex; min-height: 100vh; }

.sidebar {

  width: 232px;

  background: #fff;

  border-right: 1px solid var(--border);

  display: flex;

  flex-direction: column;

  flex-shrink: 0;

}

.sidebar .brand {

  height: 64px;

  display: flex;

  align-items: center;

  padding: 0 22px;

  border-bottom: 1px solid var(--border-light);

  font-weight: 700;

  color: var(--primary-dark);

  font-size: 15px;

  background: linear-gradient(135deg, #fff 0%, #f0fdf4 100%);

}

.sidebar .brand::before {

  content: "";

  width: 8px; height: 8px;

  border-radius: 50%;

  background: linear-gradient(135deg, #10b981, #059669);

  margin-right: 10px;

  box-shadow: 0 0 0 4px rgba(16,185,129,.15);

}

.sidebar .menu { flex: 1; padding: 10px 12px; overflow-y: auto; }

.sidebar .menu a {

  display: flex;

  align-items: center;

  height: 42px;

  padding: 0 14px;

  margin-bottom: 2px;

  color: var(--text-sub);

  font-size: 14px;

  border-radius: 8px;

  transition: all .15s;

  font-weight: 500;

}

.sidebar .menu a::before {

  content: "";

  width: 6px; height: 6px;

  border-radius: 50%;

  background: #cbd5e1;

  margin-right: 12px;

  transition: all .15s;

  flex-shrink: 0;

}

.sidebar .menu a:hover { background: var(--primary-soft); color: var(--primary-dark); }

.sidebar .menu a:hover::before { background: var(--primary); }

.sidebar .menu a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

.sidebar .menu a.active::before {

  background: var(--primary);

  box-shadow: 0 0 0 3px rgba(16,185,129,.18);

}

.sidebar .user-box {

  padding: 16px 22px;

  border-top: 1px solid var(--border-light);

  font-size: 13px;

  color: var(--text-light);

}

.sidebar .user-box .name { color: var(--text); font-weight: 600; margin-bottom: 6px; font-size: 14px; }

.sidebar .user-box a { font-size: 12px; color: var(--text-light); }

.sidebar .user-box a:hover { color: var(--danger); }



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

.topbar {

  height: 64px;

  background: #fff;

  border-bottom: 1px solid var(--border);

  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: 0 28px;

  flex-shrink: 0;

}

.topbar .title { font-size: 17px; font-weight: 700; color: var(--text); }

.topbar .role {

  font-size: 12px;

  color: var(--primary-dark);

  padding: 5px 12px;

  background: var(--primary-soft);

  border-radius: 20px;

  font-weight: 500;

}

.content { flex: 1; padding: 24px 28px 40px; overflow-y: auto; }



.card {

  background: #fff;

  border-radius: 12px;

  box-shadow: var(--shadow-sm);

  padding: 24px;

  border: 1px solid var(--border-light);

}

.card h2 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

.hint { color: var(--text-light); font-size: 13px; line-height: 1.7; }



/* ===================== 表格 ===================== */

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }

table thead th {

  background: #f8fafc;

  color: var(--text-sub);

  font-weight: 600;

  padding: 12px 14px;

  text-align: left;

  border-bottom: 1px solid var(--border);

  white-space: nowrap;

}

table thead th:first-child { border-top-left-radius: 8px; }

table thead th:last-child { border-top-right-radius: 8px; }

table tbody td {

  padding: 13px 14px;

  border-bottom: 1px solid var(--border-light);

  vertical-align: middle;

}

table tbody tr { transition: background .12s; }

table tbody tr:hover { background: #f8fafc; }

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



/* ===================== 徽章 ===================== */

.tag {

  display: inline-flex;

  align-items: center;

  padding: 3px 10px;

  border-radius: 20px;

  font-size: 11.5px;

  font-weight: 600;

  background: #d1fae5;

  color: #059669;

}

.tag.gray { background: #f1f5f9; color: #475569; }

.tag.warn { background: #fffbeb; color: #b45309; }

.tag.red { background: #fef2f2; color: #b91c1c; }

.tag.blue { background: #eff6ff; color: #1d4ed8; }



/* ===================== 统计卡 ===================== */

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }

.stat {

  background: #fff;

  border-radius: 12px;

  padding: 20px 22px;

  box-shadow: var(--shadow-sm);

  border: 1px solid var(--border-light);

  transition: all .2s;

}

.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat .k { font-size: 12px; color: var(--text-light); margin-bottom: 8px; font-weight: 500; }

.stat .v { font-size: 28px; font-weight: 700; color: var(--primary-dark); line-height: 1.1; }

.stat .v.gray { color: var(--text); }

.stat .v.red { color: var(--danger); }



/* ===================== 周课表 ===================== */

.week-grid {

  display: grid;

  grid-template-columns: 64px repeat(7, 1fr);

  border: 1px solid var(--border);

  border-radius: 12px;

  overflow: hidden;

  font-size: 12px;

  background: #fff;

}

.week-grid .hdr {

  background: #f8fafc;

  padding: 12px 4px;

  text-align: center;

  font-weight: 600;

  color: var(--text-sub);

  border-bottom: 1px solid var(--border);

}

.week-grid .sec {

  background: #f8fafc;

  padding: 8px 4px;

  text-align: center;

  color: var(--text-light);

  border-bottom: 1px solid var(--border-light);

  border-right: 1px solid var(--border);

  font-weight: 500;

}

.week-grid .cell {

  min-height: 56px;

  padding: 4px;

  border-bottom: 1px solid var(--border-light);

  border-right: 1px solid var(--border-light);

}

.week-grid .cell:last-child { border-right: none; }

.week-grid .card {

  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);

  border-left: 3px solid var(--primary);

  border-radius: 6px;

  padding: 5px 7px;

  font-size: 11px;

  line-height: 1.4;

  color: #065f46;

}

.week-grid .card .n { font-weight: 700; margin-bottom: 2px; }



/* ===================== 图表 ===================== */

.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.chart-box {

  background: #fff;

  border-radius: 12px;

  padding: 18px 20px;

  box-shadow: var(--shadow-sm);

  border: 1px solid var(--border-light);

}

.chart-box h3 { font-size: 14px; margin-bottom: 12px; color: var(--text-sub); font-weight: 600; }

.chart { height: 280px; }



/* ===================== 提示条 ===================== */

.notice-bar {

  background: var(--primary-soft);

  color: var(--primary-dark);

  padding: 12px 18px;

  border-radius: 8px;

  margin-bottom: 16px;

  font-size: 13px;

  border-left: 3px solid var(--primary);

}

.notice-bar.warn { background: #fffbeb; color: #92400e; border-left-color: var(--warn); }



/* ===================== 分页 ===================== */

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

.pager button {

  height: 32px;

  padding: 0 12px;

  border: 1px solid var(--border);

  border-radius: 6px;

  background: #fff;

  color: var(--text-sub);

}

.pager button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }

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



/* ===================== Toast ===================== */

#toast {

  position: fixed;

  top: 24px;

  left: 50%;

  transform: translateX(-50%) translateY(-20px);

  background: var(--text);

  color: #fff;

  padding: 12px 22px;

  border-radius: 8px;

  font-size: 13px;

  opacity: 0;

  transition: all .25s;

  z-index: 9999;

  box-shadow: var(--shadow-lg);

  pointer-events: none;

  font-weight: 500;

}

#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }



/* ===================== 模态 ===================== */

.modal-mask, [id="modal"] { animation: fadeIn .2s; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-mask > div, [id="modal"] > div {

  animation: modalIn .25s cubic-bezier(.16, 1, .3, 1);

  box-shadow: var(--shadow-xl) !important;

}

@keyframes modalIn {

  from { opacity: 0; transform: translateY(8px) scale(.97); }

  to { opacity: 1; transform: translateY(0) scale(1); }

}



@media (max-width: 900px) {

  .sidebar { width: 200px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .chart-row { grid-template-columns: 1fr; }

  .content { padding: 16px; }

}

