/* 工程项目管理课程平台 样式表 */

:root {
  --brand: #1b4a6b;
  --brand-dark: #143a55;
  --brand-soft: #e8f0f6;
  --accent: #c2410c;
  --accent-soft: #fdf0e7;
  --ink: #1b2733;
  --muted: #64748b;
  --line: #e3e9ef;
  --bg: #f4f7f9;
  --card: #ffffff;
  --ok: #15803d;
  --err: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 34, 51, .04), 0 8px 24px rgba(16, 34, 51, .05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 15px;
  line-height: 1.75;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; font-weight: 700; letter-spacing: .2px; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0 0 .9em; }
p:last-child { margin-bottom: 0; }

.dim { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- 顶栏 ---------- */
.buildbar {
  background: var(--accent-soft);
  color: #8a3a10;
  font-size: 13px;
  text-align: center;
  padding: 7px 16px;
  border-bottom: 1px solid #f4ddca;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 66px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); padding-left: 14px; position: relative; }
.brand::before {
  content: "";
  width: 5px; height: 36px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--accent) 100%);
}
.brand:hover { color: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 22px; font-weight: 800; color: var(--brand); letter-spacing: 4px; }
.brand-text em { font-style: normal; font-size: 12px; color: var(--muted); letter-spacing: 1px; margin-top: 2px; }

.mainnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.mainnav a {
  padding: 8px 13px;
  border-radius: 9px;
  color: #41556b;
  font-size: 14.5px;
}
.mainnav a:hover { background: var(--brand-soft); color: var(--brand); }
.mainnav a.on { background: var(--brand); color: #fff; }

.usernav { display: flex; align-items: center; gap: 10px; }
.usernav .who { font-size: 14px; color: #41556b; }

/* ---------- 按钮 ---------- */
.solid, .ghost, .danger {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: .16s;
  text-align: center;
}
.solid { background: var(--brand); color: #fff; }
.solid:hover { background: var(--brand-dark); color: #fff; }
.ghost { background: #fff; color: #3d5266; border-color: var(--line); }
.ghost:hover { border-color: #c3d2de; color: var(--brand); }
.danger { background: #fff; color: var(--err); border-color: #f0d5d5; }
.danger:hover { background: #fdf2f2; }
.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.lg { padding: 12px 26px; font-size: 15.5px; border-radius: 11px; }
.btn-block { display: block; width: 100%; }

/* ---------- 布局 ---------- */
.wrap { max-width: 1140px; margin: 0 auto; padding: 30px 22px 60px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); align-items: start; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.block { margin-top: 34px; }
.block-head { margin-bottom: 14px; }
.block-head h2 { margin-bottom: 4px; }
.block-head p { margin: 0; font-size: 14px; }

.pagehead { margin: 6px 0 24px; }
.pagehead h1 { margin-bottom: 8px; }
.pagehead p { margin: 0; max-width: 820px; }

.crumb { font-size: 13.5px; color: var(--muted); display: flex; gap: 8px; margin-bottom: 10px; }

/* ---------- 首页头部 ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 26px;
  align-items: stretch;
  background: linear-gradient(135deg, #ffffff 0%, #f0f6fa 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 38px 36px;
  box-shadow: var(--shadow);
}
.eyebrow { font-size: 13px; color: var(--muted); letter-spacing: .6px; margin-bottom: 10px; }
.hero h1 { font-size: 34px; margin-bottom: 14px; color: var(--brand-dark); }
.lead { font-size: 15.5px; color: #3d5266; max-width: 620px; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

.hero-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  align-content: center;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
}
.stat .num { display: block; font-size: 26px; font-weight: 700; color: var(--brand); line-height: 1.2; }
.stat .lbl { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.statcard { text-align: center; padding: 20px 12px; }
.statcard .num { display: block; font-size: 28px; font-weight: 700; color: var(--brand); line-height: 1.2; }
.statcard .lbl { display: block; font-size: 13px; color: var(--muted); }

/* ---------- 模块与案例 ---------- */
.module .tag, .case .tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  letter-spacing: .5px;
}
.tag-warn { background: var(--accent-soft) !important; color: var(--accent) !important; }
.module h3 { margin: 10px 0 6px; }
.module p, .case p { color: var(--muted); font-size: 14px; margin: 0; }

.case-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.code { font-size: 12px; color: #9aa9b8; letter-spacing: 1px; }
.case h3 { margin: 10px 0 8px; }
.more { display: inline-block; margin-top: 14px; font-size: 14px; }
.more::after { content: " →"; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  font-size: 12px;
  background: #f1f5f9;
  color: #4a5f73;
  padding: 3px 10px;
  border-radius: 7px;
}

.empty { color: var(--muted); text-align: center; padding: 40px 20px; }

/* ---------- 公告 ---------- */
.noticelist { list-style: none; margin: 0; padding: 0; }
.noticelist li { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.noticelist li:last-child { border-bottom: 0; padding-bottom: 0; }
.noticelist li:first-child { padding-top: 0; }
.noticelist strong { font-size: 15px; }
.noticelist .date { font-size: 12.5px; margin-left: 10px; }
.noticelist p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

.ops { display: flex; gap: 6px; flex-wrap: wrap; }
.ops form { margin: 0; }

.pill {
  display: inline-block; font-size: 12px; padding: 2px 9px;
  border-radius: 999px; background: #f1f5f9; color: #64748b;
}
.pill-ok { background: #eaf6ee; color: var(--ok); }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13.5px; color: #4a5f73; margin-bottom: 6px; }
.field input[type=text], .field input[type=password], .field input[type=number], .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: #fcfdfe;
  transition: .16s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: #9dbdd3;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(27, 74, 107, .07);
}
.field textarea { resize: vertical; line-height: 1.8; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- 登录 ---------- */
.authbox { display: grid; place-items: center; padding: 40px 0 60px; }
.authcard { width: 100%; max-width: 420px; padding: 32px; }
.authcard h1 { font-size: 22px; }
.authcard .dim { font-size: 13.5px; margin-bottom: 20px; }

/* ---------- 提示条 ---------- */
.flash {
  padding: 12px 16px;
  border-radius: 11px;
  font-size: 14px;
  margin-bottom: 18px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid #d3e3ee;
}
.flash-ok { background: #eef8f1; border-color: #cfe9d7; color: #14663a; }
.flash-err { background: #fdf2f2; border-color: #f3d3d3; color: var(--err); }

/* ---------- 正文 ---------- */
.prose { font-size: 15.5px; line-height: 2; color: #26384a; white-space: normal; }

.kv { margin: 0; display: grid; grid-template-columns: 80px 1fr; gap: 10px 12px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.plainlist, .numlist { margin: 0; padding-left: 20px; }
.plainlist { list-style: none; padding-left: 0; }
.plainlist li { padding: 6px 0 6px 16px; position: relative; font-size: 14.5px; }
.plainlist li::before {
  content: "";
  position: absolute; left: 0; top: 15px;
  width: 5px; height: 5px; border-radius: 50%;
  background: #b6c9d8;
}
.numlist li { padding: 6px 0; font-size: 14.5px; }

.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li { border-bottom: 1px solid #f1f5f9; }
.linklist li:last-child { border-bottom: 0; }
.linklist a { display: block; padding: 12px 2px; font-size: 15px; font-weight: 600; }
.linklist a .dim { display: block; font-weight: 400; font-size: 13px; margin-top: 2px; }

/* ---------- 页脚 ---------- */
.sitefoot {
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: 40px;
}
.sitefoot-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 28px 22px; }
  .hero h1 { font-size: 27px; }
  .grid-2, .grid-3, .grid-side { grid-template-columns: 1fr; }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .topbar-inner { gap: 12px; padding: 10px 16px; }
  .mainnav { order: 3; width: 100%; }
  .wrap { padding: 22px 16px 48px; }
  .row2 { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  h1 { font-size: 22px; }
  .hero h1 { font-size: 24px; }
  .card { padding: 18px; }
  .table { font-size: 13px; }
  .table th, .table td { padding: 8px 6px; }
}

/* ================= 框架版新增 ================= */

.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 身份徽标 */
.rolebadge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #4a5f73;
  white-space: nowrap;
}
.role-admin { background: #fbeee6; color: #a8461b; }
.role-teacher { background: #e8f0f6; color: #1b4a6b; }
.role-student { background: #eef8f1; color: #14663a; }
.role-guest { background: #f1f5f9; color: #64748b; }

/* 管理员提示条 */
.zonebar {
  background: #fbf6ef;
  border-top: 1px solid #f0e3d2;
  color: #8a5a20;
  font-size: 12.5px;
  text-align: center;
  padding: 5px 16px;
}

/* 登录切换 */
.authswitch {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.authswitch a {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  border-radius: 8px;
  font-size: 14px;
  color: #5b6f83;
}
.authswitch a.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(16,34,51,.08); }
.authswitch a.guesttab { color: #7b8ea1; }

/* 页脚站点说明 */
.sitefoot-note {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 22px 20px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #8a9bab;
}

/* 复选框行 */
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #4a5f73;
  margin: 10px 0;
}
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* 烽火台 */
.tower {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.tower::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: #dbe5ec;
}
.tower-on::before { background: var(--accent); }
.tower-on { border-color: #f0d5c4; }
.tower-off { opacity: .62; }
.tower-no {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}
.tower h3 { margin: 4px 0 2px; }
.tower-kv {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 4px 8px;
  font-size: 13px;
  margin: 10px 0 12px;
}
.tower-kv dt { color: var(--muted); }
.tower-kv dd { margin: 0; }
.tower-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* 进度条 */
.progressbar { display: flex; flex-direction: column; gap: 10px; }
.progressbar-text { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bar { height: 8px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, #2c6b96, #4a95bf); border-radius: 999px; }
.bar-sm { height: 6px; margin-bottom: 4px; }

/* 章节切换 */
.chaptabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.chaptabs a {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--line);
  color: #41556b;
}
.chaptabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.chapterhead {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.chapterhead-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.grid-module { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }

.placeholder-stage {
  margin-top: 16px;
  border: 1px dashed #c9d8e4;
  border-radius: 12px;
  padding: 42px 20px;
  text-align: center;
  color: #8aa0b3;
  background: #fbfdff;
}
.placeholder-stage span { display: block; font-size: 15px; font-weight: 600; }
.placeholder-stage em { display: block; font-style: normal; margin-top: 6px; color: #9bb0c2; }

/* 知识点格子 */
.cellgrid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.cell {
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  background: #eef2f6;
  border: 1px solid #e2e9f0;
}

/* 雷达占位 */
.radar-placeholder {
  margin-top: 12px;
  border: 1px dashed #c9d8e4;
  border-radius: 12px;
  min-height: 170px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #8aa0b3;
  background: #fbfdff;
}
.radar-placeholder em { display: block; font-style: normal; color: #9bb0c2; margin-top: 4px; }

/* 留言列表 */
.feedlist { list-style: none; margin: 0; padding: 0; }
.feedlist li { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.feedlist li:last-child { border-bottom: 0; }
.feedhead { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.feedlist p { margin: 0; font-size: 14px; color: #2b3d4f; }
.reply {
  margin-top: 8px;
  background: #f6f9fc;
  border-left: 3px solid #c9d8e4;
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  font-size: 13.5px;
  color: #4a5f73;
}
.reply strong { display: block; font-size: 12.5px; color: var(--brand); margin-bottom: 2px; }

/* 作品卡 */
.work { display: flex; flex-direction: column; }
.work h3 { margin: 10px 0 6px; }
.work p { flex: 1; }
.work-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }

/* 引文卡 */
.quote-text { font-size: 15px; line-height: 1.95; color: #26384a; }
.quote-foot { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }

/* 提示条与说明卡 */
.notice-inline {
  background: #f7fafc;
  border: 1px solid #e3ecf3;
  color: #4a5f73;
  font-size: 14px;
  margin-bottom: 20px;
}
.todo { border-style: dashed; }
.zonecard .tag { margin-bottom: 8px; }
.zonecard h3 { margin: 0 0 6px; }
.zonecard p { color: var(--muted); font-size: 14px; margin: 0; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-module { grid-template-columns: 1fr; }
  .chapterhead-side { align-items: flex-start; }
  .cellgrid { grid-template-columns: repeat(6, 1fr); }
}

/* ================= 班级管理 ================= */

.btnrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 4px; }
.btnrow form { margin: 0; }
.btnrow details { width: 100%; }
.btnrow summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.btnrow summary::-webkit-details-marker { display: none; }
.btnrow summary::after { content: "展开"; font-size: 12px; opacity: .8; }
.btnrow details[open] summary::after { content: "收起"; }

.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; min-width: 210px; }
.inline-form input[type=text] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d7e2ea;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.inline-form input[type=text]:focus { outline: none; border-color: var(--brand); }

@media (max-width: 560px) {
  .inline-form .field { min-width: 100%; }
}

/* ================= 改密规则说明 ================= */

.rulebox {
  background: #f4f8fb;
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  padding: 16px 18px 14px;
  margin: 4px 0 18px;
}
.rulebox-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
}
.rulelist {
  margin: 0 0 12px;
  padding-left: 22px;
  color: #3d4b57;
  font-size: 14px;
  line-height: 1.9;
}
.rulelist li { margin: 0; }
.rulebox-eg {
  margin: 0 0 8px;
  font-size: 13px;
  color: #4a5560;
  line-height: 1.9;
}
.rulebox-eg code {
  background: #e4edf4;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  color: #1f4d6b;
}
.rulebox-tip {
  margin: 0;
  font-size: 13px;
  color: #7a6a4f;
  line-height: 1.8;
}

/* ================= 备案号 ================= */

.sitefoot-beian { margin: 6px 0 0; font-size: 13px; }
.sitefoot-beian a { color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; opacity: .85; }
.sitefoot-beian a:hover { opacity: 1; color: var(--brand); }
