/* 单词记忆表 · 手机端工具栏紧凑网格 + 表格按钮缩小 */
@media (max-width: 820px) {
  #theme-words-mount {
    padding: 0.4rem 0.35rem !important;
  }

  .theme-words__head {
    margin-bottom: 0.38rem;
  }

  .theme-words__head-row {
    margin-bottom: 0.12rem;
  }

  .theme-words__theme-title {
    font-size: 0.78rem !important;
  }

  .theme-words__title {
    font-size: 0.98rem;
    margin: 0 0 0.12rem;
  }

  .theme-words[data-theme="core"] .theme-words__head-row {
    display: none;
  }

  .theme-words__subtitle,
  .theme-words__subtitle::after {
    display: none !important;
    content: none !important;
  }

  .theme-words__toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.26rem !important;
    margin-bottom: 0.42rem;
  }

  .theme-words__accent {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    align-items: center;
    gap: 0.2rem;
    width: 100%;
  }

  .theme-words__accent-label {
    font-size: 0.54rem;
    white-space: nowrap;
  }

  .theme-words__accent-btn,
  .theme-words__dict-btn {
    font-size: 0.54rem !important;
    padding: 0.16rem 0.2rem !important;
    min-height: 1.52rem;
    width: 100%;
    border-radius: 6px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: none !important;
  }

  .theme-words__tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.22rem;
    width: 100%;
  }

  /* 保留定位容器：display:contents 会让美/英音菜单失去参照，飘到屏幕远处 */
  .theme-words__filter-wrap,
  .theme-words__cloze-wrap,
  .theme-words__autoplay-wrap {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
  }

  .theme-words__tool-btn {
    font-size: 0.54rem !important;
    padding: 0.16rem 0.18rem !important;
    min-height: 1.52rem;
    width: 100%;
    border-radius: 6px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transform: none !important;
    line-height: 1.15;
  }

  .theme-words__tool-btn:hover {
    transform: none !important;
  }

  .theme-words__autoplay-label {
    font-size: inherit;
  }

  /* 菜单贴在「连播」按钮正下方，避免 right:0 贴到整块工具栏右侧 */
  .theme-words__autoplay-menu {
    top: calc(100% + 0.22rem);
    left: 0;
    right: auto;
    z-index: 30;
    min-width: 100%;
  }

  .theme-words__filter-menu,
  .theme-words__cloze-menu {
    z-index: 30;
  }

  .theme-words__progress {
    margin: 0 !important;
    width: 100%;
    font-size: 0.56rem;
    text-align: center;
    line-height: 1.35;
  }

  .theme-words__star-legend {
    margin-bottom: 0.45rem;
    padding: 0.38rem 0.45rem;
    border-radius: 8px;
  }

  .theme-words__star-legend-title {
    font-size: 0.62rem;
    margin-bottom: 0.22rem;
  }

  .theme-words__star-legend-list {
    gap: 0.22rem 0.55rem;
  }

  .theme-words__star-legend-item {
    min-width: min(100%, 9.5rem);
    gap: 0.22rem;
  }

  .theme-words__star-legend-stars .theme-words__diff-star {
    font-size: 0.58rem;
  }

  .theme-words__star-legend-text {
    font-size: 0.58rem;
    line-height: 1.3;
  }

  .theme-words__status {
    max-width: 100%;
    padding: 0.12rem 0.22rem !important;
    font-size: 0.54rem !important;
    line-height: 1.2;
  }

  .theme-words__expand {
    padding: 0.14rem 0.32rem !important;
    font-size: 0.54rem !important;
    border-radius: 6px !important;
    transform: none !important;
  }

  .theme-words__expand:hover {
    transform: none !important;
  }

  .theme-words__diff-star {
    font-size: 0.58rem !important;
  }

  .theme-words__cell--meta {
    padding-left: 0.22rem !important;
    padding-right: 0.22rem !important;
  }

  .theme-words__cell--pos {
    font-family: "Noto Sans SC", "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    line-height: 1.35 !important;
    color: var(--tw-head-text, #4a4a4a) !important;
  }

  .theme-words--cloze-meaning .theme-words__cell--pos:not(.is-revealed) {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  .theme-words--cloze-meaning .theme-words__cell--pos:not(.is-revealed) strong,
  .theme-words--cloze-meaning .theme-words__cell--pos:not(.is-revealed) .theme-words__pos-extra {
    visibility: hidden !important;
  }

  .theme-words--cloze-meaning .theme-words__cell--pos:not(.is-revealed)::after {
    font-size: 0.72rem !important;
    line-height: 1.35 !important;
    -webkit-text-fill-color: #b0a0a8 !important;
  }

  .theme-words--cloze-meaning .theme-words__cell--pos.is-revealed {
    color: var(--tw-head-text, #4a4a4a) !important;
    -webkit-text-fill-color: currentColor !important;
  }

  .theme-words__cell--pos strong {
    font-size: 0.62rem !important;
    font-weight: 500 !important;
    color: #9a8f86 !important;
  }

  .theme-words__pos-extra {
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
  }

  /* 详解：词组 / 例句 / 雅思考点 */
  .theme-words__detail-cell {
    padding: 0 0.42rem 0.62rem !important;
  }

  .theme-words__detail {
    padding: 0.08rem 0 0.22rem 0.48rem;
    border-left-width: 2px;
  }

  .theme-words__detail-grid {
    gap: 0.42rem;
  }

  .theme-words__detail-card {
    padding: 0.52rem 0.58rem;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(44, 36, 32, 0.05);
  }

  .theme-words__detail-label {
    margin-bottom: 0.3rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
  }

  .theme-words__example-head {
    margin-bottom: 0.3rem;
    gap: 0.35rem;
  }

  .theme-words__example-speak {
    padding: 0.14rem 0.38rem;
    font-size: 0.6rem;
    font-weight: 600;
  }

  .theme-words__detail-en {
    font-family: "DM Sans", "Noto Sans", sans-serif;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.52;
    color: #3a3632;
  }

  .theme-words__detail-note {
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.58;
    color: #5a5550;
  }

  .theme-words__detail-card .theme-words__phrases li {
    font-family: "DM Sans", "Noto Sans SC", "PingFang SC", sans-serif;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.48;
    margin-bottom: 0.24rem;
    padding-left: 0.72rem;
    color: #4a4540;
  }

  .theme-words__detail-card .theme-words__phrases li::before {
    width: 0.22rem;
    height: 0.22rem;
    top: 0.52em;
  }

  .theme-words__detail-card .theme-words__ex-zh {
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1.52;
    color: #8a8480;
    margin-top: 0.28rem;
    padding-top: 0.28rem;
  }
}
