* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: linear-gradient(135deg, #1B3A5C 0%, #2d5a8e 100%);
  min-height: 100vh;
  color: #333;
}
#app { max-width: 480px; margin: 0 auto; padding: 16px; min-height: 100vh; }
.view { display: none; }
.view.active { display: block; }

.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  margin-bottom: 16px;
}
.card.center { text-align: center; padding-top: 60px; padding-bottom: 60px; }

.logo { font-size: 56px; margin-bottom: 12px; }
h1 { font-size: 24px; color: #1B3A5C; margin-bottom: 6px; }
h2 { font-size: 20px; color: #1B3A5C; margin-bottom: 8px; }
.sub { color: #888; font-size: 13px; margin-bottom: 24px; }
.stats-bar {
  background: #fff5e6;
  border: 1.5px solid #ffd54f;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #8a6d00;
  margin: 0 0 14px 0;
  text-align: center;
  line-height: 1.5;
}
.stats-bar b { color: #e65100; font-size: 14px; }
.share-poster { margin: 16px 0; }
.share-poster img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  display: block;
}

input[type="text"] {
  width: 100%;
  padding: 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  margin-bottom: 16px;
  text-align: center;
  outline: none;
}
input[type="text"]:focus { border-color: #1B3A5C; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: transform 0.1s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #1B3A5C; color: #fff; }
.btn-secondary { background: #fff; color: #1B3A5C; border: 2px solid #1B3A5C; }
.btn-exit { background: #fafafa; color: #888; border: 2px solid #e0e0e0; margin-top: 12px; padding: 10px; font-size: 14px; }
.btn-big { padding: 16px; font-size: 18px; margin-top: 12px; }
.btn-wrong { background: #fdecea; color: #d32f2f; border: 2px solid #f5c6c2; }
.btn-right { background: #e8f5e9; color: #2e7d32; border: 2px solid #c8e6c9; }

.btn-group { margin-top: 8px; }
.teacher-link { margin-top: 20px; font-size: 14px; }
.teacher-link a { color: #888; text-decoration: none; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 14px;
  color: #666;
  font-weight: 600;
}
.date { color: #999; font-weight: normal; }

.count-select { display: flex; gap: 8px; margin: 16px 0; }
.count-btn {
  flex: 1;
  padding: 14px 8px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: #fafafa;
  font-size: 15px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
}
.count-btn.selected { border-color: #1B3A5C; background: #eef4fa; color: #1B3A5C; }
.count-fixed {
  padding: 14px;
  border: 2px solid #1B3A5C;
  border-radius: 12px;
  background: #eef4fa;
  color: #1B3A5C;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  margin: 16px 0;
  cursor: pointer;
}

.review-queue {
  background: #fff9e6;
  border: 2px solid #ffe082;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #8a6d00;
}
.review-queue .rev-title { font-weight: 700; margin-bottom: 8px; }
.review-queue .rev-btn {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin: 6px 0;
  border: 2px solid #ffe082;
  border-radius: 10px;
  background: #fffdf5;
  color: #8a6d00;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}
.review-queue .rev-btn:active { background: #fff3cd; }
.review-queue .rev-btn-all {
  background: #1B3A5C;
  color: #fff;
  border-color: #1B3A5C;
  text-align: center;
  font-size: 16px;
}
.review-queue .rev-btn-all:active { background: #2d5a8e; }

.word-card {
  border: 2px solid #e8e8e8;
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  margin: 16px 0;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.word-tag {
  font-size: 12px;
  color: #8a6d00;
  background: #fff9e6;
  border: 1px solid #ffe082;
  border-radius: 20px;
  padding: 3px 12px;
  display: inline-block;
  margin: 0 auto 12px;
  font-weight: 600;
}
.word-en { font-size: 32px; font-weight: 700; color: #1B3A5C; margin-bottom: 12px; cursor: pointer; }
.word-phonetic { font-size: 17px; color: #8a6d3b; margin-bottom: 10px; font-family: 'Segoe UI', 'Noto Sans', sans-serif; cursor: pointer; }
.word-def { font-size: 20px; color: #555; }
.word-example { font-size: 14px; color: #999; margin-top: 14px; font-style: italic; line-height: 1.6; }
.word-example .ex-cn { display: block; color: #666; font-style: normal; margin-top: 6px; }
.study-actions { display: flex; gap: 12px; margin-top: 16px; }

.hint { font-size: 13px; color: #999; text-align: center; margin-top: 12px; }
.progress { color: #1B3A5C; font-weight: 700; }

textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-family: monospace;
  margin-bottom: 12px;
  resize: vertical;
  outline: none;
}
#teacher-panel { margin-bottom: 20px; }
.student-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}
.student-row .name { font-weight: 600; color: #1B3A5C; }
.student-row .student-pin { font-size: 12px; color: #888; font-weight: 400; margin-left: 6px; }
.student-row .status { color: #888; }
.student-row .status.done { color: #2e7d32; }
.student-row .status.due { color: #d32f2f; }
.mini-btn {
  padding: 3px 10px;
  border: 1px solid #d0d8e2;
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
  color: #4a5a6a;
  cursor: pointer;
}
.mini-btn:active { background: #eef3f8; }
.add-student-row {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.add-student-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
}
.add-student-row input[type="password"] { max-width: 110px; text-align: center; letter-spacing: 4px; }
.add-student-row .btn { flex-shrink: 0; }
#import-result { margin-top: 8px; }

/* ---------- 周日考试 ---------- */
.exam-q-card { background: #f8fafc; }
.exam-q-sentence { font-size: 26px; font-weight: 700; color: #1B3A5C; line-height: 1.55; margin-bottom: 12px; }
.exam-q-cn { font-size: 14px; color: #888; line-height: 1.5; }
.exam-options { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.btn-opt {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: #fff;
  font-size: 18px;
  font-weight: 600;
  color: #1B3A5C;
  cursor: pointer;
  transition: all .15s;
}
.btn-opt:active { transform: scale(.98); }
.btn-opt.opt-right { border-color: #2e7d32; background: #e8f5e9; color: #2e7d32; }
.btn-opt.opt-wrong { border-color: #d32f2f; background: #ffebee; color: #d32f2f; }
.exam-result-detail { font-size: 14px; color: #666; margin-top: 12px; }

/* ---------- 词库分类 ---------- */
.cat-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.cat-btn {
  width: 100%;
  padding: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 14px;
  background: #fff;
  font-size: 18px;
  font-weight: 600;
  color: #1B3A5C;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all .15s;
}
.cat-btn.selected { border-color: #1B3A5C; background: #1B3A5C; color: #fff; }
.cat-btn:active { transform: scale(.98); }
.cat-count { font-size: 13px; font-weight: 400; opacity: .7; }
.cat-current {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #1B3A5C;
  background: #eef3f8;
  border-radius: 20px;
  padding: 6px 16px;
  display: inline-block;
  margin: 0 auto 10px;
  cursor: pointer;
}
.import-cat {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 12px;
  background: #fff;
  color: #1B3A5C;
}

/* ---------- SEC 学科切换条 ---------- */
.sec-sub-nav {
  background: #f4f7fb;
  border: 1.5px solid #dbe4ee;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.sec-nav-title {
  font-size: 12px;
  font-weight: 600;
  color: #1B3A5C;
  margin-bottom: 8px;
}
.sec-nav-hint {
  font-size: 12px;
  color: #c0392b;
  margin-bottom: 8px;
}
.sec-nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sec-nav-btn {
  padding: 6px 12px;
  border: 1.5px solid #d0d8e2;
  border-radius: 16px;
  background: #fff;
  font-size: 13px;
  color: #4a5a6a;
  cursor: pointer;
  transition: all .15s;
}
.sec-nav-btn.selected {
  border-color: #1B3A5C;
  background: #1B3A5C;
  color: #fff;
  font-weight: 600;
}
.sec-nav-btn:active { transform: scale(.97); }

/* ---------- 释义模式切换 ---------- */
.def-mode { display: flex; justify-content: center; gap: 10px; margin-bottom: 10px; }
.def-mode-btn {
  padding: 6px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 18px;
  background: #fff;
  font-size: 13px;
  color: #888;
  cursor: pointer;
  transition: all .15s;
}
.def-mode-btn.selected { border-color: #1B3A5C; background: #1B3A5C; color: #fff; font-weight: 600; }

/* 分类标注（AEIS/KET/PET） */
.word-cat {
  font-size: 11px;
  color: #1B3A5C;
  background: #eef3f9;
  border: 1px solid #c9d6e8;
  border-radius: 20px;
  padding: 2px 10px;
  display: inline-block;
  margin: 0 auto 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.word-cat.cat-aeis { color: #C8102E; background: #fdeef0; border-color: #f3c1c9; }
.word-cat.cat-ket { color: #1B3A5C; background: #eef3f9; border-color: #c9d6e8; }
.word-cat.cat-pet { color: #0d6b3f; background: #e8f6ee; border-color: #b7e0c8; }
.word-cat.cat-sec { color: #6b3fa0; background: #f2ecfa; border-color: #d8c6ef; }
.word-cat.cat-ielts { color: #b06000; background: #fdf3e4; border-color: #f0d5a8; }
.word-cat.cat-other { color: #666; background: #f2f2f2; border-color: #ddd; }
