/* 三少教务系统 · 视觉层
   配色取自三少品牌：深墨绿 / 碳灰 / 军绿，克制的金色用于警示 */
:root {
  --ink: #17211d;
  --ink-2: #22322b;
  --line: #e3e6e1;
  --bg: #f4f5f2;
  --card: #ffffff;
  --accent: #2f6b4f;
  --accent-soft: #e8f0ea;
  --gold: #b8873a;
  --danger: #b5462f;
  --muted: #6b7770;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
}

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  width: 216px;
  flex: 0 0 216px;
  background: linear-gradient(180deg, #17211d 0%, #1d2b24 100%);
  color: #dfe6e0;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}

.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 40px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
}

.brand strong { display: block; font-size: 15px; letter-spacing: 1px; }
.brand small { color: #8ea398; font-size: 10.5px; white-space: nowrap; letter-spacing: 0; }

nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  color: #cdd8d0;
  text-decoration: none;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
nav a.sub-link { padding: 6px 12px 6px 26px; font-size: 12.5px; color: #9fb0a6; }
nav a.sub-link:hover { color: #fff; }

.sidefoot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  font-size: 12px;
  color: #8ea398;
}

.sidefoot a { color: #8ea398; text-decoration: none; }
.sidefoot a:hover { color: #fff; }

/* ---------------- 主区 ---------------- */
main {
  flex: 1;
  min-width: 0;
  padding: 22px 28px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.topbar h1 { font-size: 21px; margin: 0; letter-spacing: 0.5px; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.who {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------- 卡片 / 统计 ---------------- */
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: 0.5px; }
.stat .value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stat.warn .value { color: var(--danger); }

h2.section {
  font-size: 15px;
  margin: 22px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
h2.section::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; background: var(--card); }
thead th {
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--muted);
  background: #fafbf9;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  white-space: nowrap;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid #eef0ec; vertical-align: middle; white-space: nowrap; }
tbody tr:hover { background: #fbfcfb; }
table.bordered { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.num { font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 22px; text-align: center; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.tag.gold { background: #fbf2e2; color: var(--gold); }
.tag.red { background: #fbebe7; color: var(--danger); }
.tag.gray { background: #f0f1ee; color: var(--muted); }

/* ---------------- 按钮 / 表单 ---------------- */
.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: #f7f8f6; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.danger { background: var(--danger); }

input, select, textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.1); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.fields .span2 { grid-column: span 2; }
.fields .span3 { grid-column: span 3; }

.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
}

details.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 14px;
}
details.panel summary { cursor: pointer; font-weight: 600; color: var(--accent); font-size: 13px; }
details.panel[open] summary { margin-bottom: 14px; }

/* ---------------- 课表 ---------------- */
.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(134px, 1fr));
  gap: 10px;
}
.week-scroll { overflow-x: auto; padding-bottom: 6px; }
.day {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 170px;
  padding: 10px;
}
.day.today { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.08); }
.day h3 { font-size: 12.5px; margin: 0 0 8px; color: var(--muted); display: flex; justify-content: space-between; }
.day h3.todayh { color: var(--accent); }
.slot {
  background: #f7faf8;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 7px;
  font-size: 12px;
}
.slot b { display: block; font-size: 12.5px; margin-bottom: 3px; }
.slot span { color: var(--muted); display: block; line-height: 1.6; }
.slot a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #2a3f35 0%, #17211d 55%, #10160f 100%);
}
.login-card {
  width: 356px;
  background: #fff;
  border-radius: 16px;
  padding: 34px 32px 28px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}
.login-card .logo-img { width: 56px; height: 56px; margin: 0 auto 12px; display: block; }
.login-card h1 { font-size: 19px; text-align: center; margin: 0 0 4px; }
.login-card p.sub { text-align: center; color: var(--muted); font-size: 12.5px; margin: 0 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; padding: 11px; margin-top: 6px; }
.alert { padding: 9px 12px; border-radius: 8px; font-size: 12.5px; margin-bottom: 14px; }
.alert.error { background: #fbebe7; color: var(--danger); }
.alert.ok { background: var(--accent-soft); color: var(--accent); }

/* 工作台差评报警 */
.card.alarm { background: #fdf4f2; border-color: #e8bcb2; margin-bottom: 18px; }
.alarm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.alarm-title { font-size: 15px; font-weight: 700; color: var(--danger); }

/* 工作台催费条 */
.card.chase-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-bottom: 18px; background: #fffbf2; border-color: #ead3a8; }
.card.chase-bar strong { color: var(--gold); font-size: 16px; }

.radio-row { display: flex; gap: 8px; align-items: center; }
.radio-row label { display: flex; align-items: center; gap: 5px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.radio-row input:checked + span { color: var(--accent); font-weight: 600; }

.hint { color: var(--muted); font-size: 12px; line-height: 1.7; white-space: normal; }
.wrap { white-space: normal; }
