/* 水稻田英语 v2：背单词 / 查词 — 保留品牌色，简化布局 */

.fm-pe-panel {
    max-width: 920px;
}

.fm-pe-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.fm-pe-panel__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.fm-pe-panel__meta {
    font-size: 13px;
    color: #6b7280;
}

.fm-pe-cardbox {
    border: 1px solid #e7ecef;
    border-radius: 4px;
    background: #fff;
    overflow: visible;
}

/* 覆盖 online-tools .fm-wordstudy-cardbox { padding:20px }，单层内边距保证左对齐 */
.fm-pe-panel .fm-wordstudy-cardbox.fm-pe-cardbox,
.fm-pe-panel .fm-wordstudy-cardbox {
    padding: 12px !important;
    box-shadow: none !important;
    border-radius: 4px;
    box-sizing: border-box;
    overflow: visible !important;
}

/* 顶栏 / 单词标题与分隔线左端一致；释义区另设缩进见下 */
.fm-pe-panel .fm-pe-cardhead,
.fm-pe-panel .fm-pe-word-block,
.fm-pe-panel .fm-pe-ecdict-in-card,
.fm-pe-panel .fm-wordstudy-cardbox .fm-pe-actions,
.fm-pe-panel .fm-wordstudy-cardbox .fm-pe-actions-sub {
    padding-left: 0;
    padding-right: 0;
}

.fm-pe-cardhead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px 10px;
    padding-top: 8px;
    padding-bottom: 8px;
    margin: 0;
    border-bottom: 1px solid #eef2f4;
    background: transparent;
    box-sizing: border-box;
}

.fm-pe-cardhead .fm-pe-dict-tabs--topbar {
    margin: 0;
    padding: 0;
}

.fm-pe-panel .fm-pe-ecdict-in-card {
    padding-top: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef2f4;
}

.fm-pe-panel .fm-pe-ecdict-in-card .fm-graded-ecdict-head {
    margin-bottom: 8px;
}

.fm-pe-panel .fm-pe-ecdict-in-card .fm-ecdict-study-result {
    overflow: visible;
    max-height: none;
}

.fm-pe-panel .fm-pe-ecdict-in-card.is-hidden {
    display: none !important;
}

.fm-pe-cardhead .fm-pe-progress {
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

.fm-pe-progress {
    padding: 8px 16px;
    font-size: 13px;
    color: #6b7280;
    border-bottom: 1px solid #eef2f4;
    background: #fafbfc;
}

.fm-pe-cardhead .fm-pe-progress {
    padding: 0;
    border-bottom: none;
    background: transparent;
}

.fm-pe-word-block {
    padding-top: 10px;
    padding-bottom: 4px;
    text-align: left;
}

/* 单词、音标、提示与释义区统一右缩进 */
.fm-pe-panel .fm-pe-word-block .fm-pe-word-en,
.fm-pe-panel .fm-pe-word-block .fm-pe-ipa-toolbar,
.fm-pe-panel .fm-pe-word-block .fm-pe-word-hint,
.fm-pe-panel .fm-pe-dict-body:not(.fm-pe-dict-body--provider-full) {
    padding-left: 12px;
}

/* 必应/有道完整卡片：不裁切、不双层缩进，内容全部展开 */
.fm-pe-panel .fm-pe-dict-body.fm-pe-dict-body--provider-full {
    padding-left: 12px;
    padding-right: 12px;
    overflow: visible;
    max-height: none;
}

.fm-pe-panel .fm-pe-dict-body--provider-full .fm-youdao-dict-card,
.fm-pe-panel .fm-pe-dict-body--provider-full .fm-bing-dict-card,
.fm-pe-panel .fm-pe-dict-body--provider-full .fm-word-lookup-card {
    max-width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 8px;
    box-sizing: border-box;
}

.fm-pe-panel .fm-pe-dict-body--provider-full .fm-youdao-dict-word,
.fm-pe-panel .fm-pe-dict-body--provider-full .fm-bing-dict-word {
    font-size: 1.25rem;
}

.fm-pe-panel .fm-pe-dict-body--provider-full .fm-youdao-dict-section,
.fm-pe-panel .fm-pe-dict-body--provider-full .fm-bing-dict-auth,
.fm-pe-panel .fm-pe-dict-body--provider-full .fm-bing-dict-ex-list {
    max-height: none;
    overflow: visible;
}

/* 背单词 · 必应/有道：兜底隐藏例句区块 */
.fm-pe-panel .fm-pe-dict-body--hide-examples .fm-bing-dict-ex-title,
.fm-pe-panel .fm-pe-dict-body--hide-examples .fm-bing-dict-ex-list,
.fm-pe-panel .fm-pe-dict-body--hide-examples .fm-bing-dict-auth-ex-list,
.fm-pe-panel .fm-pe-dict-body--hide-examples .fm-youdao-dict-ex-list,
.fm-pe-panel .fm-pe-dict-body--hide-examples .fm-youdao-collins-ex {
    display: none !important;
}

.fm-pe-panel .fm-pe-dict-body--hide-examples .fm-bing-dict-foot,
.fm-pe-panel .fm-pe-dict-body--hide-examples .fm-youdao-dict-foot {
    display: none !important;
}

.fm-pe-panel .fm-wordstudy-card-hint,
.fm-pe-word-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
    text-align: left;
}

.fm-pe-word-en {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 0.02em;
    line-height: 1.25;
}

.fm-pe-word-ipa {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.fm-pe-ipa-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 0;
}

.fm-pe-ipa-toolbar .fm-wordstudy-card-ipa-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 10px;
    flex: 0 1 auto;
    min-width: 0;
}

.fm-pe-ipa-toolbar .fm-wordstudy-ipa-pair {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fm-pe-ipa-toolbar .fm-wordstudy-ipa-tag {
    font-size: 11px;
    font-weight: 600;
    color: #047857;
    margin-right: 3px;
}

.fm-pe-ipa-toolbar .fm-wordstudy-card-ipa {
    font-size: 14px;
}

.fm-pe-ipa-toolbar .fm-wordstudy-ipa-sep {
    width: 8px;
    flex-shrink: 0;
}

.fm-pe-ipa-toolbar .fm-word-lookup-audio-icon {
    flex-shrink: 0;
}

.fm-pe-dict-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid #eef2f4;
    background: #fafbfc;
}

.fm-pe-dict-tabs--topbar {
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    gap: 4px;
    flex: 1 1 auto;
    justify-content: flex-start;
    min-width: 0;
}

.fm-pe-dict-tabs--topbar .fm-pe-dict-tab {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
}

.fm-pe-dict-tab {
    padding: 6px 14px;
    border: 1px solid #e7ecef;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.fm-pe-dict-tab:hover {
    border-color: var(--fm-brand-soft, #c7ecd4);
    color: var(--fm-brand-hover, #125a2d);
}

.fm-pe-dict-tab.is-active {
    border-color: var(--fm-brand, #177739);
    background: var(--fm-brand-surface, #edf7f0);
    color: var(--fm-brand, #177739);
    font-weight: 600;
}

.fm-pe-dict-tab.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 查单词：词典 Tab 仅在结果区内右上角（与背单词 topbar 同款小按钮） */
.fm-pe-app .fm-word-lookup--unified > .fm-word-lookup-dict-tabs:not(.fm-word-lookup-dict-tabs--in-card) {
    display: none !important;
}

.fm-pe-app .fm-word-lookup-result-shell {
    position: relative;
    margin-top: 12px;
}

.fm-pe-app .fm-word-lookup-result-shell[hidden] {
    display: none !important;
}

.fm-pe-app .fm-word-lookup-dict-tabs--in-card {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    margin: 0;
    padding: 0;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 62%;
}

.fm-pe-app .fm-word-lookup-dict-tabs--in-card .fm-word-lookup-dict-tab {
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.35;
    border-radius: 4px;
    border: 1px solid #e7ecef;
    background: #fff;
    color: #4b5563;
}

.fm-pe-app .fm-word-lookup-dict-tabs--in-card .fm-word-lookup-dict-tab.is-active {
    border-color: var(--fm-brand, #177739);
    background: var(--fm-brand-surface, #edf7f0);
    color: var(--fm-brand, #177739);
    font-weight: 600;
}

.fm-pe-app .fm-word-lookup-result-shell .fm-word-lookup-result {
    margin-top: 0;
}

.fm-pe-app .fm-word-lookup-result-shell .fm-word-lookup-card,
.fm-pe-app .fm-word-lookup-result-shell .fm-bing-dict-card,
.fm-pe-app .fm-word-lookup-result-shell .fm-youdao-dict-card {
    padding-top: 40px;
}

/* 释义块：虚线与标题、上一段内容与虚线间距均为 15px */
.fm-pe-app .fm-word-lookup-result-shell .fm-ecdict-block {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e5e7eb;
}

.fm-pe-app .fm-word-lookup-result-shell .fm-word-lookup-word,
.fm-pe-app .fm-word-lookup-result-shell .fm-bing-dict-word,
.fm-pe-app .fm-word-lookup-result-shell .fm-youdao-dict-word {
    padding-right: 38%;
    box-sizing: border-box;
}

html.fm-pe-theme-dark .fm-pe-app .fm-word-lookup-dict-tabs--in-card .fm-word-lookup-dict-tab {
    background: var(--fm-pe-bg);
    border-color: var(--fm-pe-line);
    color: var(--fm-pe-text);
}

html.fm-pe-theme-dark .fm-pe-app .fm-word-lookup-dict-tabs--in-card .fm-word-lookup-dict-tab.is-active {
    background: var(--fm-pe-brand-surface);
    border-color: var(--fm-pe-brand);
    color: var(--fm-pe-text);
}

.fm-wordstudy-reveal-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.fm-wordstudy-reveal-countdown {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.2;
}

.fm-pe-dict-panel.is-hidden {
    display: none !important;
}

.fm-pe-dict-body {
    min-height: 0;
    padding-top: 0;
    padding-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    overflow: visible;
}

.fm-pe-panel .fm-pe-dict-panel:not(.is-hidden) {
    border-top: none;
    margin-top: 4px;
}

.fm-pe-panel .fm-pe-dict-body .fm-ecdict-block,
.fm-pe-panel .fm-pe-dict-body .fm-pe-ws-block {
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
}

.fm-pe-panel .fm-pe-dict-body .fm-ecdict-block:first-child,
.fm-pe-panel .fm-pe-dict-body .fm-pe-ws-block:first-child {
    margin-top: 0;
}

.fm-pe-panel .fm-pe-dict-body .fm-ecdict-h,
.fm-pe-panel .fm-pe-dict-body .fm-pe-ws-block__title {
    margin: 0 0 4px;
    font-size: 13px;
}

.fm-pe-panel .fm-pe-ws-defs,
.fm-pe-panel .fm-pe-ws-list {
    padding-left: 1em;
    margin: 0;
}

.fm-pe-panel .fm-pe-ws-detail {
    max-height: none;
    overflow: visible;
}

.fm-pe-ws-block {
    margin-bottom: 14px;
}

.fm-pe-ws-block__title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fm-brand, #177739);
}

.fm-pe-ws-block__body {
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

.fm-pe-ws-meta {
    margin: 0 0 10px;
    font-size: 12px;
    color: #9ca3af;
}

.fm-pe-ws-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--fm-brand-surface, #edf7f0);
    color: var(--fm-brand, #177739);
}

.fm-pe-ws-defs {
    margin: 0;
    padding-left: 1.1em;
}

.fm-pe-ws-defs li {
    margin-bottom: 6px;
}

/* 背单词释义区：词性方框与查单词（必应/有道）一致 */
.fm-pe-panel .fm-pe-dict-body .fm-bing-dict-defs,
.fm-pe-panel .fm-pe-dict-body .fm-youdao-dict-defs,
.fm-pe-panel .fm-pe-ws-detail .fm-bing-dict-defs,
.fm-word-lookup-card--local .fm-bing-dict-defs {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fm-pe-panel .fm-pe-dict-body .fm-bing-dict-def-row,
.fm-pe-panel .fm-pe-dict-body .fm-youdao-dict-def-row,
.fm-pe-panel .fm-pe-dict-body .fm-ecdict-body .fm-bing-dict-def-row,
.fm-pe-panel .fm-pe-ws-detail .fm-bing-dict-def-row,
.fm-word-lookup-card--local .fm-bing-dict-def-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    line-height: 1.55;
    font-size: 15px;
    color: #111827;
}

.fm-pe-panel .fm-pe-dict-body .fm-bing-dict-pos,
.fm-pe-panel .fm-pe-dict-body .fm-ecdict-body .fm-bing-dict-pos,
.fm-pe-panel .fm-pe-ws-detail .fm-bing-dict-pos,
.fm-word-lookup-card--local .fm-bing-dict-pos {
    flex-shrink: 0;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    background: #4b5563;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.fm-pe-panel .fm-pe-dict-body .fm-bing-dict-pos--web,
.fm-pe-panel .fm-pe-dict-body .fm-ecdict-body .fm-bing-dict-pos--web,
.fm-pe-panel .fm-pe-ws-detail .fm-bing-dict-pos--web,
.fm-word-lookup-card--local .fm-bing-dict-pos--web {
    background: #111827;
}

.fm-pe-panel .fm-pe-dict-body .fm-youdao-dict-pos {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 3px;
    background: #1d4ed8;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.fm-pe-panel .fm-pe-dict-body .fm-bing-dict-def-txt,
.fm-pe-panel .fm-pe-dict-body .fm-youdao-dict-def-txt {
    flex: 1;
    min-width: 0;
}

.fm-pe-panel .fm-pe-dict-body .fm-bing-dict-tense {
    margin: 0 0 10px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.fm-pe-ws-pos {
    color: #6b7280;
    margin-right: 6px;
}

.fm-pe-ws-list {
    margin: 0;
    padding-left: 1.2em;
}

.fm-pe-ws-ex {
    margin: 0 0 10px;
}

.fm-pe-ws-ex__en {
    display: block;
    color: #1f2937;
}

.fm-pe-ws-ex__zh {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.fm-pe-ws-ex-num {
    color: #9ca3af;
    margin-right: 4px;
}

.fm-pe-ws-muted {
    color: #9ca3af;
    text-align: center;
    margin: 8px 0;
}

.fm-pe-panel .fm-wordstudy-card-en {
    text-align: left;
}

.fm-pe-panel .fm-pe-word-en.fm-wordstudy-card-en {
    font-size: 22px;
}

/* 未显示释义时不撑大块空白（覆盖 online-tools 的 min-height:140px / padding:16px） */
.fm-pe-panel .fm-wordstudy-cardbox .fm-wordstudy-card {
    min-height: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
}

.fm-pe-panel .fm-wordstudy-card.is-revealed {
    min-height: 0;
    padding-bottom: 0;
}

#fm-wordstudy-study-body.is-hidden {
    display: none !important;
}

.fm-pe-dict-body.is-empty {
    color: #9ca3af;
    text-align: center;
    padding: 32px 16px;
}

.fm-pe-dict-body .fm-ecdict-block,
.fm-pe-dict-body .fm-wordstudy-provider-block {
    margin-bottom: 12px;
}

.fm-pe-panel .fm-wordstudy-cardbox .fm-pe-actions,
.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions.fm-wordstudy-nav,
.fm-pe-app .fm-wordstudy-main > .fm-wordstudy-nav {
    display: grid;
    grid-template-columns: auto auto minmax(4.25rem, max-content) auto auto;
    grid-template-rows: auto auto auto;
    justify-content: center;
    justify-items: center;
    align-items: center;
    column-gap: 6px;
    row-gap: 5px;
    margin-top: 10px !important;
    padding-top: 10px;
    padding-bottom: 8px !important;
    border-top: 1px solid #eef2f4;
}

.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions > #fm-wordstudy-prev,
.fm-pe-app .fm-wordstudy-main > .fm-wordstudy-nav > #fm-wordstudy-prev {
    grid-column: 1;
    grid-row: 1;
}

.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions > #fm-wordstudy-known,
.fm-pe-app .fm-wordstudy-main > .fm-wordstudy-nav > #fm-wordstudy-known {
    grid-column: 2;
    grid-row: 1;
}

.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions > #fm-wordstudy-unknown,
.fm-pe-app .fm-wordstudy-main > .fm-wordstudy-nav > #fm-wordstudy-unknown {
    grid-column: 4;
    grid-row: 1;
}

.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions > #fm-wordstudy-next,
.fm-pe-app .fm-wordstudy-main > .fm-wordstudy-nav > #fm-wordstudy-next {
    grid-column: 5;
    grid-row: 1;
}

.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions-reveal-block:not(.is-hidden),
.fm-pe-panel .fm-wordstudy-cardbox .fm-pe-actions-reveal-block:not(.is-hidden),
.fm-pe-app .fm-wordstudy-main > .fm-wordstudy-nav .fm-pe-actions-reveal-block:not(.is-hidden) {
    display: contents;
}

.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions-reveal-block.is-hidden,
.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions-reveal-col.is-hidden,
.fm-pe-app .fm-wordstudy-main > .fm-wordstudy-nav .fm-pe-actions-reveal-block.is-hidden {
    display: none !important;
}

.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions-reveal-block .fm-wordstudy-reveal-wrap,
.fm-pe-app .fm-wordstudy-main > .fm-wordstudy-nav .fm-pe-actions-reveal-block .fm-wordstudy-reveal-wrap {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    justify-content: center;
}

.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions-reveal-block .fm-wordstudy-reveal-countdown,
.fm-pe-panel .fm-pe-actions-reveal-block .fm-wordstudy-reveal-countdown,
.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions-reveal-col .fm-wordstudy-reveal-countdown,
.fm-pe-panel .fm-pe-actions-reveal-col .fm-wordstudy-reveal-countdown,
.fm-pe-app .fm-wordstudy-main > .fm-wordstudy-nav .fm-wordstudy-reveal-countdown {
    grid-column: 3;
    grid-row: 2;
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 2px 0 0;
    padding: 0;
    font-size: 11px;
    line-height: 1.25;
    color: #9ca3af;
    white-space: nowrap;
    text-align: center;
    pointer-events: none;
}

.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions-reveal-block .fm-wordstudy-reveal-countdown.is-hidden,
.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions-reveal-col .fm-wordstudy-reveal-countdown.is-hidden {
    display: none !important;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.fm-pe-app .fm-wordstudy-cardbox .fm-pe-actions-reveal-block .fm-wordstudy-btn-too-easy,
.fm-pe-app .fm-wordstudy-main > .fm-wordstudy-nav .fm-wordstudy-btn-too-easy {
    grid-column: 3;
    grid-row: 3;
    margin: 8px 0 0;
}

.fm-pe-panel .fm-wordstudy-nav .fm-tool-btn,
.fm-pe-panel .fm-wordstudy-nav .fm-pe-btn-reveal {
    min-width: 4.25rem;
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 500;
    box-sizing: border-box;
}

.fm-pe-panel .fm-wordstudy-reveal-wrap {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    vertical-align: middle;
    gap: 0;
    min-height: 0;
    padding: 0;
    box-sizing: border-box;
}

.fm-pe-panel .fm-wordstudy-reveal-wrap #fm-wordstudy-reveal {
    min-width: 4.25rem;
    flex-shrink: 0;
}

.fm-pe-panel .fm-wordstudy-reveal-countdown {
    position: static;
    margin: 0;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
}

.fm-pe-panel .fm-pe-btn-reveal.is-active,
.fm-pe-panel .fm-wordstudy-card.is-revealed .fm-pe-btn-reveal {
    color: var(--fm-brand, #177739);
    border-color: var(--fm-brand-soft, #c7ecd4);
    background: var(--fm-brand-surface, #edf7f0);
}

.fm-pe-hint {
    margin: 0;
    padding: 0 16px 12px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
}

.fm-pe-practice {
    margin-top: 20px;
    border-top: 1px dashed #e7ecef;
    padding-top: 16px;
}

.fm-pe-practice .fm-wordstudy-practice-title {
    margin: 0 0 6px;
    font-weight: 700;
    color: var(--fm-pe-brand-dark, #177739);
    font-size: 18px;
}

.fm-wordstudy-catalog-tip {
    display: none;
}

/* 覆盖 online-tools 右侧 sticky（该文件在 fm-paddyenglish 之后加载，此处再写一遍） */
.fm-pe-app .fm-tools__grid--cate-focus:not(.fm-pe-tool-grid--single) > .fm-tools__panel,
.fm-pe-app .fm-tools__grid--cate-focus:not(.fm-pe-tool-grid--single) > .fm-tools__catalog {
    position: static !important;
    top: auto !important;
}

/* 中间主区与右侧词书栏顶边对齐（覆盖 online-tools 的 grid/sticky/order） */
.fm-pe-app .fm-pe-tool-grid.fm-tools__grid--cate-focus:not(.fm-pe-tool-grid--single) {
    display: flex !important;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
}

/* 右侧已有「背单词/生词本」标题时，隐藏中间重复标题行，使白卡片顶边对齐 */
.fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-tools__panel.fm-pe-panel-card > .fm-pe-panel__head {
    display: none;
}

.fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-tools__panel.fm-pe-panel-card > .fm-wordstudy-panel > .fm-pe-panel__head {
    display: none;
}

.fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-tools__panel.fm-pe-panel-card,
.fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-pe-tool-catalog.fm-pe-panel-card {
    margin-top: 0 !important;
    position: static !important;
    top: auto !important;
    order: 0 !important;
    align-self: flex-start !important;
}

.fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-tools__panel.fm-pe-panel-card {
    flex: 1 1 auto;
    min-width: 0;
    padding: 16px;
    box-sizing: border-box;
}

/* 右侧词书栏：相对原 -18px 对齐线下移 15px（-3px） */
.fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-pe-tool-catalog.fm-pe-panel-card {
    flex: 0 0 280px !important;
    width: 280px;
    max-width: 280px;
    padding: 0 !important;
    margin-top: -3px !important;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    overflow: visible;
    box-sizing: border-box;
    min-height: 0 !important;
    height: max-content !important;
    max-height: none;
    align-self: flex-start !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.fm-pe-app .fm-pe-tool-catalog .fm-wordstudy-catalog {
    height: auto !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    box-sizing: border-box;
}

.fm-pe-app .fm-pe-tool-catalog.fm-pe-panel-card .fm-wordstudy-catalog > .fm-tools__category {
    margin: 0;
    border: 1px solid var(--fm-pe-line, #e5ebe8);
    border-radius: var(--fm-pe-radius, 4px);
    box-shadow: var(--fm-pe-shadow, 0 2px 12px rgba(15, 23, 42, 0.06));
    background: var(--fm-pe-surface, #fff);
    overflow: hidden;
}

.fm-pe-app .fm-pe-tool-catalog.fm-pe-panel-card .fm-wordstudy-catalog-ecdict {
    margin-top: 0;
    padding: 12px 16px 14px;
    border: 1px solid var(--fm-pe-line, #e5ebe8);
    border-radius: var(--fm-pe-radius, 4px);
    background: var(--fm-pe-surface, #fff);
    box-shadow: var(--fm-pe-shadow, 0 2px 12px rgba(15, 23, 42, 0.06));
    box-sizing: border-box;
}

.fm-pe-app .fm-pe-tool-catalog .fm-wordstudy-catalog-notebook-section {
    margin: 0;
}

.fm-pe-app .fm-pe-tool-catalog .fm-wordstudy-catalog-ecdict__status:empty {
    display: none;
    margin: 0;
    padding: 0;
    min-height: 0;
}

/* 查单词 · 历史查询：与左侧白卡片顶边对齐（不用背单词 -18px 上移） */
.fm-pe-app .fm-tools__grid--cate-focus:not(.fm-pe-tool-grid--single) > .fm-pe-tool-catalog--lookup-history.fm-tools__catalog,
.fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-pe-tool-catalog--lookup-history.fm-pe-panel-card {
    flex: 0 0 260px !important;
    width: 260px !important;
    max-width: 260px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: flex-start !important;
    position: static !important;
    top: auto !important;
}

.fm-pe-app .fm-pe-tool-catalog--lookup-history .fm-word-lookup-history {
    margin-top: 0;
    padding-top: 15px;
    box-sizing: border-box;
}

/* 生词本页不展示顶栏词典 Tab；释义在卡片内 fm-pe-dict-panel 展示（由 JS 显隐） */
.fm-pe-app .fm-wordstudy-panel--notebook .fm-wordstudy-toolbar--top .fm-pe-dict-tabs,
.fm-pe-app #fm-wordstudy-root:has(.fm-wordstudy-cardbox[data-force-notebook-page="1"]) .fm-wordstudy-toolbar--top .fm-pe-dict-tabs {
    display: none !important;
}

/* 背单词顶栏：左词典 Tab，右随机/重置；生词本时左侧为筛选钮 */
.fm-pe-app .fm-wordstudy-toolbar--top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 10px;
    margin-bottom: 16px;
}

.fm-pe-app .fm-wordstudy-toolbar--top .fm-wordstudy-toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
}

.fm-pe-app .fm-wordstudy-toolbar--top .fm-pe-dict-tabs--topbar {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    gap: 8px;
    align-items: center;
}

/* 背单词顶栏词典 Tab：与「生词本」筛选钮同尺寸 */
.fm-pe-app .fm-wordstudy-toolbar--top .fm-pe-dict-tabs--topbar .fm-pe-dict-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.25;
    border: 1px solid var(--fm-brand, #177739);
    border-radius: 3px;
    background: #fff;
    color: var(--fm-brand, #177739);
    box-sizing: border-box;
}

.fm-pe-app .fm-wordstudy-toolbar--top .fm-pe-dict-tabs--topbar .fm-pe-dict-tab:hover {
    background: #f0faf4;
    border-color: var(--fm-brand, #177739);
    color: var(--fm-brand, #177739);
}

.fm-pe-app .fm-wordstudy-toolbar--top .fm-pe-dict-tabs--topbar .fm-pe-dict-tab.is-active {
    border-color: var(--fm-brand-soft, #c7ecd4);
    background: var(--fm-brand-surface, #edf7f0);
    color: var(--fm-brand-hover, #125a2d);
    font-weight: 600;
}

.fm-pe-app .fm-wordstudy-toolbar--top .fm-wordstudy-progress {
    flex-shrink: 0;
    margin: 0 8px 0 0;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

.fm-pe-app .fm-wordstudy-toolbar--top .fm-wordstudy-progress:empty {
    display: none;
    margin: 0;
}

.fm-pe-app .fm-wordstudy-toolbar--top .fm-wordstudy-toolbar-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
}

.fm-pe-app .fm-wordstudy-toolbar--top .fm-wordstudy-toolbar-actions .fm-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    margin: 0;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
    line-height: 1.25;
}

.fm-pe-app .fm-wordstudy-toolbar--top .fm-wordstudy-toolbar-filters .fm-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    margin: 0;
    box-sizing: border-box;
    line-height: 1.25;
}

/* 按钮行：显示释义与认识/不认识同高，倒计时不挤占本行 */
.fm-pe-panel .fm-pe-actions .fm-wordstudy-reveal-wrap {
    position: static;
    display: inline-flex;
    vertical-align: middle;
}

/* 右侧词书：「全部词汇」与下方「小学词汇」等学段之间不要分隔线 */
.fm-wordstudy-catalog-body > .fm-wordstudy-catalog-group + .fm-wordstudy-catalog-group .fm-wordstudy-catalog-group-title {
    padding-top: 4px;
    border-top: none;
}

/* 查单词：默认 [输入框][查询]；聚焦后出现问AI，无内框无横线 */
.fm-pe-app .fm-word-lookup__query {
    display: block;
}

.fm-pe-app .fm-word-lookup__query .fm-word-lookup-label {
    display: block;
    margin-bottom: 8px;
}

.fm-pe-app .fm-word-lookup-searchbox {
    border: 1px solid #dfe3e8;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.fm-pe-app .fm-word-lookup-searchbox.is-active,
.fm-pe-app .fm-word-lookup-searchbox:focus-within {
    border-color: var(--fm-brand, #177739);
    box-shadow: 0 0 0 1px rgba(23, 119, 57, 0.12);
}

.fm-pe-app .fm-word-lookup-searchbox__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 8px 10px;
}

.fm-pe-app .fm-word-lookup--unified .fm-word-lookup-searchbox__inner {
    gap: 6px 8px;
    padding: 5px 10px;
}

.fm-pe-app .fm-word-lookup-searchbox__field {
    position: relative;
    flex: 1 1 auto;
    min-width: 120px;
}

.fm-pe-app .fm-word-lookup-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    max-height: 280px;
    overflow: auto;
    overflow-anchor: none;
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.fm-pe-app .fm-word-lookup-suggest__item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.fm-pe-app .fm-word-lookup-suggest__item:hover,
.fm-pe-app .fm-word-lookup-suggest__item.is-active {
    background: var(--fm-brand-surface, #edf7f0);
}

.fm-pe-app .fm-word-lookup-suggest__word {
    font-weight: 600;
    color: var(--fm-brand, #177739);
    flex-shrink: 0;
}

.fm-pe-app .fm-word-lookup-suggest__hint {
    color: var(--fm-text-soft, #6b7280);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-pe-app .fm-word-lookup--unified .fm-word-lookup-searchbox__field .fm-word-lookup-input {
    padding: 4px 28px 4px 2px;
    font-size: 14px;
    line-height: 1.35;
}

.fm-pe-app .fm-word-lookup-searchbox__field .fm-word-lookup-input {
    width: 100%;
    box-sizing: border-box;
    border: none !important;
    box-shadow: none !important;
    padding: 6px 28px 6px 2px;
    font-size: 15px;
    line-height: 1.5;
    background: transparent;
    outline: none;
}

.fm-pe-app .fm-word-lookup-searchbox__field .fm-word-lookup-clear {
    right: 0;
}

.fm-pe-app .fm-word-lookup-searchbox__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.fm-pe-app .fm-word-lookup-searchbox__actions .fm-word-lookup-ask-ai {
    display: none;
}

.fm-pe-app .fm-word-lookup-searchbox.is-active .fm-word-lookup-searchbox__field,
.fm-pe-app .fm-word-lookup-searchbox:focus-within .fm-word-lookup-searchbox__field {
    flex: 1 1 100%;
    width: 100%;
}

.fm-pe-app .fm-word-lookup-searchbox.is-active .fm-word-lookup-searchbox__actions,
.fm-pe-app .fm-word-lookup-searchbox:focus-within .fm-word-lookup-searchbox__actions {
    flex: 1 1 100%;
    width: 100%;
    justify-content: space-between;
}

.fm-pe-app .fm-word-lookup-searchbox.is-active .fm-word-lookup-searchbox__actions .fm-word-lookup-ask-ai,
.fm-pe-app .fm-word-lookup-searchbox:focus-within .fm-word-lookup-searchbox__actions .fm-word-lookup-ask-ai {
    display: inline-flex;
}

.fm-pe-app .fm-word-lookup-ask-ai {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--fm-brand, #177739);
    font-weight: 500;
}

.fm-pe-app .fm-word-lookup-ask-ai-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.fm-pe-app .fm-word-lookup-ask-ai-switch {
    width: 36px;
    height: 20px;
    border-radius: 4px;
    background: #e5e7eb;
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s;
}

.fm-pe-app .fm-word-lookup-ask-ai-switch::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s;
}

.fm-pe-app .fm-word-lookup-ask-ai-input:checked + .fm-word-lookup-ask-ai-switch {
    background: var(--fm-brand, #177739);
}

.fm-pe-app .fm-word-lookup-ask-ai-input:checked + .fm-word-lookup-ask-ai-switch::after {
    transform: translateX(16px);
}

.fm-pe-app .fm-word-lookup-ask-ai-input:checked ~ .fm-word-lookup-ask-ai-label {
    color: var(--fm-brand, #177739);
    font-weight: 600;
}

.fm-pe-app .fm-word-lookup--unified .fm-word-lookup-searchbox__btn.fm-tool-btn--primary {
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    min-width: 56px;
    box-shadow: none;
    transform: none;
}

.fm-pe-app .fm-word-lookup--unified .fm-word-lookup-searchbox__btn.fm-tool-btn--primary:hover,
.fm-pe-app .fm-word-lookup--unified .fm-word-lookup-searchbox__btn.fm-tool-btn--primary:active {
    transform: none;
    box-shadow: none;
}

.fm-pe-app .fm-word-lookup-searchbox__btn {
    border-radius: 4px;
    padding: 6px 18px;
    font-size: 14px;
    min-width: 64px;
}

.fm-pe-app .fm-word-lookup--unified .fm-word-lookup-input-wrap .fm-word-lookup-input,
.fm-pe-app .fm-word-lookup-searchbox .fm-word-lookup-input {
    border: none !important;
    box-shadow: none !important;
}

.fm-pe-app .fm-pe-dict-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
    flex-wrap: wrap;
}

.fm-pe-app .fm-pe-dict-meta-row .fm-pe-dict-meta {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.fm-pe-app .fm-pe-dict-meta-row .fm-word-lookup-add-notebook {
    flex: 0 0 auto;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--fm-brand, #177739);
    border: 1px solid var(--fm-brand, #177739);
    border-radius: var(--fm-pe-radius, 4px);
    box-shadow: none;
    cursor: pointer;
}

.fm-pe-app .fm-pe-dict-meta-row .fm-word-lookup-add-notebook:hover {
    background: var(--fm-brand-hover, #125a2d);
    border-color: var(--fm-brand-hover, #125a2d);
    color: #fff;
    transform: none;
}

.fm-pe-app .fm-word-lookup-card--local .fm-bing-dict-phonetics,
.fm-pe-app .fm-word-lookup-card--deepseek .fm-bing-dict-phonetics,
.fm-pe-app .fm-word-lookup-card--llm .fm-bing-dict-phonetics {
    margin: 4px 0 14px;
}

.fm-pe-app .fm-word-lookup-result-shell .fm-word-lookup-pre {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.65;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
}

html.fm-pe-theme-dark .fm-pe-app .fm-word-lookup-searchbox {
    background: var(--fm-pe-bg);
    border-color: var(--fm-pe-line);
}

html.fm-pe-theme-dark .fm-pe-app .fm-word-lookup-result-shell .fm-word-lookup-pre {
    color: var(--fm-pe-text);
}

@media (max-width: 768px) {
    .fm-pe-word-en,
    .fm-pe-panel .fm-pe-word-en.fm-wordstudy-card-en {
        font-size: 20px;
    }

    .fm-pe-cardhead {
        padding: 6px 12px;
    }

    .fm-pe-actions {
        gap: 6px;
    }

    .fm-pe-actions .fm-tool-btn {
        flex: 1 1 auto;
        min-width: calc(50% - 8px);
    }
}

/* 手机/平板：主面板与右侧词书/历史查询纵向排列（覆盖上方桌面双栏 !important） */
@media (max-width: 991px) {
    .fm-pe-app .fm-pe-dl.fm-dl {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 100%;
    }

    .fm-pe-app .fm-pe-dl .fm-dl__side {
        position: relative;
        top: auto;
        width: 100%;
        max-width: none;
        max-height: none;
    }

    .fm-pe-app .fm-pe-dl .fm-dl__main {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .fm-pe-app .fm-pe-tool-grid.fm-tools__grid--cate-focus:not(.fm-pe-tool-grid--single) {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        flex-wrap: nowrap !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-tools__panel.fm-pe-panel-card,
    .fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-pe-tool-catalog.fm-pe-panel-card,
    .fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-pe-tool-catalog--lookup-history.fm-pe-panel-card {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        align-self: stretch !important;
        box-sizing: border-box !important;
    }

    /* 先显示词书/历史，再显示主内容区 */
    .fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-pe-tool-catalog.fm-pe-panel-card {
        order: -1 !important;
    }

    .fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-tools__panel.fm-pe-panel-card {
        order: 0 !important;
        padding: 14px 12px !important;
    }

    .fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-tools__panel.fm-pe-panel-card > .fm-pe-panel__head,
    .fm-pe-app .fm-pe-tool-grid:not(.fm-pe-tool-grid--single) > .fm-tools__panel.fm-pe-panel-card > .fm-wordstudy-panel > .fm-pe-panel__head {
        display: flex !important;
    }

    .fm-pe-app .fm-pe-tool-catalog--lookup-history .fm-word-lookup-history {
        max-height: none;
    }

    .fm-pe-app .fm-daily-practice__cta {
        width: 100%;
        max-width: 280px;
    }

    .fm-pe-app .fm-word-lookup-searchbox__inner {
        flex-wrap: wrap;
    }

    .fm-pe-app .fm-word-lookup-searchbox__field {
        flex: 1 1 100%;
        min-width: 0;
    }

    .fm-pe-app .fm-word-lookup-intro--global {
        font-size: 13px;
        line-height: 1.55;
    }
}

@media (max-width: 480px) {
    .fm-pe-app .fm-pe-hub__grid {
        grid-template-columns: 1fr;
    }
}
