:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #1e2530;
  --muted: #78808e;
  --line: #e2e6ec;
  --accent: #2f6fed;
  --ok: #16803c;
  --err: #c62f2f;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 "Segoe UI", "Microsoft YaHei", sans-serif;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border-bottom: 1px solid var(--line); padding: 10px 24px;
}
.brand { font-weight: 700; }
.topbar nav { display: flex; gap: 16px; align-items: center; }
.topbar nav a { color: var(--ink); text-decoration: none; padding: 4px 8px; border-radius: 6px; }
.topbar nav a.active { background: var(--accent); color: #fff; }
.tab-disabled { color: var(--muted); }
.who { color: var(--muted); }
main { max-width: 1080px; margin: 24px auto; padding: 0 16px; }
.page { display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; }

/* 当前状态与学生申请 */
.rt-badge { display: inline-block; padding: 2px 12px; border-radius: 999px; color: #fff; font-size: 13px; vertical-align: middle; }
.rt-badge[data-source="student"] { background: #e8890c; }
.rt-badge[data-source="plan"] { background: var(--primary, #2f6fed); }
.rt-badge.hidden { display: none; }
.temp-item { display: inline-block; background: #fff7e8; border: 1px solid #f0d9a8; border-radius: 6px; padding: 1px 8px; margin: 2px 4px 2px 0; }
.req-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.req-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.req-item .req-desc { flex: 1; min-width: 200px; }
.req-item select.dur { padding: 3px 6px; }
.req-item button { padding: 4px 14px; }
.req-ok { color: #1a7f37; }
.req-no { color: #b42318; }
.req-badge { display: inline-block; background: #d92d20; color: #fff; border-radius: 999px; padding: 1px 10px; font-size: 12px; margin-left: 6px; }
.req-badge.hidden { display: none; }
#req-refresh { margin-left: auto; padding: 2px 10px; }
.card h3 { display: flex; align-items: center; }
.card h3 { margin: 0 0 8px; }
.row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }
.mt { margin-top: 16px; }
.hidden { display: none !important; }
.error { background: #fdeaea; color: var(--err); border: 1px solid #f3b9b9; border-radius: 8px; padding: 8px 14px; }
.success { background: #e8f6ec; color: var(--ok); border: 1px solid #b7e0c3; border-radius: 8px; padding: 8px 14px; }
button, select, input, textarea {
  font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fff;
}
button { background: var(--accent); color: #fff; border: none; cursor: pointer; }
button.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
button:hover { filter: brightness(1.05); }
label { display: inline-flex; gap: 6px; align-items: center; }
.switches { display: flex; gap: 24px; flex-wrap: wrap; }
.net-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.net-grid select { width: 100%; margin-bottom: 8px; }
.net-grid textarea { width: 100%; font-family: Consolas, monospace; }
table.slots, table.list { width: 100%; border-collapse: collapse; margin: 8px 0; }
table.slots th, table.slots td, table.list th, table.list td {
  border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; font-size: 14px;
}
.form-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.login-card {
  max-width: 380px; margin: 8vh auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 28px 32px;
}
.login-card label { display: grid; gap: 4px; margin: 12px 0; }
.login-card input { width: 100%; }
.login-card button { width: 100%; margin-top: 8px; }
.token {
  margin-top: 10px; padding: 10px 14px; background: #fffbe8; border: 1px dashed #d9c36a;
  border-radius: 8px; font-family: Consolas, monospace; word-break: break-all; font-size: 13px;
}
details summary { cursor: pointer; color: var(--accent); }

/* 平台快捷白名单 */
.palette { margin-top: 14px; display: grid; gap: 10px; }
.pal-group h5 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px 5px 7px; cursor: grab; user-select: none;
}
.chip svg { display: block; flex: none; }
.chip small { color: var(--muted); font-size: 12px; }
.chip:active { cursor: grabbing; }
.chip:hover { border-color: var(--accent); }
.dropzone { border: 1px dashed transparent; border-radius: 8px; padding: 4px; margin: -4px; }
.dropzone.over { border-color: var(--accent); background: #eef3ff; }
.drop-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
textarea.flash { border-color: var(--ok); background: #f2fbf5; }
.small { font-size: 12px; }
.muted-btn { color: var(--muted); border-color: var(--line); }
.danger-btn { background: #fff; color: var(--err); border: 1px solid #f3b9b9; }
.sm-btn { font-size: 12px; padding: 2px 10px; margin-left: 8px; }
.form-col { display: grid; gap: 10px; margin: 10px 0; }
.form-col label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.form-col input { width: 100%; }
#view-notice { color: var(--accent); }
.warning {
  background: #fff7e0; color: #8a6d00; border: 1px solid #e8cf7a;
  border-radius: 8px; padding: 10px 14px; font-weight: 600;
}
.device-list { display: grid; gap: 6px; margin: 4px 0 10px; }
.device-item {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; font-size: 14px;
}
.bound-tag { color: var(--ok); font-weight: 600; }
.unbound-tag { color: #b06a00; font-weight: 600; }
.expired-tag {
  color: var(--err); border: 1px solid #f3b9b9; border-radius: 6px;
  padding: 1px 8px; font-size: 12px; font-weight: 600;
}
.bind-code-inline {
  font: 700 16px Consolas, monospace; letter-spacing: 3px; color: var(--accent);
  background: #f0f4ff; border-radius: 6px; padding: 2px 8px;
}
.bind-code {
  font: 700 44px/1.4 Consolas, monospace;
  letter-spacing: 10px;
  text-align: center;
  padding: 14px 0;
  margin: 8px 0;
  background: #f0f4ff;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  color: var(--accent);
  user-select: all;
}
.popover {
  position: fixed; z-index: 60; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 10px 12px;
}
.popover .pop-name { font-size: 13px; color: var(--muted); max-width: 300px; margin-bottom: 8px; }
.popover .pop-actions { display: flex; gap: 8px; }
.default-mode { margin: 4px 0 8px; }

/* 采集用户须知弹层 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: #fff; border-radius: 12px; max-width: 620px; width: 100%;
  max-height: 85vh; overflow: auto; padding: 20px 24px;
}
.modal h3 { margin: 0 0 10px; }
.notice-body { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }

/* 学习活动统计 */
.day-timeline { list-style: none; margin: 0; padding: 0; }
.dt-item { display: flex; gap: 12px; padding: 6px 0; align-items: baseline; }
.dt-time {
  flex: 0 0 96px; color: #607080; font-size: 13px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dt-dot {
  flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%;
  background: #2f6fed; align-self: center; position: relative;
}
.dt-dot::after {
  content: ""; position: absolute; left: 4px; top: 13px; bottom: -15px;
  width: 1px; background: #e2e8f0;
}
.dt-item:last-child .dt-dot::after { display: none; }
.dt-mode .dt-dot { background: #2f6fed; }
.dt-dns .dt-dot { background: #16a085; }
.dt-app .dt-dot { background: #c9762a; }
.dt-idle .dt-dot { background: #95a5a6; }
.dt-text { word-break: break-all; min-width: 0; }
.week-summary {
  background: #f0f6ff; border-radius: 8px; padding: 10px 14px;
  margin: 0 0 12px; line-height: 1.7;
}
.mode-totals { display: flex; gap: 20px; flex-wrap: wrap; }
.mode-chip { display: flex; align-items: center; gap: 6px; }
.mode-chip .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.idle-list { display: grid; gap: 4px; }
.idle-item {
  background: #fff7e0; border-radius: 6px; padding: 4px 10px; font-size: 13px;
  width: fit-content;
}
.week-bars { display: grid; gap: 6px; margin-bottom: 12px; }
.wb-row { display: flex; align-items: center; gap: 10px; }
.wb-date { width: 52px; font-size: 13px; }
.wb-bar {
  flex: 1; height: 18px; background: #f0f2f5; border-radius: 4px;
  display: flex; overflow: hidden;
}
.wb-seg { height: 100%; }

/* 移动端适配 */
@media (max-width: 900px) {
  .net-grid { grid-template-columns: 1fr; }
  .chip { padding: 8px 14px 8px 9px; }
  .popover .pop-actions { flex-wrap: wrap; }
}
