:root {
  --primary: #1663c7;
  --primary-dark: #0e4a99;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2d3d;
  --muted: #7b8a9c;
  --border: #e4eaf2;
  --green: #16a34a;
  --orange: #ea8a1f;
  --red: #dc4a4a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0e4a99 0%, #1663c7 45%, #3f8ae0 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 44px 40px; width: 400px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-logo { font-size: 44px; margin-bottom: 8px; }
.login-card h1 { font-size: 21px; line-height: 1.5; margin-bottom: 6px; }
.login-sub { color: var(--muted); font-size: 12px; margin-bottom: 26px; letter-spacing: .5px; }
.login-card input { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 14px; font-size: 14px; outline: none; }
.login-card input:focus { border-color: var(--primary); }
.login-tip { color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ---------- 布局 ---------- */
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 230px; background: #10315e; color: #cfe0f5;
  display: flex; flex-direction: column; z-index: 10; }
.side-logo { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.side-logo-icon { font-size: 28px; }
.side-logo b { display: block; color: #fff; font-size: 15px; }
.side-logo small { font-size: 11px; opacity: .65; }
#nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px; cursor: pointer;
  margin-bottom: 4px; color: #cfe0f5; font-size: 14px; }
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 9px; font-size: 11px; padding: 1px 7px; }
.side-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; font-size: 13px; }
.side-foot a { color: #9dbbe0; }
.content { margin-left: 230px; padding: 26px 32px; max-width: 1200px; }

/* ---------- 通用 ---------- */
.btn { border: none; border-radius: 8px; padding: 9px 18px; font-size: 14px; cursor: pointer; background: #e7edf5; color: var(--text); }
.btn:hover { filter: brightness(.96); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.page-title { font-size: 20px; margin-bottom: 4px; }
.page-sub { color: var(--muted); margin-bottom: 20px; }
.tag { display: inline-block; background: #e8f0fc; color: var(--primary); border-radius: 5px; padding: 2px 9px; font-size: 12px; margin-right: 6px; }
.tag.gray { background: #eef1f5; color: var(--muted); }
.tag.green { background: #e5f7ec; color: var(--green); }
.muted { color: var(--muted); }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.grow { flex: 1; }
select, textarea, input.plain { border: 1px solid var(--border); border-radius: 7px; padding: 8px 11px; font-size: 13px; font-family: inherit; outline: none; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
select:focus, textarea:focus, input.plain:focus { border-color: var(--primary); }

/* ---------- 项目卡片 ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.proj-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; cursor: pointer;
  transition: all .15s; position: relative; }
.proj-card:hover { box-shadow: 0 8px 24px rgba(22,99,199,.13); transform: translateY(-2px); }
.proj-card.locked { opacity: .62; cursor: default; }
.proj-card h3 { font-size: 15.5px; margin: 8px 0 8px; }
.proj-card p { color: var(--muted); font-size: 13px; line-height: 1.6; min-height: 42px; }
.proj-card .dataset { font-size: 12px; color: var(--muted); margin-top: 10px; }
.proj-icon { font-size: 24px; }
.status-pill { position: absolute; top: 14px; right: 14px; font-size: 11px; padding: 3px 10px; border-radius: 20px; }
.status-pill.active { background: #e5f7ec; color: var(--green); }
.status-pill.coming { background: #fdf3e4; color: var(--orange); }
.status-pill.locked { background: #fdecec; color: var(--red); }
.tag.red { background: #fdecec; color: var(--red); }
.progress-bar { height: 6px; background: #e9eef5; border-radius: 3px; margin-top: 12px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }

/* ---------- 实验步骤 ---------- */
.exp-block { margin-bottom: 14px; }
.exp-head { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 14px 18px; }
.exp-head h3 { font-size: 15px; flex: 1; }
.exp-body { border-top: 1px solid var(--border); padding: 6px 18px 14px; }
.step-card { display: flex; gap: 14px; padding: 15px 4px; border-bottom: 1px dashed var(--border); }
.step-card:last-child { border-bottom: none; }
.step-no { width: 30px; height: 30px; border-radius: 50%; background: #e7edf5; color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.step-no.done { background: var(--green); color: #fff; }
.step-no.submitted { background: var(--orange); color: #fff; }
.step-main { flex: 1; }
.step-main h4 { font-size: 14.5px; margin-bottom: 5px; }
.step-main p { color: var(--muted); line-height: 1.65; font-size: 13.5px; }
.step-guide { background: #f6f9fd; border-left: 3px solid var(--primary); padding: 9px 12px; border-radius: 0 7px 7px 0;
  margin-top: 9px; font-size: 13px; color: #3c5a7d; line-height: 1.65; }
.step-actions { margin-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.score-chip { font-size: 12.5px; color: var(--green); }
.step-score { font-size: 12.5px; margin-top: 7px; color: var(--muted); }

/* ---------- 图表 ---------- */
.chart-box { background: #fbfcfe; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-top: 12px; }
canvas { width: 100%; display: block; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.stat { flex: 1; min-width: 110px; background: #f6f9fd; border-radius: 9px; padding: 12px 14px; }
.stat b { display: block; font-size: 20px; color: var(--primary); }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------- 助手 ---------- */
.chat-box { display: flex; flex-direction: column; height: calc(100vh - 120px); background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.chat-list { flex: 1; overflow-y: auto; padding: 20px; }
.msg { max-width: 72%; margin-bottom: 14px; line-height: 1.7; }
.msg .bubble { padding: 11px 15px; border-radius: 12px; font-size: 14px; }
.msg.ai { margin-right: auto; }
.msg.ai .bubble { background: #f1f5fa; border-bottom-left-radius: 3px; }
.msg.user { margin-left: auto; text-align: right; }
.msg.user .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 3px; text-align: left; }
.msg .src { font-size: 11px; color: var(--muted); margin-top: 4px; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; }

/* ---------- 教师批改 ---------- */
table.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: top; }
.tbl th { background: #f6f9fd; color: var(--muted); font-weight: 500; }
.tbl pre.report { white-space: pre-wrap; font-family: inherit; color: var(--text); max-width: 420px; }

/* ---------- 设置 ---------- */
.radio-cards { display: flex; gap: 12px; margin: 14px 0; }
.radio-card { flex: 1; border: 2px solid var(--border); border-radius: 10px; padding: 14px; cursor: pointer; text-align: center; }
.radio-card.sel { border-color: var(--primary); background: #f0f6ff; }
.radio-card b { display: block; margin-bottom: 4px; }
.radio-card span { font-size: 12px; color: var(--muted); }

.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: #12325e; color: #fff;
  padding: 10px 22px; border-radius: 8px; z-index: 99; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
