:root {
  color-scheme: light;
  --bg: #eef8f6;
  --card: #ffffff;
  --ink: #12343b;
  --muted: #60737a;
  --line: #cfe5e2;
  --soft-line: rgba(16, 163, 154, 0.16);
  --primary: #10a39a;
  --primary-dark: #0f766e;
  --sky: #eef8ff;
  --mint: #e7fbf7;
  --warm: #fff8e8;
  --gold: #ffd166;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.preview-app {
  min-height: 100vh;
  padding: 24px;
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1040px;
  margin: 0 auto 18px;
  gap: 16px;
}

.preview-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.preview-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.preview-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.preview-switch {
  display: none;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.switch-btn {
  min-width: 72px;
  min-height: 34px;
  border-radius: 999px;
  background: transparent;
  color: #315767;
  font-weight: 800;
  cursor: pointer;
}

.switch-btn.active {
  background: var(--primary);
  color: #fff;
}

.phone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 390px));
  justify-content: center;
  gap: 28px;
  align-items: start;
}

.phone {
  overflow: hidden;
  width: min(390px, 100%);
  min-height: 820px;
  border: 10px solid #10292d;
  border-radius: 38px;
  background: var(--bg);
  box-shadow: 0 24px 64px rgba(18, 52, 59, 0.22);
}

.phone-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 18px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.phone-icons {
  display: flex;
  gap: 5px;
  align-items: center;
}

.wifi {
  width: 14px;
  height: 10px;
  border-top: 3px solid #fff;
  border-radius: 50%;
}

.battery {
  width: 22px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 4px;
}

.mini-nav {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--primary);
  color: #fff;
}

.nav-title {
  text-align: center;
  font-size: 15px;
  font-weight: 900;
}

.wechat-capsule {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  font-weight: 900;
}

.mini-page {
  height: 728px;
  overflow: auto;
  padding: 14px;
  scrollbar-width: none;
}

.mini-page::-webkit-scrollbar {
  display: none;
}

.panel {
  border: 1px solid var(--soft-line);
  border-radius: 13px;
  background: var(--card);
  box-shadow: 0 7px 17px rgba(31, 77, 89, 0.06);
}

.teacher-page,
.student-page {
  display: grid;
  gap: 12px;
  padding-bottom: 82px;
}

.teacher-hero {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hero-mark {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.logo-mark {
  padding: 5px;
  border: 1px solid var(--soft-line);
  background: #fff;
}

.clover-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-main {
  flex: 1;
  min-width: 0;
}

.mini-title {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.22;
}

.mini-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mini-btn,
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fffd;
  color: #315767;
  font-size: 12px;
  font-weight: 900;
}

.course-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.section-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.picker-box {
  position: relative;
  display: block;
  min-height: 55px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fffd;
  cursor: pointer;
}

.picker-box::after {
  position: absolute;
  right: 10px;
  bottom: 13px;
  width: 0;
  height: 0;
  border-top: 5px solid #60737a;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  content: "";
  pointer-events: none;
}

.picker-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.picker-value {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-display {
  padding-right: 18px;
}

.picker-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
}

.selection-bar {
  padding: 10px 12px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.word-list {
  display: grid;
  gap: 8px;
}

.word-row {
  display: grid;
  grid-template-columns: 25px 26px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid #e0efec;
  border-radius: 11px;
  background: #fbfffe;
}

.check-box {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  padding: 0;
  border: 1px solid #d3dddd;
  border-radius: 5px;
  background: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.check-box.checked {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.word-index {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.teacher-page .word-row .word-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
}

.word-row-meaning {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
  max-width: 100%;
  min-width: 0;
}

.term {
  flex: 0 0 auto;
  max-width: 100%;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.pos {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.translation {
  color: #315767;
  font-size: 13px;
  font-weight: 700;
}

.recent-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.share-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.share-preview {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--mint);
}

.share-preview-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.share-field {
  display: grid;
  gap: 5px;
}

.share-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.share-field input {
  min-height: 34px;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfffe;
  color: var(--ink);
  font-size: 12px;
}

.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.share-sheet {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fffd;
}

.share-targets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.share-target {
  display: grid;
  gap: 5px;
  justify-items: center;
  min-height: 62px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.share-target-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}

.recent-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.empty-text {
  padding: 10px;
  border-radius: 10px;
  background: #f8fffd;
  color: var(--muted);
  font-size: 12px;
}

.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  background: #f8fffd;
}

.assignment-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-bar {
  position: sticky;
  right: 0;
  bottom: -14px;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 8px;
  align-items: center;
  margin: 0 -14px -14px;
  padding: 10px 14px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.bottom-copy {
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.btn.primary {
  min-height: 40px;
  border-color: transparent;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
}

.btn.primary[disabled],
.btn.disabled {
  background: #dcefed;
  color: #8aa1a7;
}

.student-hero {
  display: grid;
  gap: 10px;
  padding: 17px;
  background: var(--mint);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.student-title-row {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 10px;
  align-items: center;
}

.student-logo {
  width: 44px;
  height: 44px;
  padding: 6px;
}

.student-title-main {
  min-width: 0;
}

.student-title-main .mini-title {
  overflow: hidden;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 163, 154, 0.12);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
}

.progress-badge {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 3px solid rgba(16, 163, 154, 0.18);
  border-radius: 50%;
  background: #fff;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 900;
}

.hero-meta {
  color: #456068;
  font-size: 13px;
  font-weight: 800;
}

.progress-line {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: #dcefed;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.student-name {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.student-submit-bar {
  position: sticky;
  right: 0;
  bottom: -14px;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  align-items: center;
  margin: 0 -14px -14px;
  padding: 10px 14px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.student-page .word-card {
  display: grid;
  gap: 9px;
  overflow: visible;
  padding: 12px;
  border-radius: 12px;
}

.student-page .word-card.is-correct {
  border-color: #9ee7c5;
  background: #fbfffd;
}

.student-page .word-card.is-wrong {
  border-color: #ffd2cc;
}

.student-page .word-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 10px;
  align-items: start;
}

.student-page .word-card.is-phrase .word-head {
  grid-template-columns: minmax(0, 1fr) auto;
}

.student-page .word-main {
  min-width: 0;
}

.student-page .word-headline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 5px;
  align-items: start;
  min-width: 0;
}

.student-page .word-copy {
  min-width: 0;
}

.student-page .word-term {
  display: block;
  flex: 0 0 auto;
  max-width: 100%;
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
}

.student-page .word-term.is-long {
  font-size: 23px;
}

.student-page .word-term.is-extra-long {
  font-size: 21px;
}

.student-page .word-term.is-ultra-long {
  font-size: 19px;
}

.student-page .word-term.is-phrase-long {
  font-size: 16px;
}

.student-page .word-card.is-phrase .word-term {
  flex-wrap: wrap;
  font-size: 20px;
  line-height: 1.25;
}

.student-page .word-card.is-phrase .word-term.is-phrase-long {
  font-size: 18px;
}

.student-page .word-index {
  color: #334155;
  padding-top: 2px;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.05;
}

.student-page .word-title-main {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  column-gap: 1px;
  margin-right: 6px;
  white-space: nowrap;
}

.student-page .word-term.is-phrase-long .word-title-main {
  flex-wrap: wrap;
  white-space: normal;
  row-gap: 2px;
}

.student-page .word-card.is-phrase .word-title-main {
  display: inline;
  margin-right: 6px;
  white-space: normal;
}

.student-page .word-term-syllable {
  display: inline-block;
  padding: 1px 3px 2px;
  border-bottom: 4px solid var(--syllable-border);
  border-radius: 4px;
  background: var(--syllable-bg);
  color: var(--syllable-text);
  line-height: 1.05;
}

.student-page .word-syllable-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

.student-page .word-syllable-stack.is-full-ipa {
  align-items: flex-start;
}

.student-page .word-ipa-part {
  display: block;
  margin-top: 1px;
  color: var(--syllable-text);
  font-size: 0.42em;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.student-page .word-term.is-long .word-ipa-part,
.student-page .word-term.is-extra-long .word-ipa-part,
.student-page .word-term.is-ultra-long .word-ipa-part {
  font-size: 0.38em;
}

@keyframes preview-syllable-shimmer {
  0% {
    background-position: 220% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

.student-page .word-syllable-stack.is-spelling-active .word-term-syllable {
  background-image: linear-gradient(
    110deg,
    var(--syllable-bg) 0%,
    var(--syllable-bg) 28%,
    rgba(255, 255, 255, 0.2) 38%,
    rgba(255, 255, 255, 1) 48%,
    rgba(255, 209, 102, 0.95) 52%,
    rgba(255, 255, 255, 1) 56%,
    rgba(255, 255, 255, 0.2) 66%,
    var(--syllable-bg) 76%,
    var(--syllable-bg) 100%
  );
  background-size: 280% 100%;
  box-shadow:
    0 0 0 2px rgba(255, 209, 102, 0.68),
    0 0 12px rgba(255, 209, 102, 0.72);
  animation: preview-syllable-shimmer 0.85s linear infinite;
}

.student-page .word-term.is-long .word-term-syllable,
.student-page .word-term.is-extra-long .word-term-syllable,
.student-page .word-term.is-ultra-long .word-term-syllable {
  padding-right: 2px;
  padding-left: 2px;
}

.student-page .word-meaning-row {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  max-width: 100%;
  margin: 3px 0 0;
  color: #334155;
  line-height: 1.25;
}

.student-page .word-pos,
.student-page .word-translation-inline {
  color: #334155;
  font-size: 18px;
  font-weight: 900;
}

.student-page .word-translation-inline {
  color: #152c33;
}

.student-page .word-phonetic {
  display: flex;
  flex: 0 0 100%;
  align-items: baseline;
  gap: 4px;
  margin: 4px 0 0 24px;
  min-width: 0;
  overflow-x: auto;
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.student-page .phonetic-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.student-page .phonetic-text {
  white-space: nowrap;
}

.student-page .pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8fff5;
  color: #15803d;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.student-page .pill.warn {
  background: #fff7ed;
  color: #b45309;
}

.student-page .word-side {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.student-page .word-card.is-phrase .word-side {
  align-self: start;
}

.student-page .word-image-frame {
  width: 84px;
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.student-page .word-image {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--mint);
  object-fit: cover;
}

.btn.small {
  min-height: 34px;
  border-radius: 9px;
}

.student-page .word-actions {
  display: grid;
  gap: 8px;
}

.student-page .action-row,
.student-page .spell-row {
  display: grid;
  grid-template-columns: 1fr 1fr 92px;
  gap: 7px;
  align-items: center;
}

.student-page .word-card.is-phrase .action-row {
  grid-template-columns: 1fr 92px;
}

.student-page .spell-row {
  grid-template-columns: minmax(0, 1fr) 74px;
}

.student-page .btn.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: #315767;
}

.student-page .read-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #315767;
  font-size: 12px;
  font-weight: 900;
}

.student-page .read-toggle.checked {
  background: #e7fbf2;
  color: var(--primary-dark);
}

.student-page .read-box {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 1px solid #95bbb5;
  border-radius: 4px;
  background: #fff;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.student-page .read-toggle.checked .read-box {
  border-color: var(--primary);
  background: var(--primary);
}

.student-page .spell-input {
  min-height: 36px;
  width: 100%;
  min-width: 0;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfffe;
  color: var(--ink);
}

.student-page .spell-input:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(16, 163, 154, 0.12);
}

.student-page .word-status {
  min-height: 20px;
  color: #5b737a;
  font-size: 12px;
  line-height: 1.5;
}

.student-page .word-status.ok {
  color: #15803d;
  font-weight: 900;
}

.student-page .word-status.bad {
  color: #b91c1c;
  font-weight: 900;
}

.preview-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  min-width: 128px;
  max-width: calc(100vw - 40px);
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(18, 52, 59, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 12px 30px rgba(18, 52, 59, 0.18);
}

.site-beian {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  padding: 0 16px 22px;
  color: #60737a;
  font-size: 12px;
}

.site-beian a {
  color: inherit;
  text-decoration: none;
}

.site-beian a:hover {
  color: var(--primary-dark);
}

@media (max-width: 880px) {
  .preview-app {
    padding: 14px;
  }

  .preview-top {
    flex-direction: column;
    align-items: stretch;
  }

  .preview-switch {
    display: flex;
    justify-content: center;
  }

  .phone-grid {
    grid-template-columns: minmax(0, 390px);
  }

  .phone[data-screen="student"] {
    display: none;
  }

  .preview-app.show-student .phone[data-screen="teacher"] {
    display: none;
  }

  .preview-app.show-student .phone[data-screen="student"] {
    display: block;
  }
}

@media (max-width: 430px) {
  .preview-app {
    padding: 0;
  }

  .preview-top {
    padding: 14px 14px 0;
  }

  .phone {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .mini-page {
    height: calc(100vh - 92px);
  }

  .site-beian {
    padding-top: 14px;
  }
}
