/* base.css —— 界面板块公共样式（移动端 H5 + PC 管理后台 两套主题） */

:root {
  --primary: #3b6cff;
  --primary-d: #2f57d6;
  --success: #1faa6b;
  --warning: #e6a23c;
  --danger: #e54848;
  --text: #1f2430;
  --text-2: #6b7280;
  --text-3: #9aa1ad;
  --line: #ececf0;
  --bg: #f5f6f8;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(20, 30, 60, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px; padding: 9px 16px;
  font-size: 14px; font-weight: 600; transition: .15s; background: #eef1f6; color: var(--text);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; margin-bottom: 12px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.chart-cap { font-size: 13px; font-weight: 600; color: #3A3F4B; margin-bottom: 6px; }

/* ---------- 徽标 ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-blue { background: #e8f0ff; color: var(--primary); }
.badge-green { background: #e6f7ef; color: var(--success); }
.badge-orange { background: #fdf3e3; color: var(--warning); }
.badge-red { background: #fdeaea; color: var(--danger); }
.badge-gray { background: #f0f1f4; color: var(--text-2); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.input, .select, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; background: #fff; color: var(--text); outline: none;
}
.input:focus, .select:focus { border-color: var(--primary); }
textarea.input { resize: vertical; min-height: 76px; }

/* ---------- Toast ---------- */
#app-toast-host { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; padding-top: 18%; pointer-events: none; }
.app-toast {
  margin-bottom: 8px; max-width: 80%; padding: 10px 16px; border-radius: 10px; color: #fff;
  font-size: 13px; background: rgba(31, 36, 48, .92); opacity: 0; transform: translateY(-8px); transition: .28s;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.app-toast.show { opacity: 1; transform: translateY(0); }
.app-toast-error { background: rgba(229, 72, 72, .95); }
.app-toast-success { background: rgba(31, 170, 107, .95); }

/* ---------- Modal ---------- */
.app-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9998; display: flex; align-items: center; justify-content: center; }
.app-modal { background: #fff; border-radius: 14px; width: 92%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.app-modal-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.app-modal-body { font-size: 14px; color: var(--text-2); margin-bottom: 18px; word-break: break-all; }
.app-modal-actions { display: flex; gap: 10px; }
.app-modal-actions .btn { flex: 1; }

/* ---------- Loading ---------- */
.app-loading { position: fixed; inset: 0; background: rgba(255,255,255,.5); z-index: 9997; display: none; align-items: center; justify-content: center; }
.spinner { width: 36px; height: 36px; border: 3px solid #d8dde8; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 空态 ---------- */
.empty { text-align: center; color: var(--text-3); padding: 40px 0; font-size: 13px; }
.empty .ico { font-size: 36px; display: block; margin-bottom: 8px; opacity: .5; }

/* ============================================================
   移动端 H5 主题（学员 / 教师 / 代理商）
   ============================================================ */
.mobile { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.m-topbar { position: sticky; top: 0; z-index: 50; background: var(--primary); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.m-topbar .back { font-size: 20px; cursor: pointer; line-height: 1; }
.m-topbar .title { font-size: 16px; font-weight: 600; flex: 1; }
.m-topbar .right { font-size: 13px; }
.m-content { flex: 1; padding: 12px; padding-bottom: 76px; overflow-y: auto; }
.m-tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 60px; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 60; }
.m-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-3); font-size: 11px; gap: 3px; }
.m-tabbar a .ti { font-size: 20px; }
.m-tabbar a.active { color: var(--primary); }

.m-row { display: flex; align-items: center; gap: 10px; }
.m-row .avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg,#6f9bff,#3b6cff); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; flex-shrink: 0; }
.m-row .grow { flex: 1; min-width: 0; }
.m-row .name { font-weight: 600; }
.m-row .sub { color: var(--text-3); font-size: 12px; }
.price { color: var(--danger); font-weight: 700; }
.m-list { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.m-list .item { padding: 13px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.m-list .item:last-child { border-bottom: none; }
.m-hero { background: linear-gradient(135deg,#4f7bff,#3b6cff); color: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 12px; }
.m-hero .big { font-size: 26px; font-weight: 700; }
.m-hero .lbl { opacity: .85; font-size: 12px; }
.big-2 { font-size: 16px; font-weight: 600; }

/* ============================================================
   PC 管理后台主题
   ============================================================ */
.admin { display: flex; min-height: 100vh; }
.admin-side { width: 220px; background: #1f2430; color: #c9ced9; flex-shrink: 0; display: flex; flex-direction: column; }
.admin-side .brand { padding: 18px 20px; font-size: 17px; font-weight: 700; color: #fff; border-bottom: 1px solid #2c3242; }
.admin-side .nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.admin-side .nav a { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: #c9ced9; font-size: 14px; cursor: pointer; }
.admin-side .nav a:hover { background: #2a3040; color: #fff; }
.admin-side .nav a.active { background: var(--primary); color: #fff; }
.admin-side .nav .grp { padding: 12px 20px 6px; font-size: 11px; color: #6b7280; letter-spacing: 1px; }
.admin-side .foot { padding: 14px 20px; border-top: 1px solid #2c3242; font-size: 12px; }
.admin-side .foot .u { color: #fff; font-weight: 600; }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-top { height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 22px; gap: 12px; }
.admin-top .pg { font-size: 16px; font-weight: 600; }
.admin-top .spacer { flex: 1; }
.admin-content { flex: 1; padding: 22px; overflow-y: auto; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-card .v { font-size: 24px; font-weight: 700; }
.stat-card .k { color: var(--text-2); font-size: 13px; margin-top: 4px; }

/* 学员数据看板 */
.stats-panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.stats-panel .sp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stats-panel .sp-head .t { font-size: 15px; font-weight: 600; }
.charts-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.chart-box { flex: 1 1 320px; min-width: 280px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.chart-box h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
.table th { background: #f7f8fa; color: var(--text-2); font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafbff; }
  .table td { word-break: break-word; }
  .table .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
  .table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll .table { margin-bottom: 0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; }
.pager button { min-width: 34px; }
.pager .cur { color: var(--text-2); }

.section-h { font-size: 16px; font-weight: 600; margin: 4px 0 14px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--text-3); }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } .admin-side { width: 64px; } .admin-side .brand, .admin-side .nav a span, .admin-side .grp, .admin-side .foot .role { display: none; } .toolbar { gap: 8px; } .toolbar .input, .toolbar .select { min-width: 0; flex: 1 1 140px; } .pager { flex-wrap: wrap; } .admin-content { padding: 14px; } }

/* ===== 课程卡片（课程中心） ===== */
.course-card { display: flex; border-radius: 12px; overflow: hidden; background: #fff; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06); cursor: pointer; }
.course-card .cover { width: 100px; min-height: 90px; display: flex; align-items: center; justify-content: center; font-size: 36px; flex-shrink: 0; }
.course-card .body { flex: 1; padding: 12px 14px; }
.course-card .body .name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.course-card .body .sub { font-size: 12px; color: var(--text-3); }

/* ===== 课程详情横幅 ===== */
.course-banner { padding: 24px 16px; text-align: center; color: #fff; border-radius: 0; margin-bottom: 12px; }
.course-banner .emoji { font-size: 48px; display: block; margin-bottom: 8px; }
.course-banner .bn-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.course-banner .bn-sub { font-size: 13px; opacity: .85; }
.kv { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; }

/* ===== 消息中心 ===== */
.msg-item { background: #fff; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.msg-item.unread { background: #f0f5ff; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.msg-type { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: #e8e8e8; color: #666; flex-shrink: 0; }
.msg-type.mt1 { background: #e6f7ff; color: #1890ff; }
.msg-type.mt2 { background: #fff7e6; color: #fa8c16; }
.msg-type.mt3 { background: #f6ffed; color: #52c41a; }
.msg-type.mt4 { background: #f0f5ff; color: #4C8DFF; }
.msg-title { font-size: 14px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.msg-content { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* ===== 教室联动卡片 ===== */
.classroom-card { background: #fff; border-radius: 12px; padding: 24px 16px; text-align: center; margin-top: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.classroom-card .cr-emoji { font-size: 56px; margin-bottom: 8px; }
.classroom-card .cr-role { font-size: 14px; color: var(--text-2); margin-bottom: 12px; }
.classroom-card .cr-room { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.classroom-card .cr-time { font-size: 12px; color: var(--text-3); margin-bottom: 16px; }

/* ===== 消息铃铛（首页右上角） ===== */
.bell { position: relative; cursor: pointer; margin-right: 12px; font-size: 18px; }
.bell .dot { position: absolute; top: -6px; right: -10px; background: #e54848; color: #fff; font-size: 10px; padding: 1px 4px; border-radius: 8px; font-style: normal; line-height: 1.2; min-width: 16px; text-align: center; }
.switch { cursor: pointer; font-size: 13px; }
.m-topbar .right { display: flex; align-items: center; }

/* ===== 教师详情 / 排班网格 / 协助约课 ===== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin-bottom: 14px; }
.d-item { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.d-item label { color: var(--text-3); font-size: 12px; }
.d-item span { color: var(--text); word-break: break-all; }
.prev-img { max-width: 160px; max-height: 120px; border-radius: 8px; border: 1px solid var(--line); }
.time-label, .day-label { cursor: pointer; user-select: none; }
.time-label:hover, .day-label:hover { color: var(--primary); }
.time-label .mini, .day-label .mini { display: inline-block; margin-left: 6px; font-size: 10px; font-style: normal; color: #fff; background: var(--primary); border-radius: 4px; padding: 0 4px; opacity: .8; }
.fix-tag { display: inline-block; margin-left: 4px; font-size: 10px; line-height: 1; padding: 2px 4px; border-radius: 4px; background: #eef1f6; color: #8a92a0; cursor: pointer; }
.fix-tag.on { background: #fff1e6; color: #fa8c16; font-weight: 600; }
.slot-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.slot { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; background: #fff; }
.slot.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.stepper { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 14px; color: var(--text-3); }
.stepper span.on { color: var(--primary); font-weight: 600; }
.stepper i { color: var(--text-3); font-style: normal; }
.btn.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 教师详情页：标签页 + 缩略头像 */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs .tab { padding: 9px 18px; cursor: pointer; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .tab.on { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #f0f1f4; display: inline-block; vertical-align: middle; }
.avatar-ph { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg,#6f9bff,#3b6cff); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; vertical-align: middle; }

/* 教师详情页：排课/团课优化 */
.sched-toolbar { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { width: 42px; height: 22px; border-radius: 22px; background: #cfd6e4; position: relative; transition: .2s; flex: 0 0 auto; }
.switch .slider:before { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider:before { transform: translateX(20px); }
.switch-label { color: var(--text-2); }
.price-cell { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.ops { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qr-box { display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin: 10px auto; }
.qr-box img { display: block; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-warn { background: #FF9F40; color: #fff; border-color: #FF9F40; }

/* 学员管理：数据看板与学员列表并列卡片 */
.students-split { display: flex; gap: 16px; align-items: flex-start; }
.students-split > .dash-card { flex: 0 0 380px; max-width: 380px; }
.students-split > .list-card { flex: 1 1 auto; min-width: 0; }
@media (max-width: 980px) {
  .students-split { flex-direction: column; }
  .students-split > .dash-card { flex: 1 1 auto; max-width: none; width: 100%; }
}

