/* ============================================================
   考拉英语 · 后台管理系统 — 样式
   风格：iOS/macOS 液态玻璃（浅色）
   ============================================================ */
:root {
  --bg: #F2F3F8;
  --ink: #23263B;
  --ink2: #5A6072;
  --ink3: #9BA0B0;
  --line: rgba(35, 38, 59, .08);
  --card: rgba(255, 255, 255, .72);
  --purple: #7C6CF6;
  --purple-d: #6558E8;
  --blue: #4FA8F5;
  --green: #3ECF8E;
  --green-d: #21B877;
  --yellow: #F5B940;
  --red: #F0655A;
  --r: 18px;
  --shadow: 0 10px 34px rgba(60, 66, 110, .10);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
body::before, body::after {
  content: ''; position: fixed; border-radius: 50%; filter: blur(90px);
  z-index: 0; pointer-events: none;
}
body::before { width: 520px; height: 520px; background: rgba(124, 108, 246, .16); top: -180px; left: -140px; }
body::after { width: 460px; height: 460px; background: rgba(79, 168, 245, .13); bottom: -160px; right: -120px; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.login-card {
  width: 400px; padding: 44px 40px 36px; border-radius: 26px;
  background: var(--card); backdrop-filter: blur(24px); box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.7); text-align: center;
  animation: rise .5s cubic-bezier(.22,.9,.3,1.2) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.97); } }
.login-card img { width: 84px; height: 84px; margin-bottom: 14px; }
.login-card h1 { font-size: 22px; letter-spacing: .5px; }
.login-card .sub { color: var(--ink3); font-size: 13px; margin: 6px 0 26px; }
.login-card input {
  width: 100%; padding: 13px 16px; margin-bottom: 14px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.8); outline: none;
  transition: border .2s, box-shadow .2s;
}
.login-card input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(124,108,246,.15); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 22px; border: none; border-radius: 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: transform .15s, box-shadow .2s, opacity .2s; font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--purple), #9B8BFF); color: #fff; box-shadow: 0 8px 20px rgba(124,108,246,.35); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(124,108,246,.45); }
.btn-ghost { background: rgba(255,255,255,.75); color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: rgba(240,101,90,.12); color: var(--red); border: 1px solid rgba(240,101,90,.25); }
.btn-green { background: linear-gradient(135deg, var(--green), #63DBA6); color: #fff; box-shadow: 0 8px 20px rgba(62,207,142,.3); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; border-radius: 11px; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--ink3); line-height: 1.7; }
.login-err { color: var(--red); font-size: 12.5px; margin: -6px 0 12px; min-height: 16px; }

/* ---------- 整体框架 ---------- */
#app { display: none; min-height: 100vh; position: relative; z-index: 1; }
#app.on { display: block; }
.sidebar {
  position: fixed; left: 18px; top: 18px; bottom: 18px; width: 224px; z-index: 10;
  background: var(--card); backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,.7);
  border-radius: 22px; box-shadow: var(--shadow); padding: 22px 14px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.brand img { width: 40px; height: 40px; }
.brand b { font-size: 15.5px; display: block; }
.brand span { font-size: 11px; color: var(--ink3); }
.nav-group { margin-bottom: 14px; }
.nav-cap { font-size: 11px; color: var(--ink3); padding: 0 10px 6px; letter-spacing: .5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 2px;
  border-radius: 12px; font-size: 13.5px; font-weight: 500; color: var(--ink2); cursor: pointer;
  transition: background .15s, color .15s; user-select: none;
}
.nav-item:hover { background: rgba(124,108,246,.08); color: var(--ink); }
.nav-item.on { background: linear-gradient(135deg, var(--purple), #9B8BFF); color: #fff; box-shadow: 0 6px 16px rgba(124,108,246,.3); }
.nav-item .ni { width: 20px; text-align: center; }
.nav-item .cnt { margin-left: auto; font-size: 11px; background: rgba(240,101,90,.14); color: var(--red); border-radius: 9px; padding: 1px 7px; }
.nav-item.on .cnt { background: rgba(255,255,255,.25); color: #fff; }

.main { margin: 18px 18px 18px 260px; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 22px; margin-bottom: 18px;
  background: var(--card); backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--r); box-shadow: var(--shadow);
}
.topbar h2 { font-size: 17px; }
.topbar .crumb { font-size: 12px; color: var(--ink3); }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.env-chip { font-size: 12px; padding: 5px 12px; border-radius: 10px; background: rgba(62,207,142,.14); color: var(--green-d); font-weight: 600; }
.me { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.me .ava { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--purple), var(--blue)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.me .nm { font-size: 13px; font-weight: 600; }
.me .rl { font-size: 11px; color: var(--ink3); }

.page { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 卡片 / 网格 ---------- */
.card {
  background: var(--card); backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px;
}
.card h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h3 .sub { font-size: 12px; color: var(--ink3); font-weight: 400; margin-left: auto; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g21 { grid-template-columns: 2fr 1fr; }
.g12 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3, .g21, .g12 { grid-template-columns: 1fr; } }

/* KPI 卡 */
.kpi { position: relative; overflow: hidden; }
.kpi .k-label { font-size: 12.5px; color: var(--ink2); display: flex; align-items: center; gap: 7px; }
.kpi .k-ico { width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.kpi .k-num { font-size: 30px; font-weight: 800; letter-spacing: -.5px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kpi .k-num small { font-size: 14px; font-weight: 600; color: var(--ink3); margin-left: 3px; }
.kpi .k-delta { font-size: 12px; font-weight: 600; margin-top: 6px; }
.up { color: var(--green-d); } .down { color: var(--red); }

/* 徽章 */
.tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 9px; font-size: 11.5px; font-weight: 600; }
.tag.on { background: rgba(62,207,142,.14); color: var(--green-d); }
.tag.off { background: rgba(155,160,176,.14); color: var(--ink3); }
.tag.draft { background: rgba(245,185,64,.16); color: #C08A1E; }
.tag.ban { background: rgba(240,101,90,.13); color: var(--red); }
.tag.purple { background: rgba(124,108,246,.13); color: var(--purple-d); }
.tag.blue { background: rgba(79,168,245,.14); color: #2E7FC2; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 12px; color: var(--ink3); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(124,108,246,.045); }
.table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.table .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.ava-s { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #B9C6FF, #8FA0F8); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-right: 9px; vertical-align: middle; }

/* 工具条 */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select, .modal input, .modal select, .modal textarea {
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px;
  background: rgba(255,255,255,.8); outline: none; font-family: inherit; color: var(--ink);
}
.toolbar input:focus, .toolbar select:focus, .modal input:focus, .modal textarea:focus { border-color: var(--purple); }
.toolbar .spacer { flex: 1; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: var(--ink2); justify-content: flex-end; }
.pager button { padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.7); cursor: pointer; font-size: 12.5px; font-family: inherit; color: var(--ink); }
.pager button.cur { background: var(--purple); color: #fff; border-color: var(--purple); }
.pager button:disabled { opacity: .4; cursor: default; }

/* ---------- 图表 ---------- */
.chart-wrap { width: 100%; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.legend i { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink2); font-style: normal; }
.legend i b { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hbar { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.hbar .hb-name { width: 86px; font-size: 12.5px; color: var(--ink2); flex-shrink: 0; }
.hbar .hb-track { flex: 1; height: 12px; border-radius: 7px; background: rgba(35,38,59,.06); overflow: hidden; }
.hbar .hb-fill { height: 100%; border-radius: 7px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.hbar .hb-v { width: 44px; text-align: right; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.heat-row { display: flex; gap: 10px; }
.heat-cell { flex: 1; border-radius: 12px; padding: 14px 8px; text-align: center; color: #fff; }
.heat-cell b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.heat-cell span { font-size: 11px; opacity: .85; }

/* ---------- 弹层 / 抽屉 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(30, 32, 48, .35); backdrop-filter: blur(6px);
  z-index: 100; display: flex; align-items: center; justify-content: center; animation: fade .2s ease;
}
.modal {
  width: 480px; max-width: calc(100vw - 40px); max-height: 82vh; overflow-y: auto;
  background: rgba(255,255,255,.92); backdrop-filter: blur(30px); border-radius: 22px;
  padding: 26px 28px; box-shadow: 0 24px 70px rgba(30,32,48,.3); animation: rise .3s cubic-bezier(.22,.9,.3,1.15) both;
}
.modal h3 { font-size: 16.5px; margin-bottom: 4px; }
.modal .m-sub { font-size: 12.5px; color: var(--ink3); margin-bottom: 18px; }
.modal .frow { margin-bottom: 13px; }
.modal .frow label { display: block; font-size: 12.5px; color: var(--ink2); margin-bottom: 6px; font-weight: 600; }
.modal .frow input, .modal .frow select, .modal .frow textarea { width: 100%; }
.modal .frow textarea { min-height: 84px; resize: vertical; }
.modal .m-ops { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.drawer-mask { position: fixed; inset: 0; background: rgba(30,32,48,.3); backdrop-filter: blur(4px); z-index: 100; animation: fade .2s ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 430px; max-width: 92vw; z-index: 101;
  background: rgba(255,255,255,.94); backdrop-filter: blur(30px); box-shadow: -16px 0 50px rgba(30,32,48,.18);
  padding: 26px 28px; overflow-y: auto; animation: slideIn .3s cubic-bezier(.2,.9,.25,1) both;
}
@keyframes slideIn { from { transform: translateX(60px); opacity: 0; } }
.drawer h3 { font-size: 17px; }
.d-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.d-head .ava { width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(135deg, var(--purple), var(--blue)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.d-kv { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.d-kv span { color: var(--ink3); }
.d-kv b { font-weight: 600; }
.d-sec { margin-top: 18px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.d-close { position: absolute; top: 20px; right: 22px; width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.7); cursor: pointer; font-size: 14px; color: var(--ink2); }

/* toast */
#toast {
  position: fixed; left: 50%; top: 26px; transform: translateX(-50%) translateY(-80px);
  background: rgba(35,38,59,.9); color: #fff; font-size: 13px; padding: 10px 20px; border-radius: 14px;
  z-index: 200; transition: transform .35s cubic-bezier(.2,.9,.3,1.2); backdrop-filter: blur(10px);
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* 空状态 */
.empty { text-align: center; color: var(--ink3); font-size: 13px; padding: 40px 0; }
.mono { font-variant-numeric: tabular-nums; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }

/* ---------- 筛选 chips / 进度条 ---------- */
.chip {
  padding: 7px 16px; border-radius: 11px; font-size: 12.5px; font-weight: 600;
  background: rgba(255,255,255,.75); color: var(--ink2); border: 1px solid var(--line);
  cursor: pointer; transition: all .15s; user-select: none;
}
.chip:hover { border-color: var(--purple); color: var(--purple-d); }
.chip.on { background: linear-gradient(135deg, var(--purple), #9B8BFF); color: #fff; border-color: transparent; box-shadow: 0 5px 14px rgba(124,108,246,.3); }
.bar { height: 8px; border-radius: 5px; background: rgba(35,38,59,.07); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #7C6CF6, #9B8BFF); }

/* ---------- 文件上传组件 ---------- */
.upzone { border: 1.5px dashed rgba(124,108,246,.45); border-radius: 12px; padding: 16px 14px; text-align: center; cursor: pointer; transition: all .15s; background: rgba(124,108,246,.04); }
.upzone:hover { border-color: var(--purple); background: rgba(124,108,246,.08); }
.upzone input[type=file] { display: none; }
.up-t { font-size: 13px; font-weight: 650; color: var(--purple-d); }
.up-h { font-size: 11px; color: var(--ink3); margin-top: 4px; line-height: 1.6; }
.up-meta { display: flex; align-items: center; gap: 10px; text-align: left; }
.up-ico { width: 38px; height: 38px; border-radius: 11px; background: rgba(124,108,246,.13); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.up-n { font-size: 12.5px; font-weight: 650; word-break: break-all; }
.up-s { font-size: 11px; color: var(--ink3); margin-top: 1px; }
.up-prog { height: 6px; border-radius: 4px; background: rgba(35,38,59,.08); overflow: hidden; margin-top: 7px; }
.up-prog i { display: block; height: 100%; background: linear-gradient(90deg,#7C6CF6,#9B8BFF); width: 0; border-radius: 4px; transition: width .18s; }
.up-ok { color: var(--green-d); font-size: 11.5px; font-weight: 650; margin-top: 8px; }
.up-err { color: var(--red); font-size: 11.5px; font-weight: 550; margin-top: 8px; line-height: 1.6; }

/* ---------- 登录密码显隐 ---------- */
.pwd-box { position: relative; }
.pwd-box input { padding-right: 46px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; font-size: 16px;
  opacity: .55; padding: 6px 8px; border-radius: 8px; transition: opacity .15s;
}
.pwd-eye:hover { opacity: 1; }

/* ---------- 个人信息面板 ---------- */
.topbar .right { position: relative; }
.pop-mask { position: fixed; inset: 0; z-index: 40; }
.me-pop {
  position: fixed; right: 26px; top: 76px; width: 320px; z-index: 41;
  background: #fff;
  border: 1px solid rgba(255,255,255,.75); border-radius: 18px;
  box-shadow: 0 18px 48px rgba(60,66,110,.18); padding: 18px;
  text-align: left;
}
.mp-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.mp-ava { width: 44px; height: 44px; font-size: 17px; flex-shrink: 0; }
.mp-name { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mp-id { font-size: 11.5px; color: var(--ink3); margin-top: 3px; }
.mp-sec { font-size: 11px; color: var(--ink3); letter-spacing: .5px; margin: 13px 0 7px; }
.mp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 11px; font-size: 13px; }
.mp-row span { display: flex; align-items: center; gap: 7px; color: var(--ink2); min-width: 0; }
.mp-row b.mono { font-size: 12.5px; color: var(--ink); }
.mp-swt { cursor: pointer; transition: background .15s; }
.mp-swt:hover { background: rgba(124,108,246,.08); }
.mp-swt .ava-s { width: 24px; height: 24px; font-size: 11px; }
.mp-swt b { font-weight: 600; }
.mp-role { font-style: normal; font-size: 11px; color: var(--ink3); margin-left: 4px; }
.mp-go { color: var(--purple-d); font-size: 12px; flex-shrink: 0; }
.mp-off { opacity: .45; cursor: not-allowed; }
.mp-off .mp-go { color: var(--ink3); }
.mp-tip { font-size: 11px; color: var(--ink3); line-height: 1.6; margin-top: 9px; text-align: center; }
