:root {
  --paper: #fffaf0;
  --paper-deep: #f6ecd8;
  --ink: #273043;
  --muted: #6f7482;
  --line: #eadfcb;
  --mint: #bfe8d4;
  --blue: #b9d9ff;
  --peach: #ffc9b7;
  --lemon: #ffe88f;
  --rose: #f9b8c7;
  --green: #3f8f6b;
  --red: #c75d4f;
  --shadow: 0 18px 50px rgba(94, 78, 52, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: ui-rounded, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 232, 143, 0.28), transparent 28%),
    radial-gradient(circle at 90% 8%, rgba(191, 232, 212, 0.34), transparent 24%),
    linear-gradient(135deg, #fff7e8, #eef8f2 55%, #fff3f0);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.phone-frame {
  width: min(430px, 100%);
  min-height: min(880px, calc(100vh - 36px));
  background: var(--paper);
  border: 1px solid rgba(234, 223, 203, 0.9);
  border-radius: 34px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.app {
  min-height: min(880px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(rgba(234, 223, 203, 0.28) 1px, transparent 1px) 0 18px / 100% 31px,
    var(--paper);
}

.screen {
  flex: 1;
  padding: 22px 18px 92px;
  overflow-y: auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

.sticker {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  height: 38px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--lemon);
  box-shadow: 4px 4px 0 rgba(39, 48, 67, 0.14);
  font-weight: 900;
  transform: rotate(3deg);
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.92);
  box-shadow: 0 10px 24px rgba(92, 74, 45, 0.1);
}

.card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 24px;
  width: 78px;
  height: 18px;
  border-radius: 4px;
  background: rgba(249, 184, 199, 0.72);
  transform: rotate(-2deg);
}

.hero-card {
  padding: 24px 18px 18px;
  background:
    linear-gradient(115deg, rgba(255, 232, 143, 0.62), rgba(191, 232, 212, 0.72)),
    #fffdf8;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.mini-card {
  padding: 12px;
  border: 1px dashed rgba(39, 48, 67, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

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

.mini-value {
  display: block;
  margin-top: 2px;
  font-size: 20px;
  font-weight: 900;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.choice-btn,
.nav-btn {
  border: 0;
  border-radius: 14px;
  min-height: 44px;
  padding: 11px 14px;
  color: var(--ink);
  font-weight: 850;
}

.primary-btn {
  width: 100%;
  background: var(--ink);
  color: #fffdf8;
  box-shadow: 0 8px 0 rgba(39, 48, 67, 0.16);
}

.secondary-btn {
  background: var(--mint);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.danger-btn {
  background: #ffe1d9;
  color: var(--red);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.unit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.full-row {
  grid-column: 1 / -1;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 10px;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(39, 48, 67, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: repeating-linear-gradient(45deg, var(--green), var(--green) 8px, #69b890 8px, #69b890 16px);
}

.library-list,
.word-list,
.stats-list {
  display: grid;
  gap: 12px;
}

.library-card,
.word-row,
.setting-card {
  padding: 17px;
}

.library-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.library-card.locked {
  opacity: 0.68;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf7f1;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
}

.pill.blue {
  background: #e7f1ff;
  color: #356da8;
}

.pill.peach {
  background: #fff0e8;
  color: #ad5b3c;
}

.study-card {
  min-height: 370px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 20px 20px;
}

.word-main {
  margin: 24px 0 10px;
  font-size: 44px;
  line-height: 1.05;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.sound-btn {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--ink);
  border-radius: 17px;
  background: var(--blue);
  box-shadow: 4px 4px 0 rgba(39, 48, 67, 0.12);
  font-size: 20px;
}

.meaning-box {
  margin: 16px 0;
  padding: 14px;
  border-radius: 15px;
  background: rgba(255, 232, 143, 0.42);
}

.example {
  padding-left: 12px;
  border-left: 4px solid var(--mint);
  color: var(--muted);
  line-height: 1.55;
}

.definition-box {
  margin: 12px 0;
  padding: 13px 14px;
  border: 1px solid rgba(39, 48, 67, 0.12);
  border-radius: 14px;
  background: #eef8ff;
  color: #2e4f72;
  line-height: 1.55;
}

.definition-box.large {
  margin-top: 0;
  font-size: 18px;
  font-weight: 800;
}

.meaning-hint {
  margin: 10px 0 14px;
  color: var(--muted);
  font-weight: 750;
}

.quiz-card {
  padding: 22px 17px;
}

.choice-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.choice-btn {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffdf8;
  text-align: left;
  line-height: 1.35;
}

.choice-btn:disabled {
  opacity: 0.72;
}

.choice-btn.correct {
  border-color: #64ad86;
  background: #e8f8ef;
}

.choice-btn.wrong {
  border-color: #d98274;
  background: #ffe9e4;
}

.spell-input {
  width: 100%;
  min-height: 54px;
  margin: 16px 0 10px;
  border: 2px solid var(--line);
  border-radius: 15px;
  padding: 0 14px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.feedback {
  min-height: 34px;
  margin: 8px 0 14px;
  font-weight: 850;
}

.feedback.good {
  color: var(--green);
}

.feedback.bad {
  color: var(--red);
}

.feedback-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  background: #fffdf8;
  color: var(--ink);
  line-height: 1.45;
}

select {
  width: 100%;
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
}

.nav {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(234, 223, 203, 0.92);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 12px 30px rgba(92, 74, 45, 0.14);
  backdrop-filter: blur(12px);
}

.nav-btn {
  display: grid;
  gap: 2px;
  place-items: center;
  min-height: 52px;
  padding: 7px 4px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.nav-btn.active {
  background: var(--ink);
  color: #fffdf8;
}

.nav-icon {
  font-size: 18px;
  line-height: 1;
}

.empty {
  padding: 26px 18px;
  text-align: center;
}

.confetti-note {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 232, 143, 0.58), rgba(249, 184, 199, 0.45));
  font-weight: 900;
  line-height: 1.45;
}

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

  .phone-frame,
  .app {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }
}
