/* =========================================================
   教之篮 · 运营后台
   桌面优先的表格型控制台，与家长端共用竹篮绿品牌色
   ========================================================= */

:root {
  --brand: #2f6b4f;
  --brand-2: #438a66;
  --brand-soft: #e8f2ec;
  --bg: #f3f6f3;
  --card: #ffffff;
  --ink: #1f2a24;
  --ink-2: #5d6b63;
  --ink-3: #93a09a;
  --line: #e4e8e4;
  --amber: #c07a1e;
  --amber-soft: #fdf1de;
  --rose: #b8433a;
  --rose-soft: #fbeae8;
  --blue: #2f6d9e;
  --blue-soft: #e8f1f8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(24, 38, 30, 0.05), 0 12px 28px -20px rgba(24, 38, 30, 0.35);
  --side: 224px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }

.side {
  width: var(--side);
  flex: none;
  background: #1e3a2c;
  color: #d7e5dc;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.side-brand img { width: 34px; height: 34px; }
.side-brand b { font-size: 16px; letter-spacing: 0.02em; color: #fff; display: block; line-height: 1.2; }
.side-brand span { font-size: 11px; color: #93b3a1; }
.side-nav { display: grid; gap: 3px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  text-decoration: none; color: #c6d8cd; font-size: 14px;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.side-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.side-nav a.on { background: #2f6b4f; color: #fff; font-weight: 600; }
.side-nav .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; }
/* 侧栏红点（算力余额偏低这类要立刻处理的事）：贴在对应菜单项右边 */
.side-nav a .nav-badge {
  margin-left: auto; padding: 1px 7px; border-radius: 9px;
  background: #B4483C; color: #fff; font-size: 11px; line-height: 17px; white-space: nowrap;
}
.side-foot { margin-top: auto; font-size: 11.5px; color: #7fa08d; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 26px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); }
.content { padding: 22px 26px 60px; max-width: 1400px; width: 100%; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .side { position: static; height: auto; width: 100%; padding: 12px; }
  .side-brand { padding-bottom: 10px; }
  .side-nav { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .side-nav a { white-space: nowrap; }
  .side-foot { display: none; }
  .content, .topbar { padding-left: 14px; padding-right: 14px; }
}

/* ---------- 卡片 / 栅格 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 15px; margin: 0; }
.card-head .hint { font-size: 12.5px; color: var(--ink-3); }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.c4, .grid.c6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 780px) { .grid.c2, .grid.c3, .grid.c4, .grid.c6 { grid-template-columns: 1fr; } }
.mt { margin-top: 14px; }
.mt-lg { margin-top: 22px; }

/* KPI */
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .label { font-size: 12.5px; color: var(--ink-3); }
.kpi .num { font-size: 28px; font-weight: 700; line-height: 1.3; margin-top: 4px; }
.kpi .foot { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi .num small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--ink-3); font-weight: 600; background: #fafbfa; white-space: nowrap; position: sticky; top: 0; }
tbody tr:hover { background: #fafcfb; }
td.num { font-variant-numeric: tabular-nums; }
td.act { white-space: nowrap; }
.clip { max-width: 420px; }
.clip p { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 讲课凭证缩略图 */
.thumbs { display: flex; gap: 6px; margin-top: 8px; }
.thumb {
  position: relative; width: 62px; height: 62px; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; background: none; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-kind {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 10px; line-height: 1.4; text-align: center;
  background: rgba(31, 42, 36, 0.72); color: #fff;
}

/* ---------- 标签 / 徽章 ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: #f0f3f1; color: var(--ink-2); white-space: nowrap; }
.tag--brand { background: var(--brand-soft); color: var(--brand); }
.tag--amber { background: var(--amber-soft); color: var(--amber); }
.tag--rose { background: var(--rose-soft); color: var(--rose); }
.tag--blue { background: var(--blue-soft); color: var(--blue); }

/* ---------- 按钮 / 表单 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13.5px; font-family: inherit;
  cursor: pointer; text-decoration: none; transition: all 0.18s ease; white-space: nowrap;
}
.btn:hover { border-color: #cfd8d2; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-primary:hover { background: #275b43; border-color: #275b43; }
.btn-soft { background: var(--brand-soft); border-color: #cfe0d5; color: var(--brand); }
.btn-danger { background: #fff; border-color: #e6c4c0; color: var(--rose); }
.btn-danger:hover { background: var(--rose-soft); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 13.5px; color: var(--ink); background: #fff; outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(67, 138, 102, 0.13); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .input, .toolbar .select { width: auto; min-width: 160px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }

/* ---------- 条形图 ---------- */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 52px; align-items: center; gap: 10px; font-size: 13px; }
.bar-track { height: 9px; background: #f0f3f1; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6fae8c, var(--brand)); transition: width 0.7s cubic-bezier(.2,.7,.3,1); }
.bar-row .v { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- 弹层 / 提示 ---------- */
.modal { position: fixed; inset: 0; background: rgba(20, 32, 26, 0.45); display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 60; overflow: auto; }
.modal.on { display: flex; }
.modal-panel { background: #fff; border-radius: 16px; width: 100%; max-width: 620px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.4); }
.modal-panel header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-panel header h3 { margin: 0; font-size: 16px; }
.modal-panel .body { padding: 18px 20px; }
.modal-panel footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 12px);
  background: rgba(31, 42, 36, 0.95); color: #f2f6f3; padding: 10px 18px;
  border-radius: 999px; font-size: 13.5px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease; z-index: 80;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.muted { color: var(--ink-3); }
.tiny { font-size: 12px; color: var(--ink-3); }
.nowrap { white-space: nowrap; }

/* ---------- 待办中心 ---------- */
.todo-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: 12px; margin-bottom: 10px; background: #fff;
}
.todo-row:last-child { margin-bottom: 0; }
.todo-row--warn { border-left-color: var(--rose); background: linear-gradient(90deg, var(--rose-soft), #fff 42%); }
.todo-row-main { flex: 1 1 auto; min-width: 0; }
.todo-row-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--ink); }
.todo-row-go { flex: 0 0 auto; }
@media (max-width: 780px) { .todo-row { flex-wrap: wrap; } .todo-row-go { width: 100%; } .todo-row-go .btn { width: 100%; justify-content: center; } }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(40rem 30rem at 20% 0%, #e8f2ec, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 28px; }
.login-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-card .brand img { width: 44px; height: 44px; }
.login-card .brand b { font-size: 19px; display: block; }
.login-card .brand span { font-size: 12px; color: var(--ink-3); }
