:root {
  --blue: #1e4e7a;
  --blue-dark: #16395a;
  --orange: #d4943c;
  --bg: #ffffff;
  --fg: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card: #f9fafb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* 顶栏 */
.topbar {
  background: var(--blue);
  color: #fff;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.brand {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}
.topbar nav { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 14px; opacity: 0.9; }

/* 内容 */
main.container { padding-top: 24px; padding-bottom: 48px; }
h1 { font-size: 26px; color: var(--blue); }

/* 卡片 */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-top: 12px;
  box-shadow: 0 1px 3px rgba(30, 78, 122, 0.06);
}
.muted { color: var(--muted); font-size: 14px; }

/* 按钮 */
.btn-primary {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: #c07f2f; }
.btn-lg { padding: 14px 32px; font-size: 17px; }
.btn-block { display: block; width: 100%; }
.btn-ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 14px;
  text-decoration: none;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.btn-active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  font-weight: 600;
}
.btn-active:hover { background: #c07f2f; }

/* 首页 hero */
.hero { text-align: center; padding: 68px 0; }
.hero h1 { font-size: 28px; font-weight: 700; margin-bottom: 22px; letter-spacing: 4px; color: var(--blue-dark); }
.tagline { font-style: normal; color: var(--blue); font-size: 46px; font-weight: 800; letter-spacing: 2px; margin-bottom: 20px; text-shadow: 0 1px 2px rgba(30, 78, 122, 0.30), 0 4px 10px rgba(30, 78, 122, 0.16); }
.subtitle { color: var(--muted); font-size: 15px; margin-bottom: 40px; letter-spacing: 3px; }

/* 登录 */
.login-card { max-width: 400px; margin: 48px auto; }
.login-brand { text-align: center; font-size: 24px; font-weight: 700; color: var(--blue); letter-spacing: 2px; margin-bottom: 2px; }
.login-tagline { text-align: center; font-size: 13px; color: var(--muted); letter-spacing: 1px; margin: 0 0 20px; }
.field { display: block; margin-bottom: 14px; font-size: 14px; }
.field span { display: block; margin-bottom: 4px; color: var(--fg); }
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
}
.field input:focus { outline: 2px solid var(--blue); border-color: var(--blue); }

.alert {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 14px;
}

/* 底部 */
.footer { color: var(--muted); font-size: 13px; padding: 20px 0; border-top: 1px solid var(--border); }

/* 教师/学生工作台 */
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.page-head h1 { margin-bottom: 0; }
h2 { font-size: 18px; margin-top: 28px; color: var(--blue); }
.card-list { display: grid; gap: 12px; margin-top: 12px; }
.card-title { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  background: #fff;
  color: var(--fg);
}
select:focus { outline: 2px solid var(--blue); }

/* 链接卡片 */
.card-link { display: block; text-decoration: none; color: inherit; transition: border-color 0.15s; }
.card-link:hover { border-color: var(--blue); }

/* 双列表单 */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

/* 复选框 */
.field-check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14px; }
.field-check input { width: auto; }

/* 文本域 */
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}
textarea:focus { outline: 2px solid var(--blue); }

/* 答题 */
.choice-option { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 15px; }
.choice-option input { width: auto; }
.fill-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  margin-top: 6px;
}
.fill-input:focus { outline: 2px solid var(--blue); }

/* 成绩 */
.score-card { display: flex; align-items: baseline; gap: 8px; }
.score-big { font-size: 40px; font-weight: 700; color: var(--blue); }
.correct { color: #15803d; font-weight: 600; }
.wrong { color: #b91c1c; font-weight: 600; }
.late-tag { background: #fef3c7; color: #b45309; padding: 2px 10px; border-radius: 12px; font-size: 12px; }

/* 成绩表 */
.table-card { padding: 0; overflow-x: auto; }
.grade-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.grade-table th, .grade-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.grade-table th { color: var(--muted); font-weight: 600; background: #f3f4f6; }
.grade-table tr:last-child td { border-bottom: none; }

/* 内联表单（文件上传） */
.inline-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inline-form input[type="file"] { font-size: 14px; }

/* 主观题 */
.essay-input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.8;
  resize: vertical;
  margin-bottom: 14px;
}
.essay-input:focus { outline: 2px solid var(--blue); }
.submission-text { white-space: pre-wrap; font-size: 15px; line-height: 1.8; }
.dim-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); gap: 16px; }
.dim-row:last-child { border-bottom: none; }
.feedback-text { white-space: pre-wrap; font-size: 15px; line-height: 1.8; }

/* 批改 */
.dim-info { flex: 1; }
.dim-score { display: flex; align-items: center; gap: 6px; }
.dim-input {
  width: 80px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  text-align: center;
}
.dim-input:focus { outline: 2px solid var(--blue); }
.link { color: var(--blue); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

/* AI 批改 */
.btn-ai {
  background: #eef2ff;
  color: #1e4e7a;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ai:hover { background: #e0e7ff; }
.ai-hint {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px;
}
.ai-grade-form { margin-bottom: 12px; }

/* 学习建议（追踪） */
.rec-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.rec-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: #fff; }
.rec-content { font-size: 15px; line-height: 1.6; margin-bottom: 8px; }
.rec-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.rec-status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.rec-pending { background: #f3f4f6; color: #6b7280; }
.rec-in_progress { background: #eef2ff; color: #3730a3; }
.rec-achieved { background: #ecfdf5; color: #15803d; }
.rec-continue { background: #fef3c7; color: #b45309; }
.rec-actions { display: inline-flex; gap: 8px; margin-left: auto; }
.rec-btn {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
}
.rec-btn:hover { background: #eef2ff; }
.rec-inline { display: inline-flex; margin: 0; }
.rec-form { display: flex; gap: 10px; align-items: center; }
.rec-form input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
}
.rec-form input[type="text"]:focus { outline: 2px solid var(--blue); }

/* 考勤 */
.att-code-card { text-align: center; padding: 32px 20px; }
.att-code {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: 12px;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.att-countdown {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 600;
  color: var(--orange);
}
.att-select {
  width: auto;
  min-width: 90px;
  padding: 6px 8px;
}
.att-note {
  width: 100%;
  max-width: 200px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.att-note:focus { outline: 2px solid var(--blue); }

/* 口语录音 */
.recorder-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
#rec-timer { font-variant-numeric: tabular-nums; font-size: 15px; }

/* 作业材料 */
.file-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.file-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.file-item:last-child { border-bottom: none; }
.file-name { font-size: 14px; }

/* 错误摘录与更正 */
.err-view td { vertical-align: top; padding: 8px; }
.err-original { color: #b91c1c; font-weight: 500; }
.err-correction { color: #15803d; font-weight: 500; }
.err-table input[type="text"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.err-table input[type="text"]:focus { outline: 2px solid var(--blue); }

/* ===== 学生看板（练习概览） ===== */
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; margin: 4px 0 2px; }
.dash-name { font-size: 20px; font-weight: 700; color: var(--blue); }
.dash-meta { font-size: 13px; color: var(--muted); letter-spacing: 0.5px; margin-top: 2px; }
.dash-badge {
  background: var(--orange); color: #fff;
  font-size: 13px; font-weight: 600;
  padding: 4px 14px; border-radius: 14px; white-space: nowrap;
  flex-shrink: 0;
}

.dash-section { margin-top: 26px; }
.dash-title {
  font-size: 17px; font-weight: 700; color: var(--blue);
  letter-spacing: 1px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.dash-title::before {
  content: ""; display: inline-block;
  width: 4px; height: 16px; background: var(--blue); border-radius: 2px;
}

.todo-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-top: 0; background: #fff; }
.todo-icon { font-size: 22px; flex-shrink: 0; }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 15px; font-weight: 600; color: var(--fg); }
.todo-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.todo-due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.todo-due.urgent { color: var(--orange); font-weight: 600; }

.dash-stats { display: flex; justify-content: space-around; text-align: center; padding: 22px 8px; }
.stat-num { font-size: 30px; font-weight: 700; color: var(--orange); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); letter-spacing: 0.5px; margin-top: 4px; }

.weak-bar {
  background: #fdf3e7; border: 1px solid #f0d5b0;
  color: #8a5a1e; font-size: 14px; padding: 12px 16px; margin-top: 12px;
}
.weak-bar strong { color: var(--orange); }

