:root {
  --primary: #2f6fed;
  --primary-dark: #1746b8;
  --danger: #ff4d4f;
  --success: #2e9e54;
  --warning: #faad14;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e8e8e8;
  --text: #1f2329;
  --text-2: #666666;
  --text-3: #888888;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 920px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; padding: 16px 20px; display: flex; align-items: center;
  justify-content: space-between; box-shadow: var(--shadow);
}
header .brand { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
header .brand small { font-weight: 400; opacity: 0.85; margin-left: 8px; font-size: 13px; }
header .right { display: flex; align-items: center; gap: 12px; font-size: 14px; }
header button {
  background: rgba(255, 255, 255, 0.2); color: #fff; border: none;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
header button:hover { background: rgba(255, 255, 255, 0.32); }

main { flex: 1; padding: 20px; }
section[hidden] { display: none; }

.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px;
}
.card h3 { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h3::before { content: ""; width: 4px; height: 16px; background: var(--primary); border-radius: 2px; }

label { display: block; font-size: 13px; color: var(--text-2); margin: 10px 0 6px; }
input, select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; outline: none; background: #fff; color: var(--text);
}
input:focus, select:focus { border-color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary); color: #fff; border: none; border-radius: 8px;
  padding: 12px 18px; font-size: 15px; cursor: pointer; transition: 0.15s;
  width: 100%; margin-top: 14px; font-weight: 600;
}
.btn:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.danger { background: var(--danger); }
.btn.success { background: var(--success); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn { margin-top: 14px; }

.hint { font-size: 12px; color: var(--text-3); margin-top: 10px; line-height: 1.6; }

.student-card { display: flex; align-items: center; gap: 16px; padding: 14px; background: #f0f6ff; border-radius: 10px; }
.student-card .avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.student-card .info { flex: 1; }
.student-card .info .name { font-size: 17px; font-weight: 700; }
.student-card .info .sub { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.hours-badge { background: var(--success); color: #fff; padding: 4px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; }

.sessions { margin-top: 12px; font-size: 13px; color: var(--text-2); }
.sessions div { padding: 6px 0; border-bottom: 1px dashed var(--border); }

/* 单词卡片 */
.word-stage { text-align: center; padding: 30px 10px; }
.word-spelling { font-size: 46px; font-weight: 800; letter-spacing: 1px; }
.word-phonetic { color: var(--text-3); font-size: 18px; margin-top: 8px; }
.word-meaning { font-size: 24px; margin-top: 16px; color: var(--primary-dark); font-weight: 600; }
.word-example { color: var(--text-2); margin-top: 12px; font-size: 15px; }
.tts-btn {
  margin-top: 18px; background: #eef4ff; color: var(--primary); border: 1px solid #d6e2ff;
  border-radius: 30px; padding: 10px 20px; font-size: 14px; cursor: pointer;
}
.tts-btn:hover { background: #d6e2ff; }

.progress { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.progress .bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 18px; }
.progress .bar > div { height: 100%; background: var(--primary); transition: 0.3s; }

.phase-tag { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.phase-learn { background: #eef4ff; color: var(--primary); }
.phase-review { background: #fff3e0; color: #c8720a; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 99; padding: 20px; }
.modal { background: #fff; border-radius: 16px; padding: 24px; max-width: 420px; width: 100%; text-align: center; }
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.formula { background: #fff7e6; border: 1px solid #ffd591; border-radius: 12px; padding: 20px; margin: 12px 0; }
.formula .en { font-size: 30px; font-weight: 800; color: var(--primary-dark); }
.formula .cn { font-size: 22px; margin-top: 10px; color: var(--text); }
.formula .step { font-size: 13px; color: var(--text-2); margin-top: 12px; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px; z-index: 200; }

.homework-item { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.homework-item .title { font-weight: 700; font-size: 15px; }
.homework-item .meta { font-size: 12px; color: var(--text-3); margin: 6px 0; }
.homework-item .content { font-size: 14px; color: var(--text-2); white-space: pre-wrap; }
.tag-done { background: #eaf7ee; color: var(--success); padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.tag-todo { background: #fff3e0; color: #c8720a; padding: 2px 8px; border-radius: 6px; font-size: 12px; }

.nav-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.nav-tabs button { flex: 1; padding: 10px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-2); }
.nav-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 老师管理 */
.teacher-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.teacher-form input[type=text], .teacher-form input:not([type=checkbox]) {
  flex: 1; min-width: 140px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.teacher-form .chk { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); }
.teacher-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 14px; }
.teacher-table th, .teacher-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.teacher-table th { color: var(--text-3); font-weight: 600; font-size: 13px; }
.teacher-table .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.teacher-table .ops button { padding: 5px 10px; font-size: 12px; border-radius: 6px; border: 1px solid var(--border); background: #fff; cursor: pointer; }
.teacher-table .ops .del { color: var(--danger); border-color: #ffccc7; }
.teacher-table .tag-admin { background: #eef4ff; color: var(--primary); padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.teacher-table .tag-off { background: #f5f5f5; color: var(--text-3); padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.teacher-table .tag-on { background: #eaf7ee; color: var(--success); padding: 2px 8px; border-radius: 6px; font-size: 12px; }

/* 抗遗忘排期 */
.sched-filter { display: flex; gap: 18px; margin-top: 10px; font-size: 14px; color: var(--text-2); }
.sched-filter label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.sched-date { font-weight: 600; margin: 14px 0 6px; font-size: 15px; }
.sched-sub { font-weight: 400; color: var(--text-3); font-size: 13px; margin-left: 6px; }
.sched-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.sched-item.done { opacity: 0.62; background: #fafafa; }
.sched-info { display: flex; flex-direction: column; gap: 2px; }
.sched-name { font-weight: 600; font-size: 15px; }
.sched-meta { font-size: 13px; color: var(--text-2); }
.sched-done-btn { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
