/* 老年护理学 课程教学网站 —— 设计系统
   字体：微软雅黑（无衬线，投影可读）
   配色：青绿主色 + 暖橙辅色 + 蓝色强调，浅色暖底
*/

:root {
  --brand: #1B6B63;
  --brand-dark: #124B45;
  --brand-light: #E6F2F0;
  --accent: #D97E2B;
  --accent-light: #FDEEE0;
  --blue: #2A6FA8;
  --blue-light: #E8F1F9;
  --purple: #6B5CA5;
  --danger: #C4443A;
  --ok: #2E7D5B;

  --bg: #F6F4F1;
  --surface: #FFFFFF;
  --surface-2: #FAF8F6;
  --line: #E2DDD6;
  --line-strong: #CFC8BE;

  --text: #22303C;
  --text-2: #5A6772;
  --text-3: #8A949D;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(34, 48, 60, .07);
  --shadow-lg: 0 8px 28px rgba(34, 48, 60, .13);
  --nav-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.35; letter-spacing: .3px; }
p { margin: 0 0 12px; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ==================== 布局 ==================== */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--brand-dark);
  color: #fff;
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px;
  box-shadow: 0 2px 12px rgba(18, 75, 69, .25);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; white-space: nowrap; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #F0A85C);
  display: grid; place-items: center; font-size: 17px; font-weight: 800; color: #fff;
}
.brand small { display: block; font-size: 11px; font-weight: 400; opacity: .78; letter-spacing: .5px; }

.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: rgba(255,255,255,.82); font-size: 15px; font-weight: 500;
  padding: 7px 13px; border-radius: 20px; white-space: nowrap; transition: .15s;
}
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a.active { background: #fff; color: var(--brand-dark); font-weight: 700; }

.status-pill {
  font-size: 12.5px; padding: 5px 11px; border-radius: 20px; white-space: nowrap;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
}
.status-pill.online { background: rgba(46,125,91,.9); border-color: transparent; }

/* 右上角登录态 */
.user-chip { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.user-chip .uchip {
  font-size: 12.5px; padding: 5px 11px; border-radius: 20px; white-space: nowrap;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  color: #fff; text-decoration: none; line-height: 1.5;
}
.user-chip a.uchip:hover { background: rgba(255,255,255,.24); color: #fff; }
.user-chip .uchip.ok { background: rgba(46,125,91,.92); border-color: transparent; }
.user-chip .uchip.warn { background: rgba(217,126,43,.94); border-color: transparent; }
.user-chip .uchip.act { cursor: pointer; background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.30); }
.user-chip .uchip.act:hover { background: rgba(255,255,255,.24); }
@media (max-width: 900px) {
  .user-chip .uchip { font-size: 12px; padding: 4px 9px; }
}

.main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 20px 70px; }

/* ==================== 通用组件 ==================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card.tight { padding: 16px 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2, .card-h h3 { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.card-h .sub { font-size: 13.5px; color: var(--text-3); font-weight: 400; }

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 27px; margin-bottom: 6px; }
.page-head p { color: var(--text-2); font-size: 15px; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: none;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.ghost:hover { background: var(--brand-light); }
.btn.warn { background: var(--accent); }
.btn.warn:hover { background: #B9661F; }
.btn.gray { background: #EDF0F2; color: var(--text-2); }
.btn.gray:hover { background: #E1E6EA; }
.btn.sm { padding: 5px 12px; font-size: 13.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tag {
  display: inline-block; font-size: 12.5px; font-weight: 600;
  padding: 2px 9px; border-radius: 5px; background: var(--brand-light); color: var(--brand);
}
.tag.orange { background: var(--accent-light); color: var(--accent); }
.tag.blue { background: var(--blue-light); color: var(--blue); }
.tag.gray { background: #EDF0F2; color: var(--text-2); }
.tag.purple { background: #EFECF8; color: var(--purple); }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

input[type=text], input[type=number], textarea, select {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm); background: #fff; color: var(--text); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); }
textarea { resize: vertical; min-height: 76px; line-height: 1.7; }

.empty { text-align: center; padding: 40px 20px; color: var(--text-3); font-size: 15px; }

/* ==================== 首页 ==================== */
.hero {
  background: linear-gradient(120deg, var(--brand-dark) 0%, var(--brand) 55%, #2E8C80 100%);
  color: #fff; border-radius: 16px; padding: 30px 32px; margin-bottom: 20px;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.hero h1 { font-size: 30px; margin-bottom: 8px; }
.hero p { opacity: .92; font-size: 15.5px; margin-bottom: 16px; max-width: 640px; }
.hero-meta { display: flex; gap: 26px; flex-wrap: wrap; font-size: 14px; position: relative; }
.hero-meta div span { display: block; opacity: .75; font-size: 12.5px; }
.hero-meta div b { font-size: 18px; font-weight: 700; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 760px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 27px; color: var(--brand); line-height: 1.2; }
.stat span { font-size: 13.5px; color: var(--text-2); }

/* 16 周时间轴 */
.week-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px; }
.week-chip {
  flex: 0 0 auto; width: 108px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; padding: 9px 10px; transition: .15s;
}
.week-chip:hover { border-color: var(--brand); transform: translateY(-2px); }
.week-chip.now { border-color: var(--accent); background: var(--accent-light); }
.week-chip.done { background: var(--brand-light); border-color: #BFDCD7; }
.week-chip b { display: block; font-size: 13px; color: var(--text-2); }
.week-chip strong { display: block; font-size: 14px; line-height: 1.4; }
.week-chip em { font-style: normal; font-size: 11.5px; color: var(--text-3); }

/* ==================== 周次详情 ==================== */
.week-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.week-nav select { width: auto; min-width: 240px; }

.obj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .obj-grid { grid-template-columns: 1fr; } }
.obj-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 16px; border-left: 4px solid var(--brand); }
.obj-box.blue { border-left-color: var(--blue); }
.obj-box.orange { border-left-color: var(--accent); }
.obj-box h4 { font-size: 15px; margin-bottom: 6px; }
.obj-box ul { margin: 0; padding-left: 19px; font-size: 14.5px; }
.obj-box li { margin-bottom: 3px; }

.kp-list { list-style: none; padding: 0; margin: 0; }
.kp-list li {
  padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 9px; background: var(--surface-2); font-size: 15px;
}
.kp-list li b { color: var(--brand-dark); }
.kp-list li .detail { display: block; color: var(--text-2); font-size: 14px; margin-top: 4px; }

.step-flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.step-flow .st {
  background: var(--brand-light); color: var(--brand-dark); font-size: 13.5px; font-weight: 600;
  padding: 6px 13px; border-radius: 20px;
}
.step-flow .ar { color: var(--text-3); }

/* ==================== 测试 ==================== */
.q-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; background: #fff; }
.q-stem { font-size: 16.5px; font-weight: 600; margin-bottom: 12px; line-height: 1.7; }
.q-stem .qno { color: var(--brand); margin-right: 6px; }
.q-opts { display: grid; gap: 8px; }
.q-opt {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); transition: .12s; font-size: 15px;
}
.q-opt:hover { border-color: var(--brand); }
.q-opt.sel { border-color: var(--brand); background: var(--brand-light); }
.q-opt.right { border-color: var(--ok); background: #E7F4EC; }
.q-opt.wrong { border-color: var(--danger); background: #FBEAE8; }
.q-opt .lett { font-weight: 700; min-width: 20px; }
.q-expl {
  margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: #FFF8EE; border-left: 4px solid var(--accent); font-size: 14.5px; color: #6B4A1E;
  display: none;
}
.q-expl.show { display: block; }
.q-expl b { color: var(--accent); }

.result-bar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--brand-light); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px;
}
.result-bar .score { font-size: 32px; font-weight: 800; color: var(--brand-dark); }
.result-bar .score small { font-size: 15px; font-weight: 600; }

/* ==================== 心情签到 ==================== */
.mood-picker { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.mood-btn {
  flex: 1 1 108px; cursor: pointer; border: 2px solid var(--line); border-radius: var(--radius);
  background: #fff; padding: 14px 8px; text-align: center; transition: .15s;
}
.mood-btn:hover { transform: translateY(-3px); border-color: var(--brand); }
.mood-btn.sel { border-color: var(--brand); background: var(--brand-light); }
.mood-btn .face { font-size: 30px; display: block; line-height: 1.2; }
.mood-btn .nm { font-size: 14px; font-weight: 600; }

.mood-board { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-item {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px;
  background: #fff; font-size: 14px; display: flex; align-items: center; gap: 8px;
}
.mood-item .face { font-size: 20px; }
.mood-item .who { font-weight: 600; }
.mood-item .msg { color: var(--text-2); font-size: 13.5px; }

/* ==================== 随堂 ==================== */
.timer-big {
  font-size: 62px; font-weight: 800; color: var(--brand-dark); text-align: center;
  font-variant-numeric: tabular-nums; letter-spacing: 2px; line-height: 1.1;
}
.timer-ctrl { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }

.roll-box {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff; border-radius: var(--radius); padding: 26px; text-align: center;
}
.roll-box .nm { font-size: 40px; font-weight: 800; min-height: 56px; letter-spacing: 3px; }

.seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.seat {
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  padding: 8px 6px; text-align: center; font-size: 13.5px; cursor: pointer; transition: .15s;
}
.seat:hover { border-color: var(--brand); }
.seat.on { background: var(--brand-light); border-color: var(--brand); font-weight: 700; }

.poll-opt { margin-bottom: 10px; }
.poll-bar { height: 26px; background: #EDEAE6; border-radius: 5px; overflow: hidden; position: relative; }
.poll-bar i {
  display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #3C9B8E);
  transition: width .4s;
}
.poll-bar span {
  position: absolute; left: 10px; top: 0; line-height: 26px; font-size: 13.5px;
  font-weight: 600; color: var(--text);
}

/* ==================== 讨论 / 作品 ==================== */
.post { border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; background: #fff; margin-bottom: 12px; }
.post-h { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; flex-wrap: wrap; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; flex: 0 0 auto;
}
.post-h .who { font-weight: 700; font-size: 14.5px; }
.post-h .tm { font-size: 12.5px; color: var(--text-3); }
.post-body { font-size: 15px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.post-f { display: flex; gap: 14px; margin-top: 10px; font-size: 13.5px; color: var(--text-2); }
.post-f button { background: none; border: none; cursor: pointer; color: var(--text-2); font-size: 13.5px; padding: 0; }
.post-f button:hover { color: var(--brand); }
.reply { border-left: 3px solid var(--brand-light); padding: 9px 0 9px 14px; margin-top: 10px; font-size: 14.5px; }
.reply + .reply { border-top: 1px dashed var(--line); }

.work-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.work-thumb {
  height: 128px; background: linear-gradient(135deg, var(--brand-light), var(--accent-light));
  display: grid; place-items: center; font-size: 40px;
}
.work-card .wb { padding: 14px 16px; }
.work-card h4 { font-size: 16px; margin-bottom: 5px; }
.work-card p { font-size: 14px; color: var(--text-2); margin-bottom: 10px; }
.stars { color: var(--accent); font-size: 15px; letter-spacing: 2px; }

/* ==================== 知识图谱 ==================== */
.graph-wrap { position: relative; background: #FBFAF8; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.graph-svg { display: block; width: 100%; height: 560px; touch-action: none; cursor: grab; }
.graph-svg:active { cursor: grabbing; }
.gnode { cursor: pointer; }
.gnode circle { transition: stroke-width .15s; }
.gnode:hover circle { stroke-width: 3.5; }
.gnode text { font-size: 12.5px; font-weight: 600; pointer-events: none; }
.gnode.dim { opacity: .16; }
.gedge { stroke: #C3CCC8; stroke-width: 1.2; transition: .15s; }
.gedge.dim { opacity: .1; }
.gedge.hot { stroke: var(--accent); stroke-width: 2.6; }
.graph-panel {
  position: absolute; right: 12px; top: 12px; width: 268px; max-height: 500px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; box-shadow: var(--shadow-lg); font-size: 14.5px; display: none;
}
.graph-panel.show { display: block; }
.graph-panel h4 { font-size: 17px; margin-bottom: 4px; color: var(--brand-dark); }
.graph-panel .en { font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.graph-panel .rel { font-size: 13.5px; color: var(--text-2); margin-top: 10px; }
.graph-panel .rel a { display: block; padding: 3px 0; cursor: pointer; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); padding: 10px 2px 0; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* ==================== 教师端 ==================== */
.t-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.t-row:last-child { border-bottom: none; }
.t-row .nm { min-width: 82px; font-weight: 600; }
.bar { flex: 1; height: 18px; background: #EDEAE6; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #4FA697); }
.bar i.warn { background: linear-gradient(90deg, var(--accent), #EBA35C); }
.bar i.bad { background: linear-gradient(90deg, var(--danger), #E27268); }
.t-row .vv { min-width: 54px; text-align: right; font-variant-numeric: tabular-nums; }

/* ==================== 尾部 / 提示 ==================== */
.foot { text-align: center; color: var(--text-3); font-size: 13px; padding: 22px 0 8px; }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 11px 22px; border-radius: 24px;
  font-size: 15px; z-index: 999; opacity: 0; transition: .25s; pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.notice {
  background: var(--blue-light); border-left: 4px solid var(--blue);
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14.5px; color: #1D4E75;
  margin-bottom: 16px;
}
.notice b { color: var(--blue); }

/* ============ 附件：展示 ============ */
.att-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.att {
  display: flex; align-items: center; gap: 7px; max-width: 260px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 7px 11px; text-decoration: none;
  font-size: 13.5px; color: var(--text); transition: .18s;
}
.att:hover { border-color: var(--brand); background: var(--brand-light); }
.att .ai { font-size: 17px; line-height: 1; }
.att .an { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .as { color: var(--text-3); font-size: 12px; margin-left: auto; white-space: nowrap; }
.att.img { flex-direction: column; align-items: stretch; padding: 6px; max-width: 150px; }
.att.img img { width: 100%; height: 92px; object-fit: cover; border-radius: 5px; display: block; background: var(--line); }
.att.img .an { font-size: 12.5px; margin-top: 5px; }
.att.img .as { margin-left: 0; }

/* ============ 附件：上传选择区 ============ */
.up-zone {
  margin-top: 10px; border: 2px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); padding: 14px 16px; cursor: pointer; transition: .18s;
}
.up-zone:hover { border-color: var(--brand); background: var(--brand-light); }
.up-zone.over { border-color: var(--brand); background: var(--brand-light); }
.up-zone .uh { font-size: 14px; color: var(--text-2); }
.up-zone .ul { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.up-zone .ui {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 13.5px;
}
.up-zone .ui .un { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-zone .ui .us { color: var(--text-3); font-size: 12px; }
.up-zone .ui button {
  border: none; background: none; color: var(--text-3); cursor: pointer;
  font-size: 17px; line-height: 1; padding: 0 4px;
}
.up-zone .ui button:hover { color: var(--danger); }

/* ============ 资料库 ============ */
.mat-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 4px;
  border-bottom: 1px solid var(--line);
}
.mat-item:last-child { border-bottom: none; }
.mat-ico {
  width: 42px; height: 42px; flex: none; border-radius: 9px; display: grid; place-items: center;
  font-size: 21px; background: var(--brand-light); color: var(--brand);
}
.mat-m { flex: 1; min-width: 0; }
.mat-m b { font-size: 15px; display: block; }
.mat-m p { font-size: 13.5px; color: var(--text-2); margin: 3px 0 0; }

@media print {
  .topbar, .nav, .btn, .toast { display: none !important; }
  .card { break-inside: avoid; box-shadow: none; }
}
