
/* ==================================================
   Language Lab · Vocabulary
   Black × Neon Green / Light
   词汇库独立双主题样式
   ================================================== */

/* ---------- 01. 主题颜色 ---------- */

/* 默认：黑色与荧光绿 */
.vocabulary-page {
  --neon: #b6ff00;
  --neon-soft: rgba(182, 255, 0, 0.10);
  --page-bg: #080a09;
  --card-bg: #111512;
  --card-hover: #171d17;
  --border: #252d25;
  --text-main: #edf2ed;
  --text-muted: #929b91;
  --input-bg: #0b0e0b;
  --button-text: #080a09;

  width: min(100% - 40px, 960px);
  margin: 0 auto;
  padding: 40px 0 90px;
  color: var(--text-main);
}

/* 普通浅色模式 */
body.vocabulary-light .vocabulary-page {
  --neon: #202820;
  --neon-soft: rgba(30, 50, 30, 0.07);
  --page-bg: #f7f8f6;
  --card-bg: #ffffff;
  --card-hover: #fbfcfa;
  --border: #e5e8e3;
  --text-main: #202520;
  --text-muted: #858d83;
  --input-bg: #f7f8f6;
  --button-text: #ffffff;
}

/* 页面背景跟随词汇本主题 */
body {
  background: var(--page-bg, #080a09);
  color: var(--text-main, #edf2ed);
  transition: background 0.25s ease, color 0.25s ease;
}

body.vocabulary-light {
  background: #f7f8f6;
}

/* ---------- 02. 页面顶部 ---------- */

.vocabulary-header {
  margin-bottom: 55px;
}

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

.back-link {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--neon);
}

/* 主题切换按钮 */
.vocabulary-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vocabulary-theme-toggle:hover {
  border-color: var(--neon);
  color: var(--neon);
}

#vocabularyThemeIcon {
  color: var(--neon);
  font-size: 16px;
}

.vocabulary-heading .section-label {
  color: var(--neon);
  font-size: 11px;
  letter-spacing: 3px;
}

.vocabulary-heading h1 {
  margin: 0;
  color: var(--text-main);
  font-size: clamp(38px, 6vw, 54px);
  font-weight: 650;
  letter-spacing: -2px;
}

.vocabulary-heading > p:last-child {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- 03. 通用标题 ---------- */

.section-heading h2 {
  margin: 0;
  color: var(--text-main);
  font-size: 19px;
  font-weight: 600;
}

.section-heading p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- 04. 词汇统计 ---------- */

.vocabulary-overview {
  padding: 24px 0;
  margin-bottom: 42px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.vocabulary-overview > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.overview-number {
  color: var(--neon);
  font-size: 40px;
  font-weight: 650;
  letter-spacing: -1px;
}

.overview-label {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* ---------- 05. 新增词汇区域 ---------- */

.vocabulary-add {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 25px;
  margin-bottom: 55px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
}

#add-entry-button,
#save-entry-button {
  padding: 11px 20px;
  border: 1px solid var(--neon);
  border-radius: 7px;
  background: var(--neon);
  color: var(--button-text);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.2s ease;
}

#add-entry-button:hover,
#save-entry-button:hover {
  background: transparent;
  color: var(--neon);
}

/* ---------- 06. 录入面板 ---------- */

.entry-form-panel {
  padding: 28px;
  margin-bottom: 55px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.entry-form-panel[hidden] {
  display: none;
}

.form-group {
  margin-top: 26px;
}

.form-group label,
.form-divider h3 {
  display: block;
  margin-bottom: 12px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
}

.form-divider {
  padding-top: 25px;
  margin-top: 32px;
  border-top: 1px solid var(--border);
}

.form-divider h3 {
  margin-bottom: 6px;
}

.form-divider p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* 输入框统一跟随主题 */
.vocabulary-page input,
.vocabulary-page textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  background: var(--input-bg);
  color: var(--text-main);
  font: inherit;
  font-size: 13px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.vocabulary-page input:focus,
.vocabulary-page textarea:focus {
  border-color: var(--neon);
}

.vocabulary-page input::placeholder,
.vocabulary-page textarea::placeholder {
  color: var(--text-muted);
}

.vocabulary-page textarea {
  resize: vertical;
}

.dynamic-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dynamic-item,
.example-item {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.add-field-button {
  margin-top: 10px;
  padding: 5px 0;
  border: none;
  background: transparent;
  color: var(--neon);
  font-size: 12px;
  cursor: pointer;
}

.add-field-button:hover {
  text-decoration: underline;
}

.remove-field-button {
  align-self: flex-end;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
}

.remove-field-button:hover {
  border-color: #ff6464;
  color: #ff7777;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 35px;
}

#cancel-entry-button {
  padding: 11px 18px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

#cancel-entry-button:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
}

/* ---------- 07. 词汇列表 ---------- */

.vocabulary-list-section {
  margin-top: 48px;
}

#vocabulary-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 25px;
}

.empty-message {
  padding: 55px 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

/* ---------- 08. 词汇卡片 ---------- */

.vocabulary-card {
  padding: 28px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    transform 0.25s ease;
}

.vocabulary-card:hover {
  background: var(--card-hover);
  border-color: var(--neon);
  transform: translateY(-2px);
}

/* 卡片顶部：词汇名称与日期 */
.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.entry-concept {
  margin: 0;
  color: var(--neon);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.5px;
}

.entry-date {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

/* ---------- 09. 中文释义 ---------- */

.entry-chinese-meaning {
  padding: 19px 21px;
  margin-top: 22px;
  background: var(--neon-soft);
  border-left: 3px solid var(--neon);
  border-radius: 0 9px 9px 0;
}

.entry-chinese-meaning .entry-language {
  margin-bottom: 8px;
}

.entry-meaning-content {
  margin: 0;
  color: var(--text-main);
  font-size: 19px;
  font-weight: 550;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* ---------- 10. 英法俄三语并列 ---------- */

.entry-language-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 25px;
  padding: 21px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* 每种语言独立占据一栏 */
.entry-language-column {
  min-width: 0;
  padding: 0 17px;
}

.entry-language-column:first-child {
  padding-left: 0;
}

.entry-language-column:last-child {
  padding-right: 0;
}

/* 语言栏之间的分隔线 */
.entry-language-column + .entry-language-column {
  border-left: 1px solid var(--border);
}

.entry-language {
  margin: 0 0 10px;
  color: var(--neon);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.entry-content {
  margin: 0;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

/* ---------- 11. 多语言例句 ---------- */

.entry-examples-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 19px;
  margin-top: 24px;
}

.entry-section {
  min-width: 0;
}

.entry-example {
  padding: 12px 15px;
  margin-top: 9px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.example-text {
  margin: 0;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.example-translation {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* ---------- 12. 个人备注 ---------- */

.entry-notes {
  padding: 16px 18px;
  margin-top: 24px;
  background: var(--neon-soft);
  border-left: 2px solid var(--neon);
  border-radius: 0 7px 7px 0;
}

/* ---------- 13. 卡片操作 ---------- */

.entry-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 17px;
  margin-top: 22px;
  border-top: 1px solid var(--border);
}

.delete-entry-button {
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
}

.delete-entry-button:hover {
  color: #ff7777;
}

/* ---------- 14. 手机适配 ---------- */

@media (max-width: 600px) {
  .vocabulary-page {
    width: calc(100% - 32px);
    padding-top: 28px;
  }

  .vocabulary-header {
    margin-bottom: 40px;
  }

  .vocabulary-topbar {
    margin-bottom: 40px;
  }

  .vocabulary-add {
    align-items: flex-start;
    flex-direction: column;
  }

  #add-entry-button {
    width: 100%;
  }

  .entry-form-panel,
  .vocabulary-card {
    padding: 19px;
  }

  .entry-concept {
    font-size: 23px;
  }

  .entry-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  /* 手机端三种语言改为纵向排列 */
  .entry-language-grid {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .entry-language-column {
    padding: 0;
  }

  .entry-language-column + .entry-language-column {
    padding-top: 16px;
    border-top: 1px solid var(--border);
    border-left: none;
  }

  .entry-meaning-content {
    font-size: 17px;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions button {
    width: 100%;
  }
}

/* ==================================================
   15. 词汇搜索与语言筛选
   ================================================== */

/* 搜索区域布局 */
.vocabulary-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  margin-top: 24px;
}

/* 搜索框与语言选择器统一样式 */
.vocabulary-search input,
.vocabulary-search select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 15px;

  border: 1px solid var(--border);
  border-radius: 8px;

  outline: none;
  background: var(--input-bg);
  color: var(--text-main);

  font-family: inherit;
  font-size: 13px;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

/* 输入时的荧光绿焦点效果 */
.vocabulary-search input:focus,
.vocabulary-search select:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px var(--neon-soft);
}

/* 搜索框提示文字 */
.vocabulary-search input::placeholder {
  color: var(--text-muted);
}

/* 下拉菜单 */
.vocabulary-search select {
  cursor: pointer;
  color: var(--text-muted);
}

.vocabulary-search select option {
  background: var(--card-bg);
  color: var(--text-main);
}

/* 搜索结果数量 */
.vocabulary-search-status {
  min-height: 16px;
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.3px;
}

/* 搜索结果与词汇卡片之间的间距 */
#vocabulary-list {
  margin-top: 18px;
}

/* 手机端：搜索框和筛选器纵向排列 */
@media (max-width: 600px) {
  .vocabulary-search {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .vocabulary-search input,
  .vocabulary-search select {
    height: 44px;
  }
}

/* ==================================================
   词汇录入面板 · 折叠分组
   ================================================== */

/* 折叠分组外观 */
.form-accordion {
  margin: 16px 0;
  border: 1px solid var(--neon, #b6ff00);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

/* 分组标题 */
.form-accordion summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

/* 隐藏浏览器默认箭头 */
.form-accordion summary::-webkit-details-marker {
  display: none;
}

/* 自定义展开箭头 */
.form-accordion summary::after {
  content: "+";
  margin-left: auto;
  color: var(--neon, #b6ff00);
  font-size: 22px;
  transition: transform 0.2s ease;
}

/* 展开时箭头变化 */
.form-accordion[open] summary::after {
  content: "−";
}

/* 分组编号 */
.accordion-number {
  color: var(--neon, #b6ff00);
  font-size: 12px;
  font-weight: 700;
}

/* 分组标题 */
.accordion-title {
  font-weight: 700;
  font-size: 15px;
}

/* 分组副标题 */
.accordion-description {
  color: var(--text-secondary, #888);
  font-size: 12px;
}

/* 展开内容 */
.accordion-content {
  padding: 4px 20px 20px;
  border-top: 1px solid rgba(182, 255, 0, 0.15);
}

/* 内容提示 */
.accordion-hint {
  margin: 12px 0 20px;
  color: var(--text-secondary, #888);
  font-size: 13px;
  line-height: 1.6;
}

/* 鼠标悬停 */
.form-accordion summary:hover {
  background: rgba(182, 255, 0, 0.045);
}

/* 展开动画 */
.form-accordion[open] .accordion-content {
  animation: accordionFade 0.2s ease;
}

@keyframes accordionFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 浅色主题适配 */
.vocabulary-light .form-accordion {
  background: #ffffff;
  border-color: rgba(30, 30, 30, 0.12);
}

.vocabulary-light .form-accordion summary::after,
.vocabulary-light .accordion-number {
  color: #648d00;
}

.vocabulary-light .accordion-content {
  border-top-color: rgba(30, 30, 30, 0.1);
}

/* 手机端布局 */
@media (max-width: 600px) {
  .form-accordion summary {
    gap: 8px;
    padding: 16px 14px;
    flex-wrap: wrap;
  }

  .accordion-description {
    width: 100%;
    padding-left: 28px;
  }

  .accordion-content {
    padding: 4px 14px 16px;
  }
}
