/* 词汇模块：页面布局 */

.vocabulary-shell {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 22px 18px 40px;
}

/* 词汇模块：品牌和返回入口 */

.vocabulary-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}

.vocabulary-brand {
  margin: 0;
  color: var(--navy-dark, #24364c);
  font-size: 14px;
  font-weight: 800;
}

.vocabulary-back {
  display: flex;
  align-items: center;
  width: fit-content;
  min-height: 40px;
  margin: 0 0 8px;
  padding: 0;
  color: var(--navy-dark, #24364c);
  font-size: 14px;
  text-decoration: none;
}

/* 词汇模块：标题、介绍和总词汇数 */

.vocabulary-shell .vocabulary-heading {
  margin: 0 0 20px;
  padding: 0;
}

.vocabulary-heading h1 {
  margin: 0 0 6px;
  color: var(--navy-dark, #24364c);
  font-size: 27px;
  line-height: 1.4;
}

.vocabulary-intro {
  margin: 0;
  color: var(--muted, #78869a);
  font-size: 14px;
  font-style: italic;
  line-height: 1.7;
}

.vocabulary-heading-with-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.vocabulary-heading-with-count>div {
  min-width: 0;
}

.vocabulary-total {
  flex-shrink: 0;
  color: #557fbe;
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* 词汇模块：共用目录卡片 */

.vocabulary-directory {
  display: grid;
  gap: 12px;
}

.vocabulary-directory-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line, #dce5f2);
  border-radius: 18px;
  color: var(--navy-dark, #24364c);
  background: white;
  text-decoration: none;
}

.vocabulary-card-content {
  min-width: 0;
}

.vocabulary-directory-card h2 {
  margin: 0 0 5px;
  color: var(--navy-dark, #24364c);
  font-size: 21px;
  line-height: 1.4;
}

.vocabulary-directory-card p {
  margin: 0;
  color: var(--muted, #78869a);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* 词汇模块：水平卡片右侧入口 */

.vocabulary-directory-link {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 44px;
  margin: 0;
  color: #557fbe;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.vocabulary-directory-status {
  flex-shrink: 0;
  margin: 0;
  color: var(--muted, #78869a);
  font-size: 12px;
  white-space: nowrap;
}

.vocabulary-directory-card.is-unavailable {
  background: #f0f4fa;
}

/* 词汇模块：词汇组名称和法语说明 */

.vocabulary-group-card h2 {
  font-size: 18px;
}

.vocabulary-group-french {
  font-style: italic;
}

a.vocabulary-group-card:hover {
  border-color: #afc5e5;
}

a.vocabulary-group-card:active {
  background: #f5f8fd;
}

/* 词汇模块：每组学习数量 */

.vocabulary-group-progress {
  flex-shrink: 0;
  color: #557fbe;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 词汇模块：全部掌握后的圆角方块完成标记 */

.vocabulary-group-progress.is-complete {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #c4e0cf;
  border-radius: 11px;
  color: #25865b;
  background: #eaf6ee;
}

.vocabulary-group-progress.is-complete svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 词汇模块：隐藏状态和键盘焦点 */

.vocabulary-shell [hidden] {
  display: none !important;
}

.vocabulary-shell a:focus-visible {
  outline: 3px solid #a5bee5;
  outline-offset: 4px;
}

/* 词汇学习：紧凑列表容器 */

#vocabulary-word-list:not(:empty) {
  overflow: hidden;
  border: 1px solid var(--line, #dce5f2);
  border-radius: 18px;
  background: white;
}

.vocabulary-word {
  margin: 0;
  padding: 20px;
}

.vocabulary-word+.vocabulary-word {
  border-top: 1px solid var(--line, #dce5f2);
}

/* 词汇学习：法语、词性和音节 */

.vocabulary-word-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.vocabulary-word-heading {
  min-width: 0;
}

.vocabulary-word-heading h2 {
  margin: 0;
  color: var(--navy-dark, #24364c);
  font-size: 22px;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.vocabulary-word-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 6px;
  color: var(--muted, #78869a);
  font-size: 12px;
}

.vocabulary-syllables {
  letter-spacing: 0.5px;
}

/* 词汇学习：发音按钮 */

.vocabulary-play {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #557fbe;
  background: #eaf1fc;
  cursor: pointer;
}

.vocabulary-play svg {
  width: 19px;
  height: 19px;
  margin-left: 2px;
  fill: currentColor;
}

/* 词汇学习：释义和必要备注 */

.vocabulary-word .vocabulary-meaning {
  margin: 12px 0 0;
  color: var(--navy-dark, #24364c);
  font-size: 16px;
}

.vocabulary-word .vocabulary-note {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  color: #7f6c48;
  background: #f8f3e9;
  font-size: 12px;
  line-height: 1.7;
}

/* 词汇学习：原地展开例句 */

.vocabulary-example {
  margin-top: 14px;
}

.vocabulary-example summary {
  width: fit-content;
  color: #557fbe;
  cursor: pointer;
  font-size: 13px;
}

.vocabulary-example-content {
  margin-top: 10px;
  padding: 12px 14px;
  border-left: 3px solid #bacdeb;
  border-radius: 0 10px 10px 0;
  background: #f5f8fd;
}

.vocabulary-example-content p {
  margin: 0;
  line-height: 1.7;
}

.vocabulary-example-content p+p {
  margin-top: 5px;
  color: var(--muted, #78869a);
  font-size: 13px;
}

/* 词汇学习：手动掌握标记 */

.vocabulary-word-bottom {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.vocabulary-remember {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--line, #dce5f2);
  border-radius: 9px;
  color: var(--muted, #78869a);
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.vocabulary-remember[aria-pressed="true"] {
  border-color: #b5cae8;
  color: #557fbe;
  background: #eaf1fc;
}

/* 词汇学习：存储或读取失败提示 */

#vocabulary-group-message {
  margin: 0 0 16px;
  color: #8d5738;
  font-size: 13px;
  line-height: 1.7;
}

/* 词汇学习：键盘焦点 */

.vocabulary-shell button:focus-visible,
.vocabulary-shell summary:focus-visible {
  outline: 3px solid #a5bee5;
  outline-offset: 3px;
}

/* 词汇学习：底部一键掌握按钮 */

.vocabulary-bulk-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.vocabulary-bulk-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid #557fbe;
  border-radius: 13px;
  color: white;
  background: #557fbe;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.vocabulary-bulk-button:disabled {
  border-color: #c8d9cf;
  color: #357554;
  background: #edf6f0;
  cursor: default;
}

/* 词汇学习：一键取消本组掌握标记 */

.vocabulary-clear-button {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 10px;
  border: 1px solid var(--line, #dce5f2);
  border-radius: 13px;
  color: var(--muted, #78869a);
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.vocabulary-clear-button:disabled {
  opacity: 0.45;
  cursor: default;
}

/* 词汇目录：可展开的主题卡片 */

.vocabulary-theme {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line, #dce5f2);
  border-radius: 18px;
  background: white;
}

.vocabulary-theme > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  list-style: none;
  cursor: pointer;
}

.vocabulary-theme > summary::-webkit-details-marker {
  display: none;
}

.vocabulary-theme-title {
  display: block;
  color: var(--navy-dark, #24364c);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.4;
}

.vocabulary-theme-french {
  display: block;
  margin-top: 5px;
  color: var(--muted, #78869a);
  font-size: 13px;
  font-style: italic;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* 词汇目录：主题右侧统计和展开箭头 */

.vocabulary-theme-right {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
}

.vocabulary-theme-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid #78869a;
  border-bottom: 2px solid #78869a;
  transform: rotate(45deg);
}

.vocabulary-theme[open] .vocabulary-theme-chevron {
  transform: rotate(225deg);
}

/* 词汇目录：展开后的分组 */

.vocabulary-theme-groups {
  display: grid;
  gap: 9px;
  padding: 0 12px 12px;
}

.vocabulary-theme-groups .vocabulary-group-card {
  padding: 15px;
  border-color: #e6edf6;
  border-radius: 12px;
  background: #f8faff;
}

.vocabulary-theme-groups .vocabulary-group-card h2 {
  font-size: 15px;
}

/* 词汇组底部：练习本组入口 */

.vocabulary-practice-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 14px;
  padding: 12px 18px;
  border: 1px solid var(--line, #dce4f1);
  border-radius: 14px;
  background: var(--blue-soft, #edf3ff);
  color: var(--navy-dark, #243752);
  font-weight: 800;
  text-decoration: none;
}

.vocabulary-practice-link[hidden] {
  display: none;
}

.vocabulary-practice-link:focus-visible {
  outline: 3px solid #9bb8f0;
  outline-offset: 3px;
}

/* 词汇页面：为固定底部导航留出空间 */

body.vocabulary-has-bottom-nav {
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}