:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1d2742;
  --ink-2: #56627f;
  --ink-3: #8b95ad;
  --line: #e5e9f2;
  --line-2: #eef1f7;
  --brand: #4f6bff;
  --brand-ink: #3249d6;
  --brand-soft: #edf0ff;
  --ok: #16a571;
  --ok-soft: #e4f6ee;
  --bad: #e5484d;
  --bad-soft: #fdeced;
  --warn: #ee8f2c;
  --warn-soft: #fff3e3;
  --practice: #10ab9c;
  --practice-soft: #e2f6f3;
  --writing: #f9813a;
  --writing-soft: #fff0e6;
  --speaking: #9257f5;
  --speaking-soft: #f2eaff;
  --reading: #3a86ff;
  --reading-soft: #e7f0ff;
  --ket: #17a974;
  --pet: #3a7bf0;
  --fce: #8b55f0;
  --r: 16px;
  --shadow: 0 1px 2px rgba(29, 39, 66, 0.05), 0 4px 16px rgba(29, 39, 66, 0.06);
  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  --en: 'Avenir Next', 'Segoe UI', -apple-system, 'Helvetica Neue', sans-serif;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--brand);
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
.ic {
  flex: none;
  display: inline-block;
  vertical-align: middle;
}
.en {
  font-family: var(--en);
}
.muted {
  color: var(--ink-3);
}
.hidden {
  display: none !important;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.08s, background 0.15s, box-shadow 0.15s;
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 107, 255, 0.28);
}
.btn.primary:hover {
  background: var(--brand-ink);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--brand);
}
.btn.danger {
  color: var(--bad);
}
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}
.btn.block {
  width: 100%;
}
.btn.lg {
  min-height: 54px;
  font-size: 17px;
  border-radius: 16px;
}
.btn.sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
}

/* 标签 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 20px;
}
.pill.todo {
  background: var(--warn-soft);
  color: #c46a10;
}
.pill.submitted {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.pill.done {
  background: var(--ok-soft);
  color: #0d8358;
}
.pill.grey {
  background: var(--line-2);
  color: var(--ink-2);
}
.pill.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.lv {
  display: inline-block;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 20px;
  font-family: var(--en);
  letter-spacing: 0.3px;
}
.lv.KET {
  background: var(--ket);
}
.lv.PET {
  background: var(--pet);
}
.lv.FCE {
  background: var(--fce);
}

.card {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-family: var(--en);
  flex: none;
}

/* 原文里标出的错误 */
mark.err-mark {
  background: linear-gradient(transparent 62%, rgba(229, 72, 77, 0.22) 62%);
  color: inherit;
  text-decoration: underline wavy rgba(229, 72, 77, 0.75);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  border-radius: 2px;
  cursor: pointer;
}
mark.err-mark sup {
  font-size: 10px;
  color: var(--bad);
  font-weight: 700;
  margin-left: 1px;
  font-family: var(--en);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 20px);
  background: rgba(29, 39, 66, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 100;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.ok {
  background: rgba(13, 131, 88, 0.95);
}
.toast.bad {
  background: rgba(200, 50, 55, 0.95);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 35, 0.9);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lightbox img {
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}
.lb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  flex: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
