/* =========================================================
   成员端样式（T 型布局 + 树状侧栏，全屏桌面）
   ========================================================= */

body {
  background: #e8eef5;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  display: block;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

body > .card {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
body > .card > h1 { display: none; }

/* ===== 状态点 ===== */
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #bbb;
  flex-shrink: 0;
  transition: background 0.2s;
}
.dot.on  { background: #2ecc71; box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.25); }
.dot.off { background: #e74c3c; box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2); }

/* ==================== 登录页 ==================== */
#loginBox.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #e0f2ff 0%, #b8e4ff 50%, #a0d8ff 100%);
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1e4a75;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 8px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(79, 172, 254, 0.15);
  white-space: nowrap;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 20px;
  padding: 32px 30px 26px;
  box-shadow: 0 20px 50px rgba(79, 172, 254, 0.18),
              0 4px 16px rgba(0, 0, 0, 0.04);
  animation: cardIn 0.4s ease-out;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-header { text-align: center; margin-bottom: 24px; }

.login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, #eaf6ff, #d4ecff);
  margin-bottom: 14px;
}

.login-title {
  font-size: 22px;
  font-weight: bold;
  color: #1e4a75;
  margin: 0 0 6px;
}

.login-sub { font-size: 13px; color: #7a95b0; margin: 0; }

/* ==================== 表单 ==================== */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: #4a6a85;
  margin-bottom: 7px;
  font-weight: 500;
}

.input-wrap { position: relative; display: flex; align-items: center; }

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 15px;
  pointer-events: none;
  opacity: 0.75;
  line-height: 1;
}

.input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid #dbe9f5;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  background: #f8fbff;
  color: #1e4a75;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.input-wrap input:focus {
  border-color: #4facfe;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.12);
}

.input-wrap input::placeholder { color: #a8bdd0; }

/* ==================== 按钮 ==================== */
/* 主按钮：全宽 */
.btn-primary {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #4facfe, #3a9be8);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 6px 18px rgba(79, 172, 254, 0.35);
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(79, 172, 254, 0.45);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled {
  background: #c8d6e5;
  box-shadow: none;
  cursor: not-allowed;
}

/* 幽灵按钮：全宽 */
.btn-ghost {
  width: 100%;
  padding: 10px;
  border: 1.5px solid #dbe9f5;
  border-radius: 12px;
  background: #fff;
  color: #4facfe;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.btn-ghost:hover { background: #f0f8ff; border-color: #a8d8ff; }

/* ★ 小按钮：width: auto，避免被 base.css 拉满 */
.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  padding: 5px 10px;
  border: 1px solid #dbe9f5;
  border-radius: 8px;
  background: #fff;
  color: #4facfe;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0;
  transition: background 0.15s;
}
.btn-mini:hover:not(:disabled) { background: #f0f8ff; }
.btn-mini:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==================== T 型全屏外壳 ==================== */
.app-shell {
  display: grid;
  grid-template-rows: 64px 1fr;
  grid-template-columns: 380px 1fr;
  grid-template-areas:
    "header header"
    "side   main";
  height: 100vh;
  overflow: hidden;
  background: #f0f6fc;
  animation: shellIn 0.35s ease-out;
}

@keyframes shellIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== Header ===== */
.app-header {
  grid-area: header;
  background: #fff;
  border-bottom: 1px solid #e6eff8;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  z-index: 5;
}

.header-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.header-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eaf6ff, #d4ecff);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e4a75;
  white-space: nowrap;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #f0f8ff;
  border-radius: 999px;
  font-size: 12px;
  color: #4a6a85;
  white-space: nowrap;
}

.header-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4facfe, #3a9be8);
  color: #fff;
  font-size: 17px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(79, 172, 254, 0.3);
}

.user-info { min-width: 0; max-width: 200px; }

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e4a75;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta {
  font-size: 11px;
  color: #7a95b0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  width: auto;
  padding: 7px 14px;
  border: 1px solid #dbe9f5;
  border-radius: 8px;
  background: #fff;
  color: #3470c8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  margin: 0;
  transition: background 0.15s, border-color 0.15s;
}
.btn-header:hover { background: #f0f8ff; border-color: #a8d8ff; }

.btn-header-danger { color: #e74c3c; border-color: #ffd6d1; }
.btn-header-danger:hover { background: #fff5f4; border-color: #ffaba1; }

/* ===== 左侧面板 ===== */
.side-panel {
  grid-area: side;
  background: #fff;
  border-right: 1px solid #e6eff8;
  padding: 18px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: #f8fbff;
  border-radius: 10px;
  margin-bottom: 10px;
}

.refresh-info {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: #5a7996;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  min-height: 20px;
}

.assign-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: #6f8ba6;
}
.assign-status:empty { display: none; }
.assign-status.ok  { background: #e6f9ee; color: #27ae60; }
.assign-status.warn { background: #fef5e0; color: #d68910; }
.assign-status.err  { background: #fdecea; color: #e74c3c; }

.countdown { font-size: 11px; color: #9bb0c5; }
.countdown:empty { display: none; }

/* ===== 树工具栏：★ 两个按钮等宽平分 ===== */
.tree-toolbar {
  display: flex;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid #eff6fc;
}

.tree-toolbar .btn-mini {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

/* ===== 树状结构 ===== */
.enroll-tree {
  flex: 1;
  min-height: 0;
  font-size: 13px;
  user-select: none;
  overflow-y: auto;
}

.tree-empty {
  padding: 20px 8px;
  font-size: 12px;
  color: #9bb0c5;
  text-align: center;
}

.tree-node {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
  transition: background 0.12s, color 0.12s;
}

.tree-node:hover { background: #f0f8ff; }

.tree-node.selected {
  background: #e0f0ff;
  color: #3470c8;
  font-weight: 600;
}

.tree-node .arrow {
  display: inline-block;
  width: 14px;
  text-align: center;
  color: #7a95b0;
  font-size: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s;
}
.tree-node .arrow:hover { color: #4facfe; }

.tree-node .icon {
  margin: 0 6px 0 0;
  font-size: 13px;
  flex-shrink: 0;
}

.tree-node .text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-node .badge {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e6f9ee;
  color: #27ae60;
  margin-left: 6px;
  flex-shrink: 0;
  font-weight: normal;
}

.tree-node .badge.warn {
  background: #fef5e0;
  color: #d68910;
}

.tree-term {
  font-weight: 600;
  color: #1e4a75;
  margin-top: 4px;
}
.tree-term .icon { font-size: 14px; }

.tree-class {
  padding-left: 20px;
  color: #4a6a85;
}

.tree-assign {
  padding-left: 42px;
  color: #6f8ba6;
  font-size: 12px;
}

.tree-assign:hover { color: #3470c8; }
.tree-assign.selected { color: #3470c8; background: #e0f0ff; }
.tree-assign.closed {
  color: #a8bdd0;
  text-decoration: line-through;
}

/* ===== 右侧主区 ===== */
.main-panel {
  grid-area: main;
  padding: 22px 26px;
  overflow-y: auto;
  background: #f0f6fc;
}

.panel-block {
  background: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: 0 2px 12px rgba(79, 172, 254, 0.06);
  border: 1px solid #eff6fc;
}

.panel-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #1e4a75;
}

.instruction-title {
  justify-content: flex-start;
}

.instruction-heading {
  flex-shrink: 0;
}

.instruction-context {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  font-weight: normal;
}

.instruction-context .ctx-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #eaf6ff, #d4ecff);
  color: #3470c8;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid #cfe6ff;
}

.instruction-context .ctx-sep {
  color: #b0c8dd;
  font-size: 11px;
  margin: 0 1px;
}

.instruction-meta {
  margin-left: auto;
}

.submission-meta {
  font-size: 11px;
  color: #8fa5bc;
  font-weight: normal;
}

/* ===== 上传区 ===== */
.upload-area { margin-bottom: 14px; }

.file-drop {
  display: block;
  border: 2px dashed #cfe2f5;
  border-radius: 12px;
  padding: 26px 20px;
  background: #f8fbff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.file-drop:hover { border-color: #4facfe; background: #f0f8ff; }
.file-drop input[type=file] { display: none; }

/* ★ 达到上传上限时：变灰、禁用 */
.file-drop.file-drop-limit {
  opacity: 0.55;
  cursor: not-allowed;
  border-color: #ffd6d1;
  background: #fff5f4;
}
.file-drop.file-drop-limit:hover {
  border-color: #ffd6d1;
  background: #fff5f4;
}

.file-drop-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.file-drop-icon { font-size: 28px; line-height: 1; }
.file-drop-text { text-align: left; }

.file-drop-title {
  font-size: 14px;
  color: #3470c8;
  font-weight: 500;
}

.file-drop-sub {
  font-size: 12px;
  color: #9bb0c5;
  margin-top: 2px;
}

.file-info {
  font-size: 12px;
  color: #4a6a85;
  margin-top: 8px;
  text-align: center;
  padding: 6px 10px;
  background: #f0f8ff;
  border-radius: 8px;
  word-break: break-all;
}
.file-info:empty { display: none; }

/* ★ 上传目标显示区（由 upload.js 渲染） */
#uploadPick {
  word-break: break-all;
}

.upload-actions { margin-top: 12px; }
.upload-actions .btn-primary,
.upload-actions .btn-ghost { margin-top: 0; }

/* ===== 进度条 ===== */
.progress-wrap {
  margin-top: 12px;
  height: 8px;
  border-radius: 999px;
  background: #eef4fa;
  overflow: hidden;
  display: none;
}
.progress-wrap.on { display: block; }

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4facfe, #00c6ff);
  border-radius: 999px;
  transition: width 0.15s linear;
}

/* ===== 表格 ===== */
.table-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e6eff8;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}

table.data-table th {
  background: #f5faff;
  color: #5a7996;
  font-weight: 500;
  text-align: left;
  padding: 11px 14px;
  font-size: 12px;
  border-bottom: 1px solid #e6eff8;
  white-space: nowrap;
}

table.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #f0f6fc;
  color: #2a4a68;
  vertical-align: middle;
  word-break: break-all;
}

table.data-table tr:last-child td { border-bottom: 0; }
table.data-table tr:hover td { background: #fafdff; }
table.data-table td:last-child { white-space: nowrap; }

/* ===== hint ===== */
.hint { font-size: 12px; color: #a8bdd0; margin-top: 6px; line-height: 1.5; }
.hint-center { text-align: center; }

/* ===== 消息 toast ===== */
.msg {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  max-width: 80vw;
  text-align: center;
  margin: 0;
  transition: opacity 0.2s;
}
.msg:empty { display: none; }
.msg.ok  { color: #27ae60; border-left: 4px solid #27ae60; }
.msg.err { color: #e74c3c; border-left: 4px solid #e74c3c; }

body:has(#uploadBox:not(.hidden)) .msg {
  display: none !important;
}

/* ===== 隐藏 ===== */
.hidden { display: none !important; }

/* ===== 小屏保护 ===== */
@media (max-width: 1024px) {
  body { min-width: 1024px; }
}