/* =========================================================
   发布者 Web 端样式
   ========================================================= */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

/* ---------- 登录区 ---------- */
#loginBox {
  width: 400px;
  margin: 100px auto;
  background: #fff;
  padding: 30px 32px;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

#loginBox h2 {
  margin: 0 0 20px;
  text-align: center;
  font-size: 20px;
  color: #3470c8;
}

#loginBox label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 12px;
}

#loginBox input {
  width: 100%;
  padding: 9px 12px;
  margin-top: 4px;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

#loginBox input:focus { border-color: #4facfe; }

#loginBox button {
  width: 100%;
  padding: 11px;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  background: #4facfe;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

#loginBox button:hover { background: #3a9be8; }

#loginMsg {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: #c0392b;
  min-height: 18px;
}

/* ---------- 主界面 ---------- */
#mainBox {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 360px 1fr;
  grid-template-areas:
    "header header"
    "tree   detail";
  height: 100vh;
  overflow: hidden;
}

#mainBox header {
  grid-area: header;
  background: #3470c8;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

#mainBox header #who { font-weight: bold; }

#mainBox header #clientStatus {
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
}

#mainBox header button {
  padding: 6px 14px;
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
#mainBox header button:hover {
  background: rgba(255, 255, 255, 0.15);
}
#mainBox header #logoutBtn { margin-left: auto; }

/* ---------- 左侧树 ---------- */
#tree {
  grid-area: tree;
  background: #fff;
  border-right: 1px solid #e5e9f0;
  padding: 12px 10px;
  overflow-y: auto;
  font-size: 14px;
}

/* 顶部“全部展开/折叠”按钮 */
#tree .btn {
  padding: 3px 10px;
  font-size: 12px;
  margin-right: 6px;
  margin-bottom: 10px;
}

/* ---------- 树节点通用 ---------- */
.struct-node {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.6;
  border-left: 3px solid transparent;
}

.struct-node:hover { background: #f0f5ff; }
.struct-node.selected {
  background: #e1ecff;
  color: #3470c8;
  font-weight: bold;
  border-left-color: #3470c8;
}

/* 层级缩进 + 左侧色条 + 字号递减 */
.struct-node.level-school {
  padding-left: 4px;
  margin-top: 6px;
  font-weight: bold;
  font-size: 14px;
  color: #1f3a6b;
  border-left-color: #3470c8;
  background: #f8fbff;
}
.struct-node.level-school:hover { background: #eaf3ff; }

.struct-node.level-term {
  padding-left: 22px;
  font-weight: 600;
  color: #2c3e50;
  border-left-color: #6aa9e9;
}
.struct-node.level-course {
  padding-left: 40px;
  color: #333;
  border-left-color: #a9c8ea;
}
.struct-node.level-class {
  padding-left: 58px;
  color: #444;
  border-left-color: #cfdff0;
  font-size: 13px;
}
.struct-node.level-item {
  padding-left: 76px;
  color: #666;
  font-size: 13px;
  border-left-color: transparent;
}
.struct-node.level-item:hover {
  background: #f5faff;
  color: #3470c8;
}

/* 折叠箭头 */
.struct-node .arrow {
  display: inline-block;
  width: 16px;
  text-align: center;
  color: #888;
  font-size: 11px;
  flex-shrink: 0;
}

/* 节点文本 */
.struct-node .text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 已关闭 */
.struct-node.closed {
  color: #999;
  text-decoration: line-through;
}

/* ---------- 右侧详情 ---------- */
#detail {
  grid-area: detail;
  padding: 20px 24px;
  overflow-y: auto;
}

#detail h3 {
  margin: 0 0 16px;
  font-size: 17px;
  color: #333;
}

.detail-block {
  background: #fff;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.detail-block h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #3470c8;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 6px;
}

.detail-row {
  font-size: 13px;
  line-height: 1.9;
  color: #444;
}
.detail-row .label {
  display: inline-block;
  width: 88px;
  color: #888;
}

.hint {
  font-size: 13px;
  color: #999;
  line-height: 1.8;
}

/* ---------- 操作按钮 ---------- */
.btn {
  padding: 8px 16px;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-right: 8px;
  margin-bottom: 8px;
}
.btn-primary   { background: #4facfe; color: #fff; }
.btn-primary:hover   { background: #3a9be8; }
.btn-success   { background: #2ecc71; color: #fff; }
.btn-success:hover   { background: #27ae60; }
.btn-danger    { background: #e74c3c; color: #fff; }
.btn-danger:hover    { background: #c0392b; }
.btn-ghost {
  background: #fff;
  color: #3470c8;
  border: 1px solid #b9d4f5;
}
.btn-ghost:hover { background: #f0f5ff; }
.btn:disabled { background: #c8d6e5; cursor: not-allowed; }

/* ---------- 表格 ---------- */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 6px;
}
table.data-table th,
table.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
}
table.data-table th {
  background: #f7faff;
  color: #555;
  font-weight: normal;
}
table.data-table tr:hover td { background: #fbfdff; }
.file-download {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  background: #4facfe;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
}
.file-download:hover { background: #3a9be8; }