/* ============================================================
   SparkHUD EDU · 教师平台外壳样式
   依赖：assets/theme.css（Study Sanctuary 设计令牌）
   只在平台壳（左侧导航 + 内容区）使用，课程工具页不加载本文件。
   ============================================================ */

/* ---------- 平台布局：左导航 + 内容区 ---------- */
.pf-body {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
  background: var(--bg);
}

/* ---------- 左侧导航 ---------- */
.pf-nav {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 14px 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.pf-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
}
.pf-nav .brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 500; flex: none;
}
.pf-nav .brand .nm { font-size: 14.5px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.pf-nav .brand .sb { font-size: 11px; color: var(--ink-3); letter-spacing: .4px; }

.pf-nav-h {
  font-size: 11px; letter-spacing: 1.6px; color: var(--ink-3);
  font-weight: 500; margin: 16px 10px 8px;
}
.pf-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  font-size: 14px; color: var(--ink-2);
  transition: .16s; text-decoration: none;
}
.pf-nav a:hover { background: var(--surface-2); color: var(--ink); }
.pf-nav a.on {
  background: var(--brand-l); color: var(--brand-d); font-weight: 500;
}
.pf-nav a .ic {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-size: 12px;
  background: var(--surface-2); color: var(--ink-3);
}
.pf-nav a.on .ic { background: var(--brand); color: #fff; }
.pf-nav a .tag {
  margin-left: auto; font-size: 10.5px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-l); color: var(--accent);
}
.pf-nav .sp { flex: 1; }
/* 导航分隔线：教学模块 / 硬件设备 两个世界之间 */
.pf-nav-div {
  display: flex; align-items: center; gap: 9px;
  font-size: 10.5px; letter-spacing: 1.5px; color: var(--ink-3);
  font-weight: 500; margin: 14px 10px 6px; text-transform: uppercase;
}
.pf-nav-div::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}
.pf-nav .who {
  border-top: 1px solid var(--line); padding: 12px 10px 0;
  font-size: 12.5px; color: var(--ink-3); line-height: 1.6;
}
.pf-nav .who b { color: var(--ink-2); font-weight: 500; }
.pf-nav .who a { display: inline; padding: 0; font-size: 12.5px; color: var(--brand); }
.pf-nav .who a:hover { background: none; text-decoration: underline; }

/* ---------- 内容区 ---------- */
.pf-main { padding: 30px 38px 80px; max-width: 1180px; }
.pf-head { margin-bottom: 22px; }
.pf-head .eyebrow {
  font-size: 11.5px; letter-spacing: 1.6px; color: var(--ink-3);
  font-weight: 500; margin-bottom: 7px;
}
.pf-head h1 { font-size: 26px; font-weight: 500; color: var(--ink); letter-spacing: .2px; }
.pf-head p { font-size: 14px; color: var(--ink-2); margin-top: 7px; max-width: 720px; line-height: 1.75; }

/* ---------- 小卡片网格 ---------- */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.pf-tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); padding: 20px 22px;
  box-shadow: var(--shadow); transition: .18s;
  display: flex; flex-direction: column;
}
.pf-tile:hover { border-color: var(--line-2); transform: translateY(-1px); }
.pf-tile .top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pf-tile .ico {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 16px;
}
.pf-tile h3 { font-size: 15px; font-weight: 500; color: var(--ink); }
.pf-tile .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.pf-tile p { font-size: 13px; color: var(--ink-2); line-height: 1.7; flex: 1; }
.pf-tile .foot {
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pf-tile.soon { opacity: .62; }
.pf-tile.soon:hover { transform: none; border-color: var(--line); }

.pf-badge {
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-3);
}
.pf-badge.live { background: var(--teal-l); color: var(--teal); }
.pf-badge.warn { background: var(--accent-l); color: var(--accent); }

/* ---------- 表格 ---------- */
.pf-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pf-table th {
  text-align: left; font-weight: 500; color: var(--brand-d); font-size: 12.5px;
  padding: 9px 12px; background: var(--brand-l); border-bottom: 1px solid var(--line);
}
.pf-table th:first-child { border-radius: var(--r-s) 0 0 0; }
.pf-table th:last-child { border-radius: 0 var(--r-s) 0 0; }
.pf-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2);
  vertical-align: middle;
}
.pf-table tr:hover td { background: #fbfdff; }
.pf-table .nm { color: var(--ink); font-weight: 500; }

/* ---------- 状态条 ---------- */
.pf-note {
  font-size: 13px; padding: 11px 16px; border-radius: var(--r-m);
  line-height: 1.75; margin-bottom: 18px;
}
.pf-note.ok { background: var(--teal-l); color: var(--teal); border-left: 4px solid var(--teal); }
.pf-note.warn { background: var(--accent-l); color: var(--accent); border-left: 4px solid var(--accent); }
.pf-note.info { background: var(--brand-l); color: var(--brand-d); border-left: 4px solid var(--brand); }
.pf-note.err { background: var(--coral-l); color: var(--coral); border-left: 4px solid var(--coral); }

.pf-empty {
  font-size: 13.5px; color: var(--ink-3); line-height: 1.8;
  background: var(--surface-2); border-radius: var(--r-m); padding: 22px 24px;
  text-align: center;
}

/* ---------- 大号班号 ---------- */
.room-code {
  font-size: 64px; font-weight: 500; letter-spacing: 14px;
  color: var(--brand); font-variant-numeric: tabular-nums;
  text-align: center; padding: 18px 0 6px; line-height: 1.1;
}
.room-code.sm { font-size: 40px; letter-spacing: 9px; padding: 8px 0 2px; }
.room-hint {
  text-align: center; font-size: 13.5px; color: var(--ink-2);
  line-height: 1.8; margin-top: 4px;
}
.room-hint b { color: var(--brand-d); }

.code-input {
  display: flex; gap: 10px; justify-content: center; align-items: center;
  margin: 8px 0 6px;
}
.code-input input {
  width: 216px; text-align: center; font-size: 32px; letter-spacing: 12px;
  font-family: inherit; color: var(--ink); background: #fff;
  border: 2px solid var(--line); border-radius: var(--r-m);
  padding: 12px 8px 12px 20px; font-variant-numeric: tabular-nums;
  transition: .16s;
}
.code-input input:focus { outline: none; border-color: var(--brand); }

/* ---------- 登录页 ---------- */
.pf-login {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, #eef3f9 0%, #f4f7fb 55%, #e9f0f8 100%);
  padding: 30px;
}
.pf-login .box {
  width: 100%; max-width: 386px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); box-shadow: var(--shadow);
  padding: 34px 34px 28px;
}
.pf-login .brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.pf-login .brand .mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 500;
}
.pf-login .brand .nm { font-size: 15px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.pf-login .brand .sb { font-size: 11.5px; color: var(--ink-3); letter-spacing: .4px; }
.pf-login h1 { font-size: 20px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.pf-login .desc { font-size: 13px; color: var(--ink-2); line-height: 1.75; margin-bottom: 22px; }

.fld { margin-bottom: 15px; }
.fld label {
  display: block; font-size: 12.5px; color: var(--ink-2);
  font-weight: 500; margin-bottom: 6px;
}
.fld input {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 11px 14px; transition: .16s;
}
.fld input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(61, 106, 148, .1); }
.fld input.code { letter-spacing: 6px; font-variant-numeric: tabular-nums; text-align: center; }
.fld .row { display: flex; gap: 10px; }
.fld .row input { flex: 1; }
.fld .row .btn { flex: none; white-space: nowrap; }
.fld .err { font-size: 12.5px; color: var(--coral); margin-top: 6px; min-height: 18px; line-height: 1.5; }

.pf-login .sub-acts {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap;
}
.pf-login .sub-acts a { color: var(--brand); }

/* ---------- 学生进班页 ---------- */
.stu-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, #eef3f9 0%, #f4f7fb 55%, #e9f0f8 100%);
  padding: 30px;
}
.stu-box {
  width: 100%; max-width: 430px; text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); box-shadow: var(--shadow);
  padding: 38px 34px 30px;
}

/* ---------- 栈式面板（我的课程等） ---------- */
.pf-sec { margin-bottom: 30px; }
.pf-sec > h2 {
  font-size: 16px; font-weight: 500; color: var(--brand-d);
  margin-bottom: 14px; display: flex; align-items: center; gap: 9px;
}
.pf-sec > h2 .n {
  width: 22px; height: 22px; border-radius: 7px; background: var(--brand);
  color: #fff; display: inline-grid; place-items: center; font-size: 12px; flex: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .pf-body { grid-template-columns: 1fr; }
  .pf-nav {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap;
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 12px 14px; align-items: center;
  }
  .pf-nav .brand { padding: 0 12px 0 4px; }
  .pf-nav-h, .pf-nav .sp, .pf-nav .who { display: none; }
  .pf-nav a { padding: 7px 11px; font-size: 13px; }
  .pf-main { padding: 22px 18px 60px; }
  .pf-head h1 { font-size: 22px; }
}

/* ---------- 打印 ---------- */
@media print {
  .pf-nav, .no-print { display: none !important; }
  .pf-body { grid-template-columns: 1fr; min-height: 0; }
  .pf-main { padding: 0; max-width: 100%; }
}

/* ============================================================
   硬件 / 设备模块（固件管理）
   ------------------------------------------------------------
   来源：原 firmware.html 的 navy + orange 视觉体系。
   它不套用 Study Sanctuary 蓝灰，而是保留为「硬件强调色」，
   与教学模块（--brand 蓝灰 / --accent 赭金）形成刻意区分：
   一看到 navy+orange 就知道"这是设备的世界"。
   ============================================================ */
:root {
  --hw-navy: #1A2E4B;      /* 设备主色（原 --navy） */
  --hw-navy-2: #24405f;    /* 设备主色浅一档（原 --navy2） */
  --hw-orange: #E8720C;    /* 设备强调（原 --orange） */
  --hw-orange-2: #f2851f;  /* 设备强调浅一档（原 --orange2） */
  --hw-line: #e3e8f0;      /* 设备线（原 --line） */
  --hw-card: #ffffff;
  --hw-dim: #7b8aa0;
  --hw-ok: #16a34a;
  --hw-bad: #dc2626;
  --hw-warn: #d97706;
  --hw-radius: 14px;
}

/* ---------- 设备区块外壳：整块染成 navy 过渡带 ---------- */
.hw-band {
  background: linear-gradient(180deg, var(--hw-navy) 0%, var(--hw-navy-2) 100%);
  color: #fff; border-radius: var(--r-l); padding: 22px 26px;
  margin-bottom: 20px; box-shadow: 0 6px 26px rgba(26,46,75,.22);
}
.hw-band h1 { font-size: 21px; font-weight: 600; letter-spacing: .3px; margin-bottom: 6px; }
.hw-band p { font-size: 13px; color: #9fb0c9; line-height: 1.7; max-width: 720px; }
.hw-band .pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.hw-band .pill {
  font-size: 11.5px; padding: 4px 11px; border-radius: 999px;
  background: rgba(255,255,255,.1); color: #cfe0f5;
}
.hw-band .pill.on { background: var(--hw-orange); color: #fff; font-weight: 600; }

/* ---------- 设备标签页 ---------- */
.hw-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.hw-tabs button {
  padding: 9px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  background: var(--surface); color: var(--hw-dim); border: 1px solid var(--line);
  transition: .16s;
}
.hw-tabs button:hover { border-color: var(--hw-navy-2); color: var(--hw-navy); }
.hw-tabs button.on {
  background: var(--hw-navy); color: #fff; border-color: var(--hw-navy);
  box-shadow: 0 4px 14px rgba(26,46,75,.24);
}
.hw-pane { display: none; }
.hw-pane.on { display: block; animation: hwfade .26s ease; }
@keyframes hwfade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---------- 设备统计 ---------- */
.hw-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; margin-bottom: 18px; }
.hw-stat {
  background: var(--hw-card); border: 1px solid var(--hw-line);
  border-radius: var(--hw-radius); padding: 16px 18px;
}
.hw-stat .v { font-size: 27px; font-weight: 800; color: var(--hw-navy); line-height: 1.15; }
.hw-stat .v em { font-style: normal; font-size: 13px; color: var(--hw-dim); font-weight: 500; }
.hw-stat .k { font-size: 12px; color: var(--hw-dim); margin-top: 3px; }
.hw-stat.hl .v { color: var(--hw-orange); }

/* ---------- 设备卡片 ---------- */
.hw-card {
  background: var(--hw-card); border: 1px solid var(--hw-line);
  border-radius: var(--hw-radius); padding: 18px 20px; margin-bottom: 16px;
}
.hw-card > h3 { font-size: 15px; color: var(--hw-navy); margin-bottom: 13px; font-weight: 600; }

/* ---------- 设备表格 ---------- */
.hw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hw-table th {
  background: #eef2f8; color: var(--hw-navy); text-align: left;
  padding: 9px 10px; font-weight: 600; border-bottom: 1px solid var(--hw-line); white-space: nowrap;
}
.hw-table th:first-child { border-radius: var(--r-s) 0 0 0; }
.hw-table th:last-child { border-radius: 0 var(--r-s) 0 0; }
.hw-table td { padding: 9px 10px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.hw-table tr:hover td { background: #fafbfe; }
.hw-table .sn { color: var(--hw-navy); font-weight: 600; }

/* ---------- 设备标签 chip ---------- */
.hw-tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600; background: #eef2f8; color: var(--hw-navy);
  margin-right: 4px;
}
.hw-tag.online { background: #e7f6ee; color: var(--hw-ok); }
.hw-tag.offline { background: #fdeeee; color: var(--hw-bad); }
.hw-tag.mode-dev { background: #fff3e8; color: var(--hw-orange); }
.hw-tag.mode-study { background: #e7f0fb; color: #2563eb; }

/* ---------- 设备表单行 ---------- */
.hw-frow { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.hw-frow label { font-size: 13px; font-weight: 600; color: var(--hw-navy); min-width: 76px; }
.hw-frow input[type=text], .hw-frow select, .hw-frow input[type=file] {
  flex: 1; min-width: 160px; padding: 9px 12px; border: 1px solid var(--hw-line);
  border-radius: 9px; font-size: 13px; font-family: inherit; outline: none; color: var(--ink);
  background: #fff;
}
.hw-frow input:focus, .hw-frow select:focus { border-color: var(--hw-orange); }

/* ---------- 设备按钮 ---------- */
.hw-btn {
  border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px;
  font-weight: 600; cursor: pointer; color: #fff; font-family: inherit;
  background: linear-gradient(135deg, var(--hw-orange), var(--hw-orange-2));
  box-shadow: 0 4px 12px rgba(232,114,12,.3); transition: .16s;
}
.hw-btn:hover { filter: brightness(1.05); }
.hw-btn:active { transform: scale(.98); }
.hw-btn:disabled { opacity: .5; cursor: not-allowed; }
.hw-btn.sm { padding: 6px 13px; font-size: 12px; box-shadow: none; }
.hw-btn.ghost { background: #fff; color: var(--hw-navy); border: 1px solid var(--hw-line); box-shadow: none; }
.hw-btn.ghost:hover { background: #f6f9fd; }
.hw-btn.danger { background: #fff; color: var(--hw-bad); border: 1px solid #f3c6c6; box-shadow: none; }
.hw-btn.danger:hover { background: #fff5f5; }

/* ---------- 进度条 / 日志 ---------- */
.hw-progress { height: 14px; background: #eef2f8; border-radius: 8px; overflow: hidden; margin: 10px 0; }
.hw-progress > div {
  height: 100%; width: 0; border-radius: 8px; transition: width .2s;
  background: linear-gradient(90deg, var(--hw-orange), #ff9a3d);
}
.hw-log {
  background: #0b1526; color: #cfe3ff; border-radius: 10px; padding: 12px 14px;
  font-size: 12px; line-height: 1.7; height: 210px; overflow-y: auto;
  font-family: Consolas, Menlo, monospace; white-space: pre-wrap;
}
.hw-log .ok { color: #4ade80; }
.hw-log .err { color: #f87171; }
.hw-log .warn { color: #fbbf24; }

/* ---------- 空状态 / 说明 ---------- */
.hw-empty { color: var(--hw-dim); text-align: center; padding: 26px 0; font-size: 13px; }
.hw-note { font-size: 12px; color: var(--hw-dim); line-height: 1.9; }
.hw-note b { color: var(--hw-navy); }

/* ---------- 设备弹窗 ---------- */
.hw-mask {
  position: fixed; inset: 0; background: rgba(10,18,32,.55);
  display: flex; align-items: center; justify-content: center; z-index: 120;
}
.hw-mask .sheet {
  background: #fff; border-radius: 18px; padding: 22px;
  width: min(430px, 92vw); box-shadow: 0 20px 60px rgba(10,18,32,.35);
}
.hw-mask .sheet h3 { color: var(--hw-navy); margin-bottom: 14px; font-size: 16px; }
.hw-mask .sheet h3 span { color: var(--hw-orange); }
.hw-mask .sheet .hw-frow input, .hw-mask .sheet .hw-frow select { width: 100%; }
.hw-mask .sheet .tip { font-size: 12px; color: var(--hw-dim); margin: 8px 0 14px; line-height: 1.6; }
.hw-mask .sheet .btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ---------- 设备模块响应式 ---------- */
@media (max-width: 900px) {
  .hw-band { padding: 18px 18px; }
  .hw-stats { grid-template-columns: repeat(2, 1fr); }
  .hw-table { display: block; overflow-x: auto; white-space: nowrap; }
}
