/* ============================================================
   寰宇教育管理后台样式（简约白）
   ============================================================ */
:root {
  --ink: #1c2333; --ink-2: #4a5568; --ink-3: #8a94a6;
  --line: #e8ecf3; --accent: #2f6bff; --accent-dark: #1f52d8;
  --accent-soft: #eef4ff; --bg-alt: #f7f9fc; --white: #fff;
  --ok: #17a673; --warn: #e08a1e; --danger: #e0493f;
  --radius: 12px; --shadow: 0 10px 30px rgba(28,35,51,.07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* hidden 属性必须始终生效（防止 display:flex 等规则覆盖导致弹窗无法隐藏） */
[hidden] { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg-alt); font-size: 14.5px; line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
input, textarea, select, button { font-family: inherit; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 40px 38px; width: 100%; max-width: 380px; text-align: center;
}
.login-card img { margin: 0 auto 14px; }
.login-card h1 { font-size: 20px; margin-bottom: 2px; }
.login-sub { font-size: 12px; color: var(--ink-3); letter-spacing: 1px; margin-bottom: 26px; }
.login-card label { display: block; text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 14px; }
.login-card input {
  width: 100%; margin-top: 5px; padding: 11px 14px; font-size: 14.5px;
  border: 1.5px solid var(--line); border-radius: 10px; outline: none;
}
.login-card input:focus { border-color: var(--accent); }
.login-err { color: var(--danger); font-size: 13px; margin-top: 12px; }
.back-link { display: inline-block; margin-top: 18px; font-size: 13px; color: var(--ink-3); }
.back-link:hover { color: var(--accent); }

/* ---------- 布局 ---------- */
#appView { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--white); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 20;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.side-brand small { display: block; font-size: 10px; color: var(--ink-3); letter-spacing: 1px; font-weight: 500; }
.side-nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  text-align: left; padding: 11px 14px; border: none; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--ink-2); font-size: 14.5px; transition: all .15s;
}
.nav-item:hover { background: var(--bg-alt); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-foot { padding: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-foot span { font-size: 13px; color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; margin-left: 220px; padding: 30px 36px; max-width: 1200px; }
.page-title { font-size: 24px; margin-bottom: 22px; }

/* ---------- 统计卡片 ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px; box-shadow: 0 2px 8px rgba(28,35,51,.03);
}
.stat-card b { display: block; font-size: 24px; margin-bottom: 2px; }
.stat-card span { font-size: 13px; color: var(--ink-3); }
.stat-card.warn b { color: var(--warn); }
.stat-card.ok b { color: var(--ok); }
.stat-card.accent b { color: var(--accent); }

/* ---------- 面板/表格 ---------- */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 24px; }
.panel h3 { font-size: 16px; margin-bottom: 14px; }
.panel.narrow { max-width: 520px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 10px 12px; color: var(--ink-3); font-weight: 600;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-alt);
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafbfe; }
.muted { color: var(--ink-3); font-size: 13px; }

/* 状态徽章 */
.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.pending { background: #fdf3e3; color: var(--warn); }
.badge.paid { background: #e7f8f1; color: var(--ok); }
.badge.completed { background: #eef4ff; color: var(--accent); }
.badge.cancelled { background: #f3f4f7; color: var(--ink-3); }

/* 行内操作 */
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 999px; font-size: 13px;
  font-weight: 600; border: none; cursor: pointer; transition: all .15s; text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-line { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-danger { background: #fbeae8; color: var(--danger); }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  color: var(--ink-2); font-size: 13px; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.search {
  padding: 9px 16px; border: 1.5px solid var(--line); border-radius: 999px; width: 260px;
  font-size: 13.5px; outline: none; background: #fff;
}
.search:focus { border-color: var(--accent); }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; align-items: center; }
.pager button {
  min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 13px; color: var(--ink-2);
}
.pager button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager span { font-size: 13px; color: var(--ink-3); padding: 0 8px; }

/* ---------- 表单 ---------- */
form label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
form input, form textarea {
  width: 100%; margin-top: 5px; padding: 10px 13px; font-size: 14px;
  border: 1.5px solid var(--line); border-radius: 10px; outline: none; background: #fff;
}
form input:focus, form textarea:focus { border-color: var(--accent); }
form textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-check { display: flex; gap: 22px; margin: 6px 0 18px; }
.form-check label { font-weight: 500; display: flex; align-items: center; gap: 6px; margin: 0; }
.form-check input { width: auto; margin: 0; }
.sep { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(20,26,40,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px);
}
.modal {
  background: var(--white); border-radius: 18px; width: 100%; max-width: 620px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 18px 50px rgba(28,35,51,.16); position: relative;
  animation: pop .22s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 14px; right: 16px; z-index: 2; width: 34px; height: 34px;
  border-radius: 50%; border: none; cursor: pointer; background: var(--bg-alt);
  color: var(--ink-2); font-size: 20px; line-height: 1;
}
.modal-close:hover { background: var(--line); }
.modal-body { padding: 30px 32px 26px; }
.modal-title { font-size: 19px; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 14px; padding: 11px 22px;
  border-radius: 999px; z-index: 200; box-shadow: 0 18px 50px rgba(28,35,51,.2);
}
.toast.err { background: var(--danger); }

@media (max-width: 900px) {
  .sidebar { width: 76px; }
  .side-brand span, .nav-item { font-size: 0; }
  .nav-item { text-align: center; padding: 14px 6px; }
  .side-foot { flex-direction: column; }
  .side-foot span { display: none; }
  .main { margin-left: 76px; padding: 22px 16px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}
