:root {
  --hc: #1A2B4A;
  --mc: #52647D;
  --lc: #8D9AAB;
  --line: #D8D8D8;
  --bg: #F4F5F7;
  --text: #252525;
  --amber: #C8861A;
  --green: #2E7D32;
  --red: #B84C3A;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
}

.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  background: var(--hc);
  color: #fff;
  padding: 0 20px;
}
.brand { font-size: 18px; font-weight: bold; padding: 14px 0; }
.ver { font-size: 12px; font-weight: normal; opacity: .75; margin-left: 8px; }
.nav { display: flex; margin-left: auto; }
.nav-btn {
  background: none; border: none; color: #fff; padding: 16px 18px;
  font-size: 15px; cursor: pointer; border-bottom: 3px solid transparent;
}
.nav-btn:hover { background: rgba(255,255,255,.1); }
.nav-btn.active { border-bottom-color: var(--amber); }
.nav-toggle { display: none; background: none; border: 1px solid #fff; color: #fff; padding: 6px 12px; margin-left: auto; }

/* 分组下拉导航 */
.nav-group { position: relative; }
.nav-group-title {
  background: none; border: none; color: #fff; padding: 16px 16px;
  font-size: 15px; cursor: pointer; border-bottom: 3px solid transparent;
}
.nav-group:hover > .nav-group-title,
.nav-group.open > .nav-group-title { background: rgba(255,255,255,.1); }
.nav-group-items {
  display: none; position: absolute; top: 100%; left: 0; min-width: 158px;
  background: var(--hc); box-shadow: 0 10px 22px rgba(0,0,0,.28);
  border-radius: 0 0 6px 6px; z-index: 60; flex-direction: column; padding: 4px 0;
}
.nav-group:hover > .nav-group-items,
.nav-group.open > .nav-group-items { display: flex; }
.nav-group-items .nav-btn { padding: 10px 16px; border-bottom: none; text-align: left; white-space: nowrap; }
.nav-group-items .nav-btn.active { border-bottom: none; color: var(--amber); }

.student-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #fff; padding: 10px 20px; border-bottom: 1px solid var(--line);
}
.student-bar select, .inline-form input, .inline-form select {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; font-size: 14px;
}
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.hidden { display: none !important; }

.container { max-width: 1180px; margin: 22px auto; padding: 0 20px; }
.tab { display: none; }
.tab.active { display: block; }
h2 { color: var(--hc); border-left: 5px solid var(--hc); padding-left: 10px; }
h3 { color: var(--mc); margin-top: 22px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 16px; margin: 14px 0;
}
.card label { display: block; margin: 10px 0 4px; font-weight: bold; }
.card select, .card textarea {
  width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 4px;
  font-family: inherit; font-size: 14px;
}
.material-body {
  background: #fafafa; border-left: 4px solid var(--mc); padding: 10px 14px;
  font-family: "Times New Roman", serif; line-height: 1.5; margin: 10px 0; white-space: pre-wrap;
}

.btn {
  background: var(--hc); color: #fff; border: none; padding: 9px 20px;
  border-radius: 5px; cursor: pointer; font-size: 15px; margin-top: 10px;
}
.btn:hover { background: #2a4170; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn[data-busy="1"] { opacity: 0.6; cursor: not-allowed; }
.btn[data-busy="1"]:hover { background: var(--hc); }

.list .item {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 14px; margin-bottom: 8px; cursor: pointer;
}
.list .item:hover { border-color: var(--mc); }

table { width: 100%; border-collapse: collapse; background: #fff; margin: 10px 0; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; font-size: 13.5px; vertical-align: top; }
th { background: var(--hc); color: #fff; }
tr:nth-child(even) td { background: #f7f8fa; }
a { color: var(--mc); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 13px; font-weight: bold; }
.b-优秀 { background: #E2EFDA; color: var(--green); }
.b-良好 { background: #FFF2CC; color: var(--amber); }
.b-合格 { background: #FCE4D6; color: #B5651D; }
.b-需改进 { background: #F8CBAD; color: var(--red); }

.band-pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 13px; font-weight: bold; white-space: nowrap; }
.band-薄弱 { background: #F8CBAD; color: var(--red); }
.band-初步掌握 { background: #FFF2CC; color: #8A5A00; }
.band-巩固中 { background: #DCE6F1; color: var(--hc); }
.band-已掌握 { background: #E2EFDA; color: var(--green); }

.score-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 12px 0; }
.score-cell { background: #fafafa; border: 1px solid var(--line); border-radius: 6px; padding: 10px; text-align: center; }
.score-cell .lab { font-size: 13px; color: var(--mc); }
.score-cell .val { font-weight: bold; margin-top: 4px; }
.issue { color: var(--red); margin: 4px 0; }
.score-cell .metric { font-size: 12px; color: var(--mc); margin-top: 6px; line-height: 1.4; }
.capability-note { margin: 10px 0; padding: 9px 12px; font-size: 12.5px; line-height: 1.5; color: var(--mc); background: #f6f7f9; border: 1px solid var(--line); border-left: 4px solid var(--hc); border-radius: 6px; }
.unanswered-note { margin: 8px 0; padding: 8px 12px; font-size: 13px; color: #8a5a00; background: #fdf6e3; border: 1px solid #e8d49a; border-radius: 6px; }
.issues-block { margin: 10px 0; padding: 10px 14px; background: #fbf3f2; border: 1px solid #e6c9c4; border-left: 4px solid #b04a3c; border-radius: 6px; }
.issues-block h4 { margin: 0 0 6px; font-size: 14px; color: #96382c; }
.issues-block ul { margin: 0; padding-left: 18px; }
.issues-block li { font-size: 13px; line-height: 1.6; color: #7a3026; }
.suggest-block { margin: 14px 0 10px; }
.suggest-block h4 { margin-bottom: 8px; }
.suggest-item { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--hc); border-radius: 6px; padding: 10px 14px; margin-bottom: 8px; }
.suggest-head { font-weight: bold; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.suggest-item ul { margin: 8px 0 0; padding-left: 20px; }
.suggest-item li { margin: 4px 0; line-height: 1.5; }
.rubric-block { margin-top: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 14px; background: #fafafa; }
.rubric-dim { margin-bottom: 12px; }
.rubric-dim-head { font-weight: bold; margin-bottom: 6px; }
.rubric-line { display: flex; gap: 10px; font-size: 13px; line-height: 1.6; align-items: baseline; }
.rubric-band { flex: 0 0 48px; font-weight: bold; color: var(--hc); }
.mission-item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin-bottom: 8px; }
.mission-item .prio { background: var(--hc); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 auto; }
.mission-item .meta { margin-left: auto; font-size: 12.5px; color: var(--mc); }
.unit-item, .hint-item { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin-bottom: 8px; }
.unit-item b, .hint-item b { color: var(--hc); }

.grammar-passage {
  background: #fafafa; border: 1px solid var(--line); border-radius: 6px;
  padding: 16px; line-height: 2.2; font-family: "Times New Roman", serif; font-size: 15.5px;
}
.gblank {
  width: 88px; padding: 4px 6px; border: 1px solid var(--mc); border-radius: 4px;
  font-family: "Times New Roman", serif; font-size: 14px; text-align: center;
}
.gblank:focus { outline: 2px solid var(--amber); border-color: var(--amber); }

.rq-item { margin: 12px 0; }
.rq-item b { display: block; margin-bottom: 6px; color: var(--hc); }
.ranswer {
  width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 4px;
  font-family: inherit; font-size: 14px;
}

.exam-timer { margin-left: 12px; font-weight: bold; color: var(--amber); }
.note { color: #666; font-size: 13px; }

.math-answer {
  width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 4px;
  font-family: Arial, sans-serif; font-size: 14px;
}
.math-answer:focus { outline: 2px solid var(--amber); border-color: var(--amber); }

.step-miss td { color: #c0392b; background: #fdecea; }

/* 英语听力 */
.listening-section { border: 1px solid var(--line); border-radius: 6px; padding: 14px; margin-bottom: 16px; background: #fff; }
.listening-section h4 { margin: 0 0 10px; }
.listening-section audio { width: 100%; margin-bottom: 8px; }
.audio-pending { color: #b9770e; background: #fef5e7; border: 1px solid #f5d7a1; border-radius: 4px; padding: 8px 10px; font-size: 13px; }
.listening-section details { margin: 8px 0; }
.listening-section details summary { cursor: pointer; color: var(--amber); font-size: 14px; }
.listening-section details p { font-size: 13px; color: #555; background: #fafafa; border: 1px solid var(--line); border-radius: 4px; padding: 10px; line-height: 1.6; }
.choice-opt { display: block; padding: 6px 0; font-size: 14px; }
.choice-q { margin: 10px 0; }

@media (max-width: 768px) {
  .gblank { width: 64px; }
  .nav-toggle { display: block; }
  .nav { display: none; flex-direction: column; width: 100%; margin: 0; }
  .nav.open { display: flex; }
  .nav-btn { padding: 12px; text-align: left; }
  .nav-group { width: 100%; }
  .nav-group-title { width: 100%; text-align: left; padding: 12px; }
  .nav-group-items { position: static; display: none; min-width: 0; box-shadow: none; border-radius: 0; padding: 0; background: rgba(0,0,0,.18); }
  .nav-group.open .nav-group-items { display: flex; }
  .grid2 { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: repeat(2,1fr); }
  .container { padding: 0 12px; }
}
