/* ===== 自适应诊断驱动的自主学习系统 —— 全局样式 ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --accent: #06b6d4;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* 顶部导航 */
.topbar {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { font-size: 18px; font-weight: 700; padding: 14px 0; }
.topbar .brand small { font-weight: 400; opacity: .85; font-size: 12px; margin-left: 8px; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 2px; }
.topbar nav a {
  color: #e0f2fe;
  text-decoration: none;
  font-size: 13px;
  padding: 16px 12px;
  border-bottom: 3px solid transparent;
}
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar nav a.active { color: #fff; border-bottom-color: #fff; font-weight: 600; }

/* 学生身份条 */
.student-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 8px 24px;
  font-size: 13px;
  color: var(--muted);
}
.student-bar input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  width: 180px;
}
.student-bar button {
  border: none; background: var(--primary); color: #fff;
  border-radius: 6px; padding: 5px 14px; font-size: 13px; cursor: pointer;
}
.student-bar button:hover { background: var(--primary-dark); }
.student-bar .hint { color: var(--bad); }

/* 主容器 */
.container { max-width: 1100px; margin: 20px auto; padding: 0 16px; }

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { font-size: 17px; margin-bottom: 10px; }
.card h3 { font-size: 15px; margin: 14px 0 8px; }
.card .desc { color: var(--muted); font-size: 13px; margin-bottom: 10px; }

/* 按钮 */
.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #e2e8f0; color: var(--text); }
.btn.secondary:hover { background: #cbd5e1; }
.btn.ok { background: var(--ok); }
.btn.ok:hover { background: #15803d; }
.btn.warn { background: var(--bad); }
.btn.warn:hover { background: #991b1b; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.option:disabled, .self-btn:disabled { opacity: .55; cursor: not-allowed; }

/* 网格 */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* 岗位群卡片 */
.cluster-card { cursor: pointer; transition: transform .12s, box-shadow .12s; display: flex; flex-direction: column; }
.cluster-card .enter-wrap { margin-top: auto; text-align: center; padding-top: 14px; }
.cluster-card:hover { position: relative; z-index: 20; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,.18); }

/* 标题 / 摘要 / 标签 / 状态固定高度：保证各卡片「标签 → 状态 → 进入按钮」横向对齐 */
.cluster-card h3 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 15px; line-height: 1.4; height: 2.8em; margin: 0 0 8px;
}
.cluster-card .desc-wrap { position: relative; font-size: 13px; line-height: 1.6; height: 4.8em; margin-bottom: 10px; }
.cluster-card .desc {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0;
}
.cluster-card .tags { height: 50px; line-height: 1; overflow: hidden; }
.cluster-card .tag {
  display: inline-block; background: #dbeafe; color: var(--primary-dark);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; line-height: 16px; margin: 4px 4px 0 0;
}
.cluster-card .status {
  font-size: 12px; line-height: 1.4; height: 1.4em; margin-top: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cluster-card .status.done { color: var(--ok); }
.cluster-card .status.learning { color: var(--accent); }

/* 「更多」悬停弹层：绝对定位，不改变卡片尺寸 */
.cluster-card .more-link {
  position: absolute; right: 0; bottom: 0; z-index: 1;
  font-size: 12px; line-height: 1.4; color: var(--primary); cursor: default;
  padding-left: 20px;
  background: linear-gradient(90deg, rgba(255,255,255,0), var(--card) 32%);
}
.cluster-card .more-link:hover { z-index: 30; }
.cluster-card .more-pop {
  display: none; position: absolute; right: 0; top: 100%;
  width: 320px; max-width: 74vw; max-height: 60vh; cursor: text;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(15,23,42,.18); padding: 12px 14px; text-align: left;
  flex-direction: column;
}
.cluster-card .more-link:hover .more-pop { display: flex; }
.cluster-card .more-pop-title { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; flex: 0 0 auto; }
.cluster-card .more-pop-text {
  display: block; font-size: 12px; line-height: 1.7; color: var(--muted);
  white-space: pre-wrap; flex: 1 1 auto; min-height: 0; overflow: auto;
}

/* 公告栏：喇叭图标 + 数据更新时间 */
.desc.notice { display: flex; align-items: baseline; gap: 8px; }
.desc.notice .notice-icon { flex: 0 0 auto; color: var(--primary); align-self: center; }
.desc.notice .notice-time { color: var(--primary); white-space: nowrap; margin-left: auto; }

/* 进度条 */
.progress { background: #e2e8f0; border-radius: 999px; height: 10px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--ok)); border-radius: 999px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; background: #f8fafc; }

/* 徽标 */
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.badge.ok { background: #dcfce7; color: #15803d; }
.badge.warn { background: #fef3c7; color: #b45309; }
.badge.bad { background: #fee2e2; color: #b91c1c; }

/* 聊天 */
.chat-box { border: 1px solid var(--border); border-radius: var(--radius); height: 440px; overflow-y: auto; padding: 14px; background: #f8fafc; }
.msg { margin-bottom: 12px; max-width: 78%; padding: 10px 14px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.msg.user { background: var(--primary); color: #fff; margin-left: auto; }
.msg.assistant { background: #fff; border: 1px solid var(--border); }
.msg.system { background: #eef2ff; color: #4338ca; font-size: 12px; margin: 6px auto; text-align: center; max-width: 100%; }
.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.chat-input textarea { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 14px; resize: none; font-family: inherit; }
.chat-input textarea:focus { outline: 2px solid var(--primary); }

/* 图谱 SVG */
.graph-svg { width: 100%; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.graph-node { cursor: pointer; }
.graph-node .box { fill: #dbeafe; stroke: var(--primary); stroke-width: 1.2; rx: 8; }
.graph-node.lighted .box { fill: #dcfce7; stroke: var(--ok); }
.graph-node.weak .box { fill: #fee2e2; stroke: var(--bad); }
.graph-node text { font-size: 12px; fill: var(--text); text-anchor: middle; }
.graph-node.lighted text.node-name { fill: #15803d; font-weight: 600; }
.graph-edge { stroke: #94a3b8; stroke-width: 1.2; marker-end: url(#arrow); }
.graph-legend { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.graph-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 12px; vertical-align: -1px; }
.graph-legend .dot:first-child { margin-left: 0; }

/* 图谱操作提示：链接图标 + 显眼配色 */
.graph-tip {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 10px;
  color: #b45309; background: #fef3c7; border: 1px solid #fde68a;
  border-radius: 999px; padding: 2px 10px; font-size: 12px;
  max-width: 100%; white-space: normal;
}
.graph-tip svg { flex: 0 0 auto; }

/* 题干与选项 */
.question { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.option { display: block; width: 100%; text-align: left; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; background: #fff; cursor: pointer; font-size: 14px; }
.option:hover { border-color: var(--primary); }
.option.selected { border-color: var(--primary); background: #eff6ff; }
.option.correct { border-color: var(--ok); background: #f0fdf4; }
.option.wrong { border-color: var(--bad); background: #fef2f2; }

/* 步骤列表 */
.steps { list-style: none; counter-reset: step; }
.steps li { counter-increment: step; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; font-size: 14px; background: #f8fafc; }
.steps li::before { content: "步骤 " counter(step); display: block; font-size: 12px; color: var(--primary-dark); font-weight: 600; margin-bottom: 2px; }

/* 岗位推荐 */
.job-card .match { font-size: 22px; font-weight: 700; color: var(--primary); }
.job-card .match small { font-size: 12px; color: var(--muted); font-weight: 400; }
.job-card .skills { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 空态/提示 */
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }
.hint-text { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 学习/考核计时器（答疑页与考核页顶部显示） */
.study-timer {
  margin-left: auto;
  font-size: 13px;
  color: var(--primary-dark);
  background: #dbeafe;
  border-radius: 999px;
  padding: 5px 14px;
  white-space: nowrap;
}
.study-timer.paused { background: #fef3c7; color: #b45309; }

/* 学情档案：指标卡 */
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .stat-grid { grid-template-columns: 1fr; } }
.stat { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #f8fafc; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 22px; font-weight: 700; color: var(--primary-dark); margin-top: 4px; }
.stat .value.ok { color: var(--ok); }
.stat .value.warn { color: var(--warn); }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 学情档案：近 30 天趋势柱状图（纯 CSS） */
.trend { display: flex; align-items: flex-end; gap: 3px; height: 130px; margin-top: 10px; }
.trend .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.trend .col i { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #93c5fd, var(--primary)); }
.trend .col.valid i { background: linear-gradient(180deg, #34d399, var(--ok)); }
.trend .col span { font-size: 10px; color: var(--muted); margin-top: 4px; height: 12px; }
.trend-axis { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }

/* 页脚团队名：悬停弹出成员名单（绝对定位，不改变页脚高度） */
footer .team-name { position: relative; color: var(--primary); cursor: default; }
footer .team-name:hover { z-index: 30; }
footer .team-pop {
  display: none; position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%);
  white-space: nowrap; background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,.18); padding: 6px 12px; font-size: 12px;
}
footer .team-name:hover .team-pop { display: block; }

/* ===== 登录页（沉浸式背景图 + 玻璃拟态卡片） ===== */
.login-page {
  min-height: 100vh;
  position: relative;
  background: #0b1220;
}
.login-hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 60px 16px 84px;
  background-color: #0b1220;
  background-image: url('../img/login-bg.jpg');
  background-size: cover;
  background-position: center;
}
.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,18,32,.6), rgba(11,18,32,.28) 45%, rgba(11,18,32,.68));
  z-index: 0;
}
.login-brand, .login-card { position: relative; z-index: 1; }

.login-brand { text-align: center; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.45); }
.login-brand .brand { display: block; font-size: 28px; font-weight: 700; letter-spacing: 1px; }
.login-brand small { display: block; margin-top: 10px; font-size: 14px; font-weight: 400; opacity: .92; letter-spacing: .5px; }

.login-card {
  width: 400px;
  max-width: calc(100vw - 32px);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(2,6,23,.45);
  padding: 34px 32px 26px;
}
.login-card h2 { font-size: 20px; text-align: center; margin-bottom: 6px; }
.login-card .desc { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.login-card input {
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: rgba(255,255,255,.92);
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.login-card .btn { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.login-card .hint-text { text-align: center; margin-top: 12px; }
.login-card .login-foot { text-align: center; margin-top: 18px; font-size: 13px; }
.login-card .login-foot a { color: var(--muted); text-decoration: none; }
.login-card .login-foot a:hover { color: var(--primary); }

.login-page footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 1;
  text-align: center;
  color: rgba(255,255,255,.82);
  font-size: 12px;
  padding: 14px;
  background: linear-gradient(180deg, transparent, rgba(11,18,32,.72));
}
/* 登录页为深色背景，团队名用纯白保证可读性 */
.login-page footer .team-name { color: #fff; }

@media (max-width: 600px) {
  .login-brand .brand { font-size: 22px; }
  .login-brand small { font-size: 12px; }
}
