/* ============================================================
   码栈少儿编程 · 教务管理系统 全局样式
   设计基调：明亮清爽 + 科技蓝紫，适配电脑 / 平板 / 手机
   ============================================================ */
:root {
  --brand: #4f7cff;
  --brand-2: #7a5cff;
  --brand-grad: linear-gradient(135deg, #4f7cff 0%, #7a5cff 100%);
  --ok: #00b894;
  --warn: #f0a500;
  --danger: #ff5c5c;
  --info: #7d8aa5;
  --text-1: #1f2b45;
  --text-2: #5a6a85;
  --text-3: #93a0b5;
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #eaeef6;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(31, 43, 69, .06);
  --shadow-lg: 0 8px 28px rgba(31, 43, 69, .1);
  --side-w: 224px;
  --side-w-mini: 64px;
  --header-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text-1);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; -webkit-font-smoothing: antialiased;
}
#app { height: 100%; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3dae8; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #b9c3d6; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 启动 loading ---------------- */
.boot-loading {
  height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; color: var(--text-2);
}
.boot-logo {
  width: 72px; height: 72px; border-radius: 20px; background: var(--brand-grad);
  color: #fff; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  animation: floaty 1.6s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }

/* ============================================================
   登录页
   ============================================================ */
.login-page {
  min-height: 100vh; display: flex; position: relative; overflow: hidden; padding-bottom: 46px;
  background: linear-gradient(135deg, #eef3ff 0%, #f7f4ff 50%, #eefaf6 100%);
}
.login-page .app-footer {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  background: transparent; border-top: none;
}
.login-page .blob {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5;
}
.login-page .blob1 { width: 420px; height: 420px; background: #b9cbff; top: -120px; left: -80px; }
.login-page .blob2 { width: 380px; height: 380px; background: #d9c8ff; bottom: -140px; right: 10%; }
.login-page .blob3 { width: 300px; height: 300px; background: #bdf0dd; top: 40%; right: -80px; }

.login-left {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 0 6vw; position: relative; z-index: 2;
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-brand .mark {
  width: 56px; height: 56px; border-radius: 16px; background: var(--brand-grad);
  color: #fff; font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(79, 124, 255, .35);
}
.login-brand h1 { margin: 0; font-size: 24px; letter-spacing: 1px; }
.login-brand p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.login-title { font-size: 40px; font-weight: 800; line-height: 1.3; margin: 0 0 14px; }
.login-title span { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-desc { color: var(--text-2); font-size: 15px; line-height: 2; margin-bottom: 26px; max-width: 520px; }
.login-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.login-tags span {
  padding: 7px 14px; background: rgba(255,255,255,.8); border: 1px solid #e3e9f7;
  border-radius: 999px; font-size: 13px; color: var(--text-2);
}

.login-right { width: 460px; display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 2; }
.login-card {
  width: 100%; background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-radius: 20px; padding: 34px 32px; box-shadow: 0 18px 50px rgba(31,43,69,.12);
  border: 1px solid rgba(255,255,255,.9);
}
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-card .sub { color: var(--text-3); font-size: 13px; margin-bottom: 24px; }
.captcha-box { display: flex; gap: 10px; }
.captcha-img {
  width: 120px; height: 40px; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); flex: none; background: #f2f6ff;
}
.captcha-img svg { display: block; }
.login-tips {
  margin-top: 18px; padding: 12px 14px; background: #f6f8ff;
  border: 1px dashed #d9e2ff; border-radius: 10px; font-size: 12px; color: var(--text-2); line-height: 1.9;
}
.login-tips b { color: var(--brand); }
.login-tips .row { display: flex; justify-content: space-between; gap: 8px; }
.login-tips .row a { color: var(--brand); cursor: pointer; }

/* ============================================================
   主框架
   ============================================================ */
.layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--side-w); flex: none; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; transition: width .22s ease; z-index: 20;
}
.sidebar.mini { width: var(--side-w-mini); }
.side-logo {
  height: var(--header-h); display: flex; align-items: center; gap: 10px;
  padding: 0 16px; border-bottom: 1px solid var(--line); overflow: hidden; flex: none;
}
.side-logo .mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand-grad);
  color: #fff; font-weight: 800; font-size: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.side-logo .txt { font-weight: 700; font-size: 15px; white-space: nowrap; }
.side-logo .txt small { display: block; font-weight: 400; font-size: 11px; color: var(--text-3); }
.side-menu { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 0; }
.side-menu .el-menu { border-right: none; }
.side-item-badge { margin-left: auto; }

.side-foot {
  padding: 10px; border-top: 1px solid var(--line); display: flex; justify-content: center;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header {
  height: var(--header-h); flex: none; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 16px; z-index: 10;
}
.header .fold { cursor: pointer; color: var(--text-2); font-size: 20px; display: flex; }
.header .crumb { font-size: 15px; font-weight: 600; }
.header .crumb small { font-weight: 400; color: var(--text-3); margin-left: 8px; font-size: 12px; }
.header .spacer { flex: 1; }
.header .h-btn {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: var(--text-2); font-size: 17px;
}
.header .h-btn:hover { background: #f2f5fc; color: var(--brand); }
.header .u-box { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 8px; border-radius: 10px; }
.header .u-box:hover { background: #f2f5fc; }
.header .u-name { line-height: 1.25; }
.header .u-name b { display: block; font-size: 13px; }
.header .u-name small { color: var(--text-3); font-size: 11px; }

.page {
  flex: 1; overflow-y: auto; padding: 16px; scroll-behavior: smooth;
}

/* 全局底部备案信息 */
.app-footer {
  flex: none; height: 40px; display: flex; align-items: center; justify-content: center;
  gap: 14px; font-size: 12px; background: var(--card); border-top: 1px solid var(--line);
}
.app-footer .cp { color: var(--text-3); }
.app-footer .beian { color: var(--text-2); text-decoration: none; transition: color .15s; }
.app-footer .beian:hover { color: var(--brand); }

/* ---------------- 通用卡片 / 工具条 ---------------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px; border: 1px solid rgba(234,238,246,.9);
}
.card.pad0 { padding: 0; }
.card-hd {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-hd h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-hd h3::before {
  content: ''; width: 4px; height: 15px; border-radius: 3px; background: var(--brand-grad);
}
.card-hd .spacer { flex: 1; }
.card-hd .sub { color: var(--text-3); font-size: 12px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-bar .el-input, .filter-bar .el-select, .filter-bar .el-date-editor { width: 180px; }
.filter-bar .w120 { width: 120px; }
.filter-bar .w150 { width: 150px; }
.filter-bar .w240 { width: 240px; }
.tool-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.tool-bar .spacer { flex: 1; }

.pager { display: flex; justify-content: flex-end; padding: 14px 4px 2px; }

/* ---------------- 数据卡片 ---------------- */
.stat-card {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 18px;
  background: #fff; box-shadow: var(--shadow); cursor: pointer; transition: all .2s;
  border: 1px solid rgba(234,238,246,.9); height: 100%;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card .ico {
  position: absolute; right: 14px; top: 14px; width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.stat-card .label { color: var(--text-2); font-size: 13px; margin-bottom: 8px; }
.stat-card .value { font-size: 27px; font-weight: 800; line-height: 1.2; letter-spacing: -.5px; }
.stat-card .value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat-card .foot {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
  display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap;
}
.stat-card .foot b { color: var(--text-1); }
.stat-card .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }

.mini-stat {
  background: #fff; border-radius: 12px; padding: 14px; text-align: center;
  border: 1px solid var(--line);
}
.mini-stat .v { font-size: 21px; font-weight: 800; }
.mini-stat .l { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.chart-box { width: 100%; height: 300px; }
.chart-box.sm { height: 260px; }

/* ---------------- 排课日历 ---------------- */
.cal-week { display: grid; grid-template-columns: 62px repeat(7, 1fr); gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; }
.cal-week .cell { background: #fff; min-height: 62px; padding: 5px; }
.cal-week .head { background: #fafbff; text-align: center; padding: 9px 4px; font-size: 13px; font-weight: 600; min-height: auto; }
.cal-week .head.today { color: var(--brand); background: #eef3ff; }
.cal-week .head small { display: block; font-weight: 400; color: var(--text-3); font-size: 11px; }
.cal-week .time { background: #fafbff; font-size: 11px; color: var(--text-3); text-align: center; padding-top: 8px; }

.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; }
.cal-month .head { background: #fafbff; text-align: center; padding: 9px 4px; font-size: 13px; font-weight: 600; }
.cal-month .day { background: #fff; min-height: 104px; padding: 6px; }
.cal-month .day.out { background: #fbfcfe; }
.cal-month .day .dnum { font-size: 12px; color: var(--text-2); margin-bottom: 4px; font-weight: 600; }
.cal-month .day.today .dnum { color: #fff; background: var(--brand); width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.lesson-chip {
  border-radius: 7px; padding: 4px 7px; margin-bottom: 4px; cursor: pointer;
  font-size: 12px; line-height: 1.4; color: #fff; overflow: hidden;
  transition: transform .15s;
}
.lesson-chip:hover { transform: scale(1.02); }
.lesson-chip b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-chip small { opacity: .9; font-size: 11px; }
.lesson-chip.cancelled { opacity: .5; text-decoration: line-through; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }

/* ---------------- 其他 ---------------- */
.tag-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.txt-2 { color: var(--text-2); }
.txt-3 { color: var(--text-3); }
.txt-sm { font-size: 12px; }
.bold { font-weight: 700; }
.money { font-weight: 700; color: #e8543f; }
.money.in { color: #e8543f; }
.money.out { color: #00a878; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flex-col { display: flex; flex-direction: column; }
.gap12 { gap: 12px; } .gap16 { gap: 16px; }
.w100 { width: 100%; }
.nowrap { white-space: nowrap; }
.pointer { cursor: pointer; }
.link { color: var(--brand); cursor: pointer; }
.link:hover { text-decoration: underline; }

.avatar-c {
  width: 34px; height: 34px; border-radius: 10px; color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.progress-mini { height: 6px; border-radius: 4px; background: #eef1f8; overflow: hidden; }
.progress-mini i { display: block; height: 100%; border-radius: 4px; background: var(--brand-grad); }

.todo-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px;
  background: #fafbff; margin-bottom: 8px; cursor: pointer; border: 1px solid transparent;
  transition: all .18s;
}
.todo-item:hover { background: #f2f6ff; border-color: #dde6ff; }
.todo-item .ti-ico {
  width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 15px; flex: none;
}
.todo-item .ti-txt { flex: 1; min-width: 0; }
.todo-item .ti-txt b { font-size: 13px; display: block; }
.todo-item .ti-txt small { color: var(--text-3); font-size: 12px; }

.timeline-log { font-size: 12px; }
.timeline-log .row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.timeline-log .row:last-child { border-bottom: none; }
.timeline-log .t { color: var(--text-3); flex: none; width: 92px; }

.empty-box { padding: 34px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.empty-box .ei { font-size: 34px; opacity: .35; display: block; margin-bottom: 8px; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.detail-grid .di { background: #fafbff; border-radius: 10px; padding: 11px 13px; }
.detail-grid .di .l { color: var(--text-3); font-size: 12px; margin-bottom: 4px; }
.detail-grid .di .v { font-size: 14px; font-weight: 600; word-break: break-all; }

.perm-group { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.perm-group .pg-hd {
  background: #fafbff; padding: 9px 13px; font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: space-between;
}
.perm-group .pg-bd { padding: 11px 13px; display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* Element Plus 覆写 */
.el-card, .el-dialog { border-radius: var(--radius) !important; }
.el-table th.el-table__cell { background: #fafbff !important; color: var(--text-2) !important; font-weight: 600 !important; }
.el-table .el-table__cell { padding: 9px 0 !important; }
.el-button { border-radius: 9px !important; }
.el-input__wrapper, .el-select__wrapper, .el-textarea__inner { border-radius: 9px !important; }
.el-tag { border-radius: 7px !important; }
.el-drawer__body { padding: 16px !important; }
.el-menu-item, .el-sub-menu__title { border-radius: 9px; margin: 2px 8px; height: 44px; line-height: 44px; }
.el-menu-item:hover, .el-sub-menu__title:hover { background: rgba(79,124,255,.08) !important; }
.el-menu-item.is-active { background: linear-gradient(135deg, rgba(79,124,255,.14), rgba(122,92,255,.12)) !important; font-weight: 600; color: var(--brand) !important; }
.el-menu--collapse .el-menu-item { margin: 2px 6px; }
.el-descriptions__label { color: var(--text-3) !important; }
.el-statistic__number { font-weight: 700 !important; }

/* ============================================================
   响应式：平板 / 手机
   ============================================================ */
@media (max-width: 1200px) {
  .login-left { padding: 0 4vw; }
  .login-title { font-size: 32px; }
  .login-right { width: 400px; }
}

@media (max-width: 992px) {
  .login-page { flex-direction: column; }
  .login-left { padding: 34px 24px 0; flex: none; }
  .login-title { font-size: 26px; }
  .login-desc { font-size: 14px; line-height: 1.9; }
  .login-right { width: 100%; padding: 20px 18px 34px; }
  .cal-week { grid-template-columns: 48px repeat(7, minmax(90px, 1fr)); }
  .cal-wrap { overflow-x: auto; }
}

@media (max-width: 768px) {
  .page { padding: 11px; }
  .card { padding: 13px; border-radius: 12px; }
  .header { padding: 0 11px; gap: 8px; }
  .header .crumb { font-size: 14px; }
  .header .crumb small { display: none; }
  .header .u-name { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.show { transform: translateX(0); }
  .sidebar.mini { width: var(--side-w); }
  .mask-mobile { position: fixed; inset: 0; background: rgba(20,28,48,.4); z-index: 19; }
  .filter-bar .el-input, .filter-bar .el-select, .filter-bar .el-date-editor,
  .filter-bar .w120, .filter-bar .w150, .filter-bar .w240 { width: 100% !important; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filter-bar .fb-full { grid-column: span 2; }
  .filter-bar .fb-btns { grid-column: span 2; display: flex; gap: 8px; }
  .stat-card .value { font-size: 23px; }
  .chart-box { height: 250px; }
  .el-dialog { width: 94% !important; }
  .el-drawer { width: 92% !important; }
  .el-message-box { width: 90% !important; }
  .cal-month .day { min-height: 76px; }
  .tool-bar .el-button { flex: 1; min-width: 0; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .detail-grid { grid-template-columns: 1fr; }
  .login-tags span { font-size: 12px; padding: 5px 11px; }
}

/* 移动端表格卡片化 */
.mobile-list { display: none; }
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .mobile-list { display: block; }
  .m-item {
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 12px; margin-bottom: 10px;
  }
  .m-item .m-hd { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
  .m-item .m-hd .m-title { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; }
  .m-item .m-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 3px 0; }
  .m-item .m-row .k { color: var(--text-3); }
  .m-item .m-ft { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
}
@media (min-width: 769px) { .only-mobile { display: none !important; } }
