    :root {
      --safe-t: env(safe-area-inset-top, 0px);
      --safe-b: env(safe-area-inset-bottom, 0px);
      --bg-a: #e8f3fc;
      --bg-b: #d2e8f8;
      --bg-c: #beddf3;
      --navy: #0d1b2a;
      --text: #0d1b2a;
      --text-2: rgba(13, 27, 42, 0.52);
      --text-3: rgba(13, 27, 42, 0.38);
      --accent: #1e8fd6;
      --accent-soft: rgba(30, 143, 214, 0.22);
      --line: rgba(255, 255, 255, 0.82);
      --line-d: rgba(13, 27, 42, 0.06);
      --glow: 0 0 0 1px rgba(255, 255, 255, 0.55) inset, 0 8px 32px rgba(25, 90, 140, 0.07), 0 2px 8px rgba(25, 90, 140, 0.04);
      --shadow-float: 0 12px 48px rgba(20, 75, 120, 0.09), 0 4px 16px rgba(20, 75, 120, 0.05);
      --accent-fill: linear-gradient(180deg, #4dc2f7 0%, #1e8fd6 55%, #1780c4 100%);
      --r-card: 32px;
      --r-in: 18px;
      --r-pill: 999px;
      --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
      --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
      --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    *,
    *::before,
    *::after {
      box-sizing: border-box;
    }

    html {
      -webkit-text-size-adjust: 100%;
      scroll-behavior: smooth;
    }

    body {
      margin: 0;
      min-height: 100dvh;
      font-family: var(--font);
      color: var(--text);
      background: linear-gradient(175deg, var(--bg-a) 0%, var(--bg-b) 45%, var(--bg-c) 100%);
      background-attachment: fixed;
      overflow-x: hidden;
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      background:
        radial-gradient(100% 70% at 50% -15%, rgba(255, 255, 255, 0.9), transparent 52%),
        radial-gradient(70% 50% at 100% 0%, rgba(200, 230, 255, 0.35), transparent 45%),
        radial-gradient(60% 45% at 0% 100%, rgba(190, 220, 248, 0.4), transparent 50%);
      pointer-events: none;
      z-index: 0;
      animation: drift 30s var(--ease-out) infinite alternate;
    }

    @keyframes drift {
      from { opacity: 1; }
      to { opacity: 0.92; }
    }

    @media (prefers-reduced-motion: reduce) {
      body::before { animation: none; }
      html { scroll-behavior: auto; }
      .card-wrap {
        width: 100%;

        height: min(82vh, 820px);

        animation: cardIn 0.5s var(--ease-out) both;
      }
    }

    body.modal-open {
      overflow: hidden;
      touch-action: none;
    }

.app-shell {

  position: relative;

  z-index: 1;

  max-width: 450px;

  margin: 0 auto;

  min-height: 100dvh;

  display: flex;

  flex-direction: column;

  padding-top: 18px;

  padding:
    calc(12px + var(--safe-t))
    max(16px, env(safe-area-inset-left, 0px))
    calc(20px + var(--safe-b))
    max(16px, env(safe-area-inset-right, 0px));

}


.fab-edit:active {
  transform: translateX(-50%) scale(0.96);
}

    .fab-edit:active {
      transform: scale(0.97);
    }

    .fab-edit:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .ios-switch {
      position: relative;
      display: inline-block;
      width: 46px;
      height: 28px;
      flex-shrink: 0;
    }

    .ios-switch input {
      opacity: 0;
      width: 0;
      height: 0;
      position: absolute;
    }

    .ios-switch .track {
      position: absolute;
      inset: 0;
      border-radius: 28px;
      background: rgba(118, 124, 138, 0.22);
      border: 0.5px solid rgba(255, 255, 255, 0.5);
      box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
      transition: background 0.28s var(--ease-out), border-color 0.28s, box-shadow 0.28s;
      cursor: pointer;
    }

    .ios-switch .thumb {
      position: absolute;
      height: 24px;
      width: 24px;
      left: 2px;
      top: 2px;
      background: #fff;
      border-radius: 50%;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
      transition: transform 0.3s var(--ease-spring);
      pointer-events: none;
    }

    .ios-switch input:checked + .track {
      background: linear-gradient(180deg, rgba(77, 194, 247, 0.55), rgba(30, 143, 214, 0.45));
      border-color: rgba(255, 255, 255, 0.45);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 0 16px rgba(30, 143, 214, 0.35);
    }

    .ios-switch input:checked + .track .thumb {
      transform: translateX(18px);
    }

    .ios-switch input:focus-visible + .track {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

.random-capsule {
  appearance: none;

  border: 0.5px solid rgba(255,255,255,0.7);

  background: rgba(255,255,255,0.45);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  border-radius: 999px;

  padding: 6px 11px;

  height: auto;
  min-width: unset;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;

  color: var(--text-2);

  cursor: pointer;

  transition: all .28s ease;

  white-space: nowrap;

  box-shadow:
    0 4px 12px rgba(120,140,170,0.06),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

.random-capsule[data-on="true"] {

  border: 0.5px solid rgba(30,143,214,0.22);

  background: rgba(30,143,214,0.12);

  color: var(--accent);

  box-shadow:
    0 6px 16px rgba(30,143,214,0.14),
    inset 0 1px 0 rgba(255,255,255,0.45);
}

    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }

    @keyframes cardIn {
      from { opacity: 0; transform: translateY(16px) scale(0.98); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    @keyframes modalIn {
      from { opacity: 0; transform: translateY(24px) scale(0.97); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .btn {
      appearance: none;
      border: 0.5px solid var(--line);
      background: rgba(255, 255, 255, 0.5);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      color: var(--text);
      font-family: inherit;
      font-size: 0.8125rem;
      font-weight: 600;
      padding: 10px 14px;
      border-radius: var(--r-pill);
      cursor: pointer;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
      transition: transform 0.2s var(--ease-spring), background 0.2s;
      min-height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .btn:active {
      transform: scale(0.97);
    }

    .btn:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .btn-primary {
      background: rgba(255, 255, 255, 0.65);
    }

    .btn-ghost {
      background: rgba(255, 255, 255, 0.32);
    }

    .btn[data-active="true"] {
      background: var(--accent-soft);
      border-color: rgba(30, 143, 214, 0.35);
      color: #0a5f94;
    }

.card-center {
  flex: 1;
  display: flex;
  flex-direction: column;

  justify-content: flex-start;

  align-items: stretch;

  min-height: 0;

  padding-top: 3.2px;
}

.card-wrap {

  width: 100%;

  height: calc(100dvh - 36px);

  max-height: 880px;

  border-radius: 56px;

  overflow: hidden;

}

    .flash-card {
      display: flex;
      flex-direction: column;
      max-height: inherit;
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.78),
      rgba(220,240,255,0.72)
    );
      border: 0.5px solid rgba(255, 255, 255, 0.85);
      border-radius: 56px;
      overflow: hidden;
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, var(--shadow-float);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      overflow: hidden;
      height: 100%;
      isolation: isolate;
    }

    .fc-topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 28px 30px 12px;
      flex-shrink: 0;
    }

    .fc-band {
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--accent);
      background: rgba(30, 143, 214, 0.16);
      border: 0.5px solid rgba(30, 143, 214, 1.6);
      padding: 6px 11px;
      border-radius: var(--r-pill);
      white-space: nowrap;

      box-shadow:
  0 0 0 1px rgba(255,255,255,0.35) inset,
  0 4px 14px rgba(30,143,214,0.10);
    }

.fc-hero {
  flex-shrink: 0;

  text-align: center;

  padding: 34px 18px 14px;
}

    .fc-word {
      font-size: clamp(2.25rem, 10vw, 3.05rem);
      font-weight: 800;
      letter-spacing: -0.05em;
      line-height: 1.05;
      margin: 0;
      color: var(--navy);
    }

    .fc-ipa {
      display: none;
    }

    .fc-ipa:empty {
      display: none;
    }

    .fc-pos {
      margin: 12px auto 0;
      display: inline-block;
      font-size: 0.8125rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: capitalize;
      color: var(--text-2);
      padding: 6px 14px;
      border-radius: var(--r-pill);
      background: rgba(255, 255, 255, 0.45);
      border: 0.5px solid rgba(255, 255, 255, 0.7);
    }

    .fc-pos:empty {
      display: none;
    }

.fc-speak {

  margin-top: 0;

  cursor: pointer;

  color: var(--accent);

  transition:
    transform 0.22s var(--ease-spring),
    box-shadow 0.22s;

}

    .fc-speak:active {
      transform: scale(0.94);
    }

    .fc-speak svg {
      width: 23px;
      height: 23px;
    }

.action-row {

  margin-top: 18px;

  display: flex;

  justify-content: center;

  align-items: center;

  gap: 16px;

}

.fc-speak,
.fav-btn {

  flex-shrink: 0;

  width: 54px;

  height: 54px;

  border-radius: 50%;

  border:
    0.5px solid rgba(255,255,255,0.72);

  background:
    rgba(255,255,255,0.55);

  backdrop-filter:
    blur(14px);

  -webkit-backdrop-filter:
    blur(14px);

  display: flex;

  align-items: center;

  justify-content: center;

  box-shadow:
    0 4px 16px rgba(20,80,130,0.08);

}

.fav-btn {

  cursor: pointer;

  color: #4aa8f5;

  transition:
    .22s ease;

}

.heart-icon {

  width: 22px;

  height: 22px;

  display: block;

  stroke-linecap: round;

  stroke-linejoin: round;

  transform: translateY(-0.5px);

}
.fav-btn[data-active="true"] {

  background:
    rgba(74,168,245,0.14);

}
.fav-btn[data-active="true"] .heart-icon {

  fill: #4aa8f5;

  stroke: #4aa8f5;

}

    .fc-body {
padding-bottom: 140px;
    }

.fc-block {
  margin-top: 10px;
  padding: 13px 14px;
  border-radius: var(--r-in);
  background: rgba(255, 255, 255, 0.42);
  border: 0.5px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

    .fc-block:first-of-type {
      margin-top: 4px;
    }

    .fc-block.hidden-cn .cn-line {
      display: none;
    }

    .fc-block.hidden-cn {
  padding-bottom: 10px;
}

    .fc-label {
     font-size: 10px;
     font-weight: 700;
     letter-spacing: 0.1em;
     text-transform: uppercase;

      color: #4faeea;

     margin-bottom: 8px;
    }

.cn-line {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);

  line-height: 1.5;

  margin-top: 2px;
  margin-bottom: 0;
}

    .en-def {
      font-size: 0.875rem;
      line-height: 1.55;
      color: var(--text-2);
      margin-top: 8px;
      white-space: pre-line;
    }

    .chip-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .chip {
      font-size: 0.8125rem;
      font-weight: 600;
      padding: 8px 13px;
      border-radius: var(--r-pill);
      background: rgba(255, 255, 255, 0.65);
      border: 0.5px solid rgba(255, 255, 255, 0.85);
      color: var(--text);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    }

    .example-text {
      font-size: 0.9375rem;
      line-height: 1.58;
      font-style: italic;
      color: var(--text);
    }

    .example-text em {
      font-style: normal;
      font-weight: 700;
      color: var(--accent);
      background: linear-gradient(180deg, transparent 58%, rgba(30, 143, 214, 0.2) 58%);
      padding: 0 2px;
      }


    .example-zh {

  min-height: 1.6em;

  margin-top: 10px;

  font-size: 0.88rem;

  line-height: 1.6;

  color: var(--text-2);

  font-weight: 500;

}

.in-card-dock {

  position: fixed;

  left: 0;

  right: 0;

  bottom: 0;

  z-index: 100;

  display: flex;

  align-items: center;

  justify-content: space-between;

  padding-bottom:
    calc(8px + env(safe-area-inset-bottom));

  background:
    rgba(248,252,255,0.82);

  backdrop-filter:
    blur(40px);

  -webkit-backdrop-filter:
    blur(40px);

  border-top:
    0.5px solid rgba(255,255,255,0.7);

}

.dock-tab {

  flex: 1;

  height: 54px;

  display: flex;

  align-items: center;

  justify-content: center;

  font-size: 1rem;

  font-weight: 700;

  color: var(--text);

  user-select: none;

  -webkit-tap-highlight-color: transparent;

  padding-top: 4px;

}


    .dock-pill {
      flex: 1;
      appearance: none;
      border: 0.5px solid rgba(255, 255, 255, 0.75);
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.45);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      font-family: inherit;
      font-weight: 700;
      color: var(--text);
      height: 42px;
      margin-bottom: -2px;
      cursor: pointer;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
      transition: transform 0.18s var(--ease-spring), box-shadow 0.25s, background 0.25s, border-color 0.25s;
      font-size: 0.92rem;
max-width: 160px;
letter-spacing: -0.02em;

    
    }

    .dock-pill:active {
      transform: scale(0.97);
    }

    .dock-pill:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

.dock-tab-mean[data-active="true"] {

  background:
    linear-gradient(
      180deg,
      #69beff 0%,
      #2e9df4 100%
    );

  color: white;

  font-weight: 800;

}

.dock-tab-next {

  color:
    var(--accent);

  font-weight: 800;

}

.editor-modal {

  position: fixed;

  inset: 0;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 24px;

  background: rgba(15,23,42,0.18);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  opacity: 0;

  visibility: hidden;

  pointer-events: none;

  transition: .3s ease;

  z-index: 999;
}

    .editor-modal.is-open {
      pointer-events: auto;
      opacity: 1;
      visibility: visible;
    }

    .editor-modal .editor-scrim {
      position: absolute;
      inset: 0;
      border: none;
      padding: 0;
      margin: 0;
      background: rgba(12, 40, 65, 0.28);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      cursor: pointer;
    }

    .editor-modal-sheet {
      position: relative;
      z-index: 1;
      width: 100%;
      max-width: 400px;
      max-height: min(88dvh, 720px);
      border-radius: 24px 24px 20px 20px;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 252, 255, 0.96) 100%);
      border: 0.5px solid rgba(255, 255, 255, 0.9);
      box-shadow: var(--shadow-float);
      display: flex;
      flex-direction: column;
      overflow: hidden;
  transform: scale(.96);
      opacity: 0;
      transition: transform 0.38s var(--ease-out), opacity 0.38s var(--ease-out);
    }

.editor-modal.is-open .editor-modal-sheet {

  transform: scale(1);

  opacity: 1;

  animation: modalIn 0.4s var(--ease-out) both;

}

    .editor-modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 18px 12px;
      border-bottom: 0.5px solid var(--line-d);
      flex-shrink: 0;
    }

    .editor-modal-title {
      margin: 0;
      font-size: 1.125rem;
      font-weight: 800;
      letter-spacing: -0.02em;
      color: var(--text);
    }

    .editor-modal-close {
      appearance: none;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border: 0.5px solid rgba(0, 0, 0, 0.06);
      background: rgba(255, 255, 255, 0.8);
      font-size: 1.35rem;
      line-height: 1;
      cursor: pointer;
      color: var(--text-2);
    }

    .editor-modal-body {
      padding: 14px 18px 22px;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    .editor-modal-body label {
      display: block;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text-2);
      margin-bottom: 6px;
    }

    .editor-modal-body textarea {
      width: 100%;
      min-height: 110px;
      border-radius: var(--r-in);
      border: 0.5px solid rgba(0, 0, 0, 0.08);
      background: rgba(255, 255, 255, 0.85);
      padding: 12px;
      font-family: ui-monospace, "Cascadia Code", monospace;
      font-size: 0.75rem;
      resize: vertical;
      color: var(--text);
      margin-bottom: 10px;
    }

    .editor-modal-body textarea:focus {
      outline: 2px solid var(--accent);
      outline-offset: 0;
    }

    .editor-modal-body textarea.paste-area {
      min-height: 150px;
      font-family: var(--font);
      font-size: 0.8125rem;
      line-height: 1.45;
    }

    .editor-sublabel {
      margin-top: 12px;
    }

    .editor-hint {
      font-size: 0.75rem;
      color: var(--text-2);
      line-height: 1.45;
      margin: -2px 0 12px;
    }

    .editor-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .toast {
      position: fixed;
      bottom: calc(22px + var(--safe-b));
      left: 50%;
      transform: translateX(-50%) translateY(16px);
      background: rgba(15, 30, 45, 0.9);
      color: #fff;
      padding: 11px 18px;
      border-radius: var(--r-pill);
      font-size: 0.8125rem;
      font-weight: 600;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.32s, transform 0.32s var(--ease-out);
      z-index: 400;
      max-width: calc(100% - 32px);
      text-align: center;
      box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    }

    .toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    @media (min-width: 480px) {
      .app-shell {
        max-width: 380px;
      }
    }
    .page {

  position: fixed;

  inset: 0;

  width: 100%;

  height: 100%;

}

.learn-page {

  z-index: 1;

}
.learn-page.active {

  transform: translateX(0);

}

.favorites-page,
.quiz-page {

  left: 0;
top: 0;
  background:
    linear-gradient(
      180deg,
      #eef6ff 0%,
      #dcecff 100%
    );

  transform: translateX(100%);

  transition:
    transform .38s cubic-bezier(.22,1,.36,1);

  z-index: 20;

  overflow-y: auto;

  -webkit-overflow-scrolling: touch;

  padding:
    calc(24px + var(--safe-t))
    20px
    calc(120px + var(--safe-b));

}

.page-head {

  padding-top:
    calc(28px + var(--safe-t));

  padding-left: 22px;

}

.page-head h1 {

  margin: 0;

  font-size: 2rem;

  font-weight: 800;

  letter-spacing: -0.04em;

}

.favorites-page.active,
.quiz-page.active {

  transform: translateX(0);

}
.favorites-list {

  margin-top: 22px;

  display: flex;

  flex-direction: column;

  gap: 12px;

}

.favorite-item {

  padding: 18px 20px;

  border-radius: 24px;

  background:
    rgba(255,255,255,0.58);

  backdrop-filter:
    blur(18px);

  -webkit-backdrop-filter:
    blur(18px);

  border:
    0.5px solid rgba(255,255,255,0.72);

  font-size: 1.05rem;

  font-weight: 700;

  color: var(--text);

}