/* ============================================================
 * 老师后台样式 —— 深色数据台
 * 桌面：左侧栏 + 内容区；移动端：底部标签栏
 * ============================================================ */

:root {
  --bg: #0F1F1A;
  --bg-glow: #163026;
  --panel: #172B24;
  --panel-2: #1E382E;
  --line: #2C4B3F;
  --line-2: #3A6152;

  --ink: #F0E9DD;
  --ink-2: #BFD3C8;
  --ink-3: #8BAA9C;

  --teal: #57C8A0;
  --teal-d: #2E8A6B;
  --gold: #E3B45F;
  --orange: #E7924F;
  --red: #E4735C;
  --blue: #6FA8DC;

  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --sh: 0 10px 34px -18px rgba(0, 0, 0, .8);

  --font-cn: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans CN", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --font-num: Georgia, "Times New Roman", serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-cn);
  font-size: 16px;
  line-height: 1.6;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(90% 60% at 12% -8%, rgba(87, 200, 160, .10), transparent 60%),
    radial-gradient(70% 50% at 92% 0%, rgba(227, 180, 95, .07), transparent 60%);
}

a { color: var(--teal); text-decoration: none; }
button { font-family: inherit; }

/* ---------------- 登录 ---------------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 32px 26px; box-shadow: var(--sh);
}
.login-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: linear-gradient(145deg, var(--teal), var(--teal-d));
  color: #08201A; font-family: var(--font-num); font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.brand p { margin: 0; font-size: 13px; color: var(--ink-3); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 7px; font-weight: 600; }
.input {
  width: 100%; height: 48px; padding: 0 14px; background: #10231D; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 11px; font-size: 16px; font-family: inherit; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(87, 200, 160, .15); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

.btn {
  height: 46px; padding: 0 18px; border-radius: 11px; border: 1.5px solid transparent;
  font-size: 15px; font-weight: 700; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: 7px;
  transition: transform .12s, filter .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(180deg, #6AD4AC, var(--teal)); color: #08201A; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink-2); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-danger { background: transparent; border-color: #6B3A34; color: var(--red); }
.btn-danger:hover { background: rgba(228, 115, 92, .12); }
.btn-sm { height: 38px; padding: 0 13px; font-size: 14px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }

.err {
  background: rgba(228, 115, 92, .14); border: 1px solid #6B3A34; color: #F0A893;
  padding: 10px 13px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; display: none;
}
.err.show { display: block; }
.hint { font-size: 13px; color: var(--ink-3); margin-top: 16px; line-height: 1.7; }

/* ---------------- 布局 ---------------- */
.app { display: none; min-height: 100vh; }
.app.on { display: block; }
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 228px; z-index: 20;
  background: #0C1B16; border-right: 1px solid var(--line);
  padding: 18px 14px; display: flex; flex-direction: column;
  overflow-y: auto;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.sb-brand h1 { margin: 0; font-size: 16px; font-weight: 800; }
.sb-brand p { margin: 0; font-size: 12px; color: var(--ink-3); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button {
  height: 46px; padding: 0 14px; border-radius: 11px; border: none; background: transparent;
  color: var(--ink-2); font-size: 15px; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 11px; transition: background .18s, color .18s;
}
.nav button:hover { background: var(--panel); }
.nav button.on { background: var(--panel-2); color: var(--teal); font-weight: 700; }
.nav .ico { width: 20px; text-align: center; font-size: 15px; }
.sb-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.who { padding: 0 6px 10px; font-size: 13px; color: var(--ink-3); }
.who b { color: var(--ink); display: block; font-size: 15px; margin-bottom: 2px; }

.main { margin-left: 228px; padding: 22px 26px 60px; max-width: 1180px; }
.page { display: none; }
.page.on { display: block; animation: fadeUp .34s cubic-bezier(.22, .9, .3, 1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h2 { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -.4px; }
.page-h p { margin: 5px 0 0; font-size: 14px; color: var(--ink-3); }

/* ---------------- 卡片 ---------------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 14px; font-size: 16px; font-weight: 700; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.stat {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 16px;
}
.stat .k { font-size: 13px; color: var(--ink-3); }
.stat .v { font-family: var(--font-num); font-size: 32px; font-weight: 700; color: var(--teal); line-height: 1.2; margin-top: 2px; letter-spacing: -1px; }
.stat .u { font-size: 13px; color: var(--ink-3); }

/* ---------------- 筛选 ---------------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .input { height: 42px; width: auto; min-width: 150px; font-size: 14px; }
.filters .grow { flex: 1; min-width: 190px; }

/* ---------------- 列表 ---------------- */
.rec {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 14px; transition: border-color .18s, background .18s, transform .12s;
}
.rec:hover { border-color: var(--line-2); background: var(--panel-2); }
.rec:active { transform: scale(.995); }
.rec-main { flex: 1; min-width: 0; }
.rec-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rec-name .seq { font-size: 12px; color: var(--ink-3); background: #0F241E; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-weight: 600; }
.rec-meta { font-size: 13px; color: var(--ink-3); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.rec-sum { font-size: 13px; color: var(--ink-2); margin-top: 5px; font-family: var(--font-num); }
.rec-time { font-size: 13px; color: var(--ink-3); text-align: right; flex: none; }
.tag {
  display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 7px;
  background: #10261F; border: 1px solid var(--line-2); color: var(--ink-2); font-weight: 600;
}
.tag.t-fad { color: var(--blue); border-color: #2F4E68; background: #122231; }
.tag.t-ppcs { color: var(--orange); border-color: #6A4A2A; background: #2A1E12; }
.tag.t-iap { color: var(--gold); border-color: #6A5528; background: #272013; }
.tag.t-fes { color: var(--teal); border-color: #2E6B58; background: #0E2A22; }

.empty { text-align: center; padding: 56px 20px; color: var(--ink-3); }
.empty .big { font-size: 40px; margin-bottom: 12px; opacity: .7; }

/* ---------------- 详情抽屉 ---------------- */
.mask { position: fixed; inset: 0; background: rgba(4, 12, 9, .62); z-index: 40; display: none; opacity: 0; transition: opacity .24s; backdrop-filter: blur(2px); }
.mask.show { display: block; opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 100%; z-index: 41;
  background: #10241D; border-left: 1px solid var(--line); overflow-y: auto;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.22, .9, .3, 1);
  padding: 20px 22px calc(30px + var(--safe-b));
}
.drawer.show { transform: translateX(0); }
.drawer-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.drawer-h h3 { margin: 0; font-size: 21px; font-weight: 800; }
.drawer-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }
.x-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font-size: 19px; cursor: pointer; flex: none; }
.x-btn:hover { background: var(--panel-2); }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 4px; }
.kv div { background: #0E211B; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.kv .k { font-size: 12px; color: var(--ink-3); }
.kv .v { font-size: 15px; font-weight: 600; margin-top: 1px; }

.dim-row { margin-bottom: 14px; }
.dim-row .t { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-bottom: 5px; }
.dim-row .t .n { font-weight: 700; }
.dim-row .t .s { font-family: var(--font-num); font-weight: 700; }
.bar { height: 9px; background: #0C1D18; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .8s cubic-bezier(.2, .8, .3, 1); }
.b-good { background: linear-gradient(90deg, #3FA580, var(--teal)); }
.b-warn { background: linear-gradient(90deg, #C79440, var(--gold)); }
.b-bad { background: linear-gradient(90deg, #C25B44, var(--red)); }

.sec { margin: 18px 0 10px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sec::before { content: ""; width: 3px; height: 15px; background: var(--teal); border-radius: 2px; }
.tip-list { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); line-height: 1.75; }
.tip-list li { margin-bottom: 7px; }

.review { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; }
.rv { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #16291F; font-size: 14px; }
.rv:last-child { border-bottom: none; }
.rv .n { font-family: var(--font-num); color: var(--ink-3); width: 30px; flex: none; }
.rv .q { flex: 1; color: var(--ink-2); }
.rv .a { flex: none; color: var(--teal); font-weight: 700; min-width: 62px; text-align: right; }
.rv.hl { background: rgba(228, 115, 92, .1); }

.note-item { background: #0E211B; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 10px; padding: 11px 13px; margin-bottom: 9px; }
.note-item .m { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.note-item .c { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }

textarea.input { height: auto; min-height: 84px; padding: 11px 13px; line-height: 1.6; resize: vertical; }

/* ---------------- 邀请链接 ---------------- */
.link-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px; display: flex; flex-direction: row; align-items: center; gap: 18px; flex-wrap: wrap;
}
.link-card .link-main { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 11px; }
.link-card .lt { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.link-card .lt b { font-size: 16px; }
.qr-wrap { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qr { width: 132px; height: 132px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 7px; display: flex; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-fail { font-size: 12px; color: var(--bad); text-align: center; padding: 8px; }
.qr-tip { font-size: 12px; color: var(--ink-3); }
.link-box {
  background: #0B1A15; border: 1px dashed var(--line-2); border-radius: 10px;
  padding: 11px 13px; font-family: var(--font-num); font-size: 13px; color: var(--ink-2);
  word-break: break-all; line-height: 1.55;
}
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.my-code {
  display: inline-flex; align-items: center; gap: 8px; background: #0E2A22;
  border: 1px solid #2E6B58; border-radius: 10px; padding: 7px 13px; color: var(--teal);
  font-family: var(--font-num); font-size: 17px; font-weight: 700; letter-spacing: 1.5px;
}

/* ---------------- 表格（老师管理） ---------------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--ink-3); font-weight: 600; font-size: 13px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .num { font-family: var(--font-num); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 7px; font-weight: 700; }
.b-admin { background: rgba(227, 180, 95, .15); color: var(--gold); border: 1px solid #6A5528; }
.b-teacher { background: rgba(87, 200, 160, .12); color: var(--teal); border: 1px solid #2E6B58; }
.b-off { background: rgba(228, 115, 92, .12); color: var(--red); border: 1px solid #6B3A34; }

/* ---------------- 移动端 ---------------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  .sidebar {
    top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: auto;
    flex-direction: row; padding: 6px 6px calc(6px + var(--safe-b));
    border-right: none; border-top: 1px solid var(--line); overflow: visible;
  }
  .sb-brand, .sb-foot { display: none; }
  .nav { flex-direction: row; flex: 1; gap: 2px; }
  .nav button { flex: 1; flex-direction: column; height: 54px; gap: 3px; font-size: 11px; padding: 0 4px; justify-content: center; }
  .nav .ico { font-size: 17px; }
  .main { margin-left: 0; padding: 16px 14px calc(84px + var(--safe-b)); }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-h h2 { font-size: 21px; }
  .drawer { width: 100%; }
  .filters .input { flex: 1; min-width: 130px; }
  .rec { flex-wrap: wrap; }
  .rec-time { width: 100%; text-align: left; }
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 560px; }
  .link-card { flex-direction: column; align-items: stretch; }
  .qr-wrap { align-self: center; }
}

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(16px);
  background: #0B1A15; border: 1px solid var(--line-2); color: var(--ink);
  padding: 11px 20px; border-radius: 12px; font-size: 14px; z-index: 90;
  opacity: 0; pointer-events: none; transition: all .26s; box-shadow: var(--sh);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loader { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.spin { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--teal); border-radius: 50%; margin: 0 auto 14px; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
