/* 艾宾浩斯词表 · 单词记忆状态（不透明实色胶囊，全端一致） */

.eh-word-head {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.28rem 0.45rem;
  margin-bottom: 0.15rem;
  max-width: 100%;
  white-space: nowrap;
}

.eh-word-head .eh-w-speak {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.eh-mastery-wrap {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  flex-shrink: 0;
}

/* 默认态 = 标记 / 未标记 */
.eh-mastery-status {
  display: inline-block;
  max-width: 5.4rem;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  border: 1px solid #c5cbbf;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  background: #e8ebe4;
  color: #5f675c;
  box-shadow: 0 1px 2px rgba(40, 50, 35, 0.08);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  opacity: 1 !important;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease;
}

.eh-mastery-status:hover {
  border-color: #aeb6a6;
  background: #f2f0e8;
  color: #4f574c;
  box-shadow: 0 1px 3px rgba(40, 50, 35, 0.1);
}

.eh-mastery-status--unmarked {
  color: #5f675c;
  background: #e8ebe4;
  border-color: #c5cbbf;
}

/* 记得：琥珀黄（实色） */
.eh-mastery-status--known {
  color: #6b5834;
  background: #f2e8d0;
  border-color: #d4c08a;
}

.eh-mastery-status--known:hover {
  background: #f6edd8;
  border-color: #c9b278;
  color: #5c4a2c;
}

/* 模糊：雾蓝（实色） */
.eh-mastery-status--fuzzy {
  color: #4a5a68;
  background: #dfe6ee;
  border-color: #b4c0cc;
}

.eh-mastery-status--fuzzy:hover {
  background: #e8eef4;
  border-color: #a3b1bf;
  color: #3f4e5a;
}

/* 忘记：豆沙红（实色） */
.eh-mastery-status--forgot {
  color: #7a454a;
  background: #f0dede;
  border-color: #d4a8ac;
}

.eh-mastery-status--forgot:hover {
  background: #f4e4e4;
  border-color: #c8989c;
  color: #6a3c40;
}

.eh-mastery-menu,
.eh-filter-menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  z-index: 50;
  min-width: 7.8rem;
  padding: 0.3rem 0;
  margin: 0;
  list-style: none;
  background: #fffefb;
  border: 1px solid #9aab88;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(40, 50, 35, 0.16);
  opacity: 1;
}

.eh-mastery-menu {
  left: 0;
  right: auto;
}

/* 打开后由 JS 挂到 body + fixed，避免表格 overflow 裁切 */
.eh-mastery-menu:not([hidden]) {
  position: fixed;
  z-index: 10000;
}

.eh-filter-menu {
  min-width: 8.6rem;
}

.eh-mastery-menu[hidden],
.eh-filter-menu[hidden] {
  display: none !important;
}

.eh-mastery-menu li,
.eh-filter-menu li {
  margin: 0;
  padding: 0;
}

.eh-mastery-menu__item,
.eh-filter-menu__item {
  display: block;
  width: 100%;
  padding: 0.42rem 0.8rem;
  border: none;
  background: #fffefb;
  font: inherit;
  font-size: 0.78rem;
  text-align: left;
  color: var(--eh-text, #3d3428);
  cursor: pointer;
}

.eh-mastery-menu__item:hover,
.eh-filter-menu__item:hover {
  background: #e4eedf;
}

.eh-filter-menu__item.is-active {
  font-weight: 700;
  color: #4a5c48;
  background: #d8e8d2;
}

.eh-pill-filter.is-on {
  background: #5c6b3d;
  border-color: #4a5830;
  color: #f5f3ea;
}

/* 不再给整行换色，只靠胶囊按钮区分状态 */

@media (max-width: 1180px) {
  .eh-word-head {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.22rem;
    white-space: normal;
    max-width: 100%;
  }

  .eh-word-head .eh-w-speak {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .eh-mastery-wrap {
    flex: 0 0 auto;
    flex-shrink: 0;
  }

  .eh-mastery-status {
    font-size: 0.68rem;
    max-width: 5.4rem;
    padding: 0.14rem 0.48rem;
    opacity: 1 !important;
  }
}

@media (max-width: 720px) {
  .eh-mastery-status {
    font-size: 0.62rem;
    max-width: 4.8rem;
    padding: 0.12rem 0.42rem;
    opacity: 1 !important;
  }

  .eh-word-head {
    gap: 0.2rem 0.35rem;
  }
}

@media print {
  .eh-mastery-menu,
  .eh-filter-menu,
  .eh-pill-wrap.eh-filter-wrap {
    display: none !important;
  }

  .eh-mastery-status {
    pointer-events: none;
    font-size: 0.62rem;
    box-shadow: none;
  }
}
