.basic-vocab {
  --v-line: #dfe5d9;
  --v-muted: #53685c;
  --v-soft: #eef2e9;
}
.vocab-header {
  border-bottom: 1px solid var(--v-line);
  background: var(--paper);
}
.vocab-header-inner, .vocab-main {
  width: min(100% - 2 * clamp(14px, 4vw, 34px), 920px);
  margin-inline: auto;
}
.vocab-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 57px;
  font-size: 14px;
}
.vocab-back, .vocab-related, .vocab-to-top { text-underline-offset: 4px; }
.vocab-back:not(:hover), .vocab-related:not(:hover) { text-decoration: none; }
.vocab-skip {
  position: fixed;
  z-index: 100;
  inset: 8px auto auto 8px;
  transform: translateY(-150%);
  padding: 10px 14px;
  background: var(--paper);
}
.vocab-skip:focus { transform: none; }
.vocab-main { padding-block: clamp(24px, 5vw, 52px) 48px; }
.vocab-intro [lang=es] { margin: 0 0 7px; font: 18px/1.4 Georgia, serif; color: var(--green); }
.vocab-intro h1 { margin: 0; font-size: clamp(28px, 5vw, 42px); line-height: 1.2; }
.vocab-intro p:last-child { margin: 10px 0 0; color: var(--v-muted); line-height: 1.7; }
.vocab-topics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-block: 22px 16px;
  scroll-margin-top: 12px;
}
.vocab-topic-link {
  padding: 10px clamp(9px, 2vw, 15px);
  background: var(--paper);
  border: 1px solid var(--v-line);
  border-radius: 7px;
  color: var(--ink);
  line-height: 1.45;
  text-decoration: none;
}
.vocab-topic-link strong, .vocab-topic-link span { display: block; }
.vocab-topic-link span { margin-top: 3px; color: var(--v-muted); font-size: 12px; }
.vocab-topic-link:hover { border-color: #9eb29a; }
.vocab-topic-link[aria-current=location] {
  border-color: #8baa89;
  background: #e4eee0;
  box-shadow: inset 0 -2px #5f8863;
}
.vocab-topic {
  padding: clamp(12px, 3.5vw, 29px);
  background: var(--paper);
  border: 1px solid var(--v-line);
  border-radius: 10px;
}
.vocab-view-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.vocab-topic-actions { margin: -6px 0 8px; }
.vocab-view-actions .switch-label { min-height: 36px; color: var(--v-muted); font-size: 14px; white-space: nowrap; }
.vocab-main:has(#browse-translation:not(:checked)) :is(.vocab-chinese, .vocab-translation, .example-zh, .vocab-example-note, .vocab-group-note, .vocab-lesson-count) {
  display: none;
}
.vocab-main:has(#browse-translation:not(:checked)) .phrase-table th:first-child { width: auto; }
.vocab-main:has(#browse-translation:not(:checked)) span[data-headword-meaning] { cursor: help; border-radius: 4px; }
.vocab-main span[data-headword-meaning]:focus-visible { outline: 2px solid #749e68; outline-offset: 3px; }
.vocab-topic-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 11px;
  margin: 0 0 17px;
}
.vocab-topic-heading h2 { margin: 0; font-size: clamp(22px, 3vw, 27px); }
.vocab-topic-term { margin: 0; font: 18px/1.4 Georgia, serif; color: var(--green); }
.vocab-guide { width: 100%; margin: 1px 0 0; color: var(--v-muted); line-height: 1.65; }
.vocab-group { border: 1px solid var(--v-line); border-radius: 7px; }
.vocab-group + .vocab-group { margin-top: 9px; }
.vocab-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 7px 11px;
  list-style: none;
  cursor: pointer;
  color: var(--green);
}
.vocab-group-title::-webkit-details-marker { display: none; }
.vocab-group-title:hover { background: #f4f7f1; }
.vocab-group-title:focus-visible { outline: 2px solid #749e68; outline-offset: 2px; border-radius: 7px; }
.vocab-group-title::after {
  content: '';
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  margin: -3px 3px 0 3px;
  transform: rotate(45deg);
}
.vocab-group[open] .vocab-group-title::after { margin-top: 3px; transform: rotate(225deg); }
.vocab-group-title h3 { margin: 0; font-size: 15px; }
.vocab-count { margin-left: auto; color: var(--v-muted); white-space: nowrap; font-size: 12px; }
.vocab-group-note {
  padding: 8px 11px 11px;
  margin: 0;
  color: var(--v-muted);
  font-size: 13px;
  line-height: 1.6;
}
.vocab-table { width: 100%; border-collapse: collapse; text-align: left; }
.vocab-table :is(th, td) { padding: 4px clamp(7px, 2vw, 13px); border-top: 1px solid #e6ebe2; }
.vocab-table thead th { padding-block: 8px; font-size: 13px; background: var(--v-soft); color: var(--v-muted); }
.vocab-table tbody tr:nth-child(even of :not(.vocab-form-row)) { background: #f8faf5; }
.vocab-table tbody tr:hover { background: #f0f5ec; }
.vocab-word {
  width: 44%;
  color: var(--ink);
  font: clamp(18px, 3vw, 21px)/1.25 Georgia, serif;
  overflow-wrap: anywhere;
}
.vocab-number {
  width: clamp(36px, 10vw, 85px);
  color: var(--v-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vocab-meaning { line-height: 1.4; font-size: 14px; }
.vocab-listen { width: 1%; text-align: center; white-space: nowrap; }
.vocab-sound {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #dce6d7;
  border-radius: 7px;
  color: var(--green);
  background: var(--v-soft);
}
.vocab-sound:hover:not(:disabled), .vocab-sound[aria-pressed=true] { background: #deebd9; border-color: #9db695; }
.vocab-sound svg { width: 19px; height: 19px; }
.vocab-stop, .vocab-sound[aria-pressed=true] .vocab-speaker { display: none; }
.vocab-sound[aria-pressed=true] .vocab-stop { display: block; }
.vocab-examples { margin: 23px 0 14px; }
.vocab-examples h3 { margin: 0; font-size: 17px; }
.vocab-example-hint { margin: 5px 0 9px; color: var(--v-muted); font-size: 13px; }
.vocab-examples ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--v-line); }
.vocab-example {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid var(--v-line);
}
.vocab-sentence { margin: 0; color: var(--ink); font: clamp(18px, 3vw, 21px)/1.55 Georgia, serif; }
.vocab-gloss-word {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-decoration: underline dotted #839e81 1px;
  text-underline-offset: 4px;
}
.vocab-gloss-word:hover, .vocab-gloss-active { color: #245736; background: #eaf3e7; }
.vocab-translation, .vocab-example-note { margin: 3px 0 0; font-size: 14px; line-height: 1.55; }
.vocab-example-note { color: var(--v-muted); font-size: 13px; }
.vocab-to-top { display: inline-block; padding-block: 7px; font-size: 13px; }
.vocab-gloss-tip, .vocab-status {
  position: fixed;
  z-index: 10;
  max-width: min(260px, 100vw - 16px);
  padding: 7px 11px;
  border-radius: 6px;
  background: #315841;
  color: #fffefb;
  box-shadow: 0 4px 12px #19312127;
  font-size: 13px;
}
.vocab-gloss-tip { pointer-events: none; }
.vocab-status { inset: auto 14px 14px auto; margin: 0; }
.vocab-group-tools { display: flex; justify-content: flex-end; padding: 5px 10px 8px; }
.vocab-group-tools button { min-height: 34px; }
.vocab-frequency-table { table-layout: fixed; }
.vocab-frequency-table thead th:first-child { width: 29%; }
.vocab-frequency-table thead th:nth-child(2) { width: 28%; }
.vocab-frequency-table :is(th, td) { padding-block: 8px; vertical-align: top; }
.vocab-frequency-table .vocab-word { width: auto; }
.vocab-frequency-table .vocab-meaning { line-height: 1.6; }
.vocab-entry-title { display: grid; align-items: center; justify-items: start; min-height: 34px; }
.vocab-audio-cell { position: relative; cursor: pointer; }
.vocab-cell-play {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
.vocab-cell-play:focus-visible { outline-offset: -2px; }
.vocab-audio-cell:has(> .vocab-cell-play[aria-pressed=true]) { background: #dfead9; }
@media (hover: hover) {
  .vocab-audio-cell:hover { background: #e9f1e5; }
}
.vocab-word-toggle {
  min-inline-size: min(32px, 100%);
  max-inline-size: 100%;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  overflow-wrap: anywhere;
  text-align: start;
  text-decoration: underline dotted #839e81 1px;
  text-underline-offset: 4px;
}
.vocab-word-toggle:hover, .vocab-word-toggle[aria-expanded=true] { color: var(--green); background: #e4eee0; }
.vocab-form-row td { background: #f1f5ee; color: var(--ink); }
.vocab-form-heading { margin: 3px 0 5px; color: var(--green); font-size: 13px; }
.vocab-forms { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; margin: 0 0 7px; padding: 0; list-style: none; }
.vocab-form-item { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; max-width: 100%; }
.vocab-form-label { font-size: 12px; color: var(--v-muted); }
.vocab-form-sound, .vocab-form-text {
  border: 1px solid #d7e3d3;
  border-radius: 5px;
  background: #f0f5ed;
  color: var(--green);
  padding: 4px 6px;
  min-height: 29px;
  font: 14px/1.1 Georgia, serif;
}
.vocab-form-text { display: inline-flex; align-items: center; background: transparent; border-color: transparent; }
.vocab-form-sound:hover, .vocab-form-sound[aria-pressed=true] { background: #dfead9; border-color: #9db695; }
.vocab-more-forms { margin-block: 6px 2px; }
.vocab-more-forms > summary { width: fit-content; min-height: 28px; color: var(--green); font-size: 13px; cursor: pointer; }
.vocab-lesson-count { display: block; margin-top: 5px; color: var(--v-muted); font: 11px/1.4 system-ui, sans-serif; }
.vocab-text-example .example-es { font: 17px/1.45 Georgia, serif; color: var(--ink); overflow-wrap: anywhere; }
.vocab-text-example .example-zh { font-size: 13px; line-height: 1.5; color: var(--v-muted); }
.vocab-text-example:has(> .vocab-example-translation) { position: relative; }
.vocab-text-example:has(> .vocab-example-translation) > :is(.example-es, .vocab-example-audio-line) {
  min-height: 32px;
  padding-inline-start: 36px;
}
.vocab-example-translation { padding-inline-start: 36px; }
.vocab-example-translation summary {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  color: var(--green);
  cursor: pointer;
}
.vocab-example-translation summary::-webkit-details-marker { display: none; }
.vocab-example-translation summary::after {
  content: '';
  border-block: 5px solid transparent;
  border-left: 7px solid currentColor;
}
.vocab-example-translation[open] summary::after { transform: rotate(90deg); }
.vocab-example-translation summary:hover { background: #e4eee0; }
.vocab-example-translation summary:focus-visible { outline: 2px solid #749e68; }
.vocab-example-translation .example-zh { margin: 8px 0 0; font-size: 15px; }
.vocab-example-audio-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}
.vocab-search { display: flex; align-items: end; gap: 8px; margin: 0 0 12px; }
.vocab-search-field { display: grid; gap: 5px; flex: 1; min-width: 0; color: var(--v-muted); font-size: 13px; }
.vocab-search input, .vocab-pager select {
  min-width: 0;
  min-height: 40px;
  padding: 6px 9px;
  border: 1px solid #cbdac8;
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
}
.vocab-search input { width: 100%; font-size: 16px; }
.vocab-search button, .vocab-pager button { min-height: 40px; white-space: nowrap; }
.vocab-results-label { margin: 0; color: var(--v-muted); font-size: 13px; line-height: 1.6; scroll-margin-top: 12px; }
.vocab-review-settings {
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid var(--v-line);
  border-radius: 8px;
  background: var(--v-soft);
}
.vocab-review-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; }
.vocab-review-range { margin: 0; color: var(--v-muted); font-size: 13px; line-height: 1.6; }
.vocab-review-options { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.vocab-review-options label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.vocab-review-settings input[type=checkbox] { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.vocab-review-options button, .vocab-batch-actions button { min-height: 40px; }
.vocab-batch-picker { margin-top: 6px; border-top: 1px solid var(--v-line); }
.vocab-batch-picker summary { width: fit-content; padding: 8px 0 4px; color: var(--green); font-size: 14px; font-weight: 650; cursor: pointer; }
.vocab-batch-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.vocab-batch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
  max-height: min(50vh, 410px);
  overflow: auto;
  padding: 3px;
}
.vocab-batch-column { min-width: 0; padding: 4px; border: 1px solid var(--v-line); border-radius: 7px; background: var(--paper); }
.vocab-batch-column-label, .vocab-batch-choice { display: flex; align-items: center; gap: 6px; padding: 5px; min-height: 34px; font-size: 13px; cursor: pointer; }
.vocab-batch-column-label { font-weight: 650; border-bottom: 1px solid var(--v-line); }
.vocab-batch-choice { border-radius: 5px; }
.vocab-batch-choice:hover, .vocab-batch-choice:has(input:checked) { background: var(--v-soft); }
.vocab-batch-current { margin-left: auto; color: var(--green); font-size: 11px; }
.vocab-pager { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 10px 0; }
.vocab-sources { margin: 13px 0 5px; color: var(--v-muted); font-size: 13px; line-height: 1.55; }
.vocab-sources summary { cursor: pointer; padding-block: 6px; }
.vocab-sources p { margin: 5px 0; }
.vocab-deck {
  width: min(590px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(13px, 4vw, 22px);
  border: 1px solid var(--v-line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
}
.vocab-deck::backdrop { background: #243a30a6; }
.vocab-deck-header { display: flex; justify-content: space-between; align-items: start; gap: 9px; }
.vocab-deck-header h2 { margin: 0; font-size: 19px; }
.vocab-deck-header p { margin: 4px 0 0; color: var(--v-muted); font-size: 13px; line-height: 1.45; }
.vocab-deck-header button { flex: none; }
.vocab-auto { display: inline-flex; gap: 6px; align-items: center; margin-top: 11px; color: var(--v-muted); font-size: 13px; }
.vocab-auto input { accent-color: var(--green); }
.vocab-deck .flashcard-study { margin-top: 12px; }
.vocab-deck-status { margin: 9px 0 0; color: var(--v-muted); font-size: 13px; }
@media (max-width: 760px) {
  .vocab-topics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vocab-batch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .vocab-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vocab-batch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vocab-frequency-table, .vocab-frequency-table :is(thead, tbody) { display: block; }
  .vocab-frequency-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vocab-main:has(#browse-translation:not(:checked)) .vocab-frequency-table tr { grid-template-columns: minmax(0, 1fr); }
  .vocab-frequency-table thead th:is(:first-child, :nth-child(2)) { width: auto; }
  .vocab-frequency-table .vocab-example-header { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; padding: 0; }
  .vocab-frequency-table .vocab-example-cell { grid-column: 1 / -1; border-top: 0; padding-top: 0; }
  .vocab-frequency-table .vocab-form-row > td { grid-column: 1 / -1; }
  .vocab-pager { gap: 5px; }
}
