/* ==========================================================
   单词记忆方法（方法）— 卡片按钮 + 弹窗
   视觉：白瓷卡 + 暖光头部 + 果冻按钮，与站内糖果/果冻语言一致
   ========================================================== */

/* ---------- 卡片上的「方法」按钮（接在 PK 后面） ---------- */
/* 排在 PK 之后（主题里其余按钮用 order 硬排，这里需要 !important 压过） */
body .control-bar .control-btn.wm-btn {
    order: 5 !important;
    background: linear-gradient(180deg, #9ff0d0, #3fd6a4) !important;
    color: #0b5c46 !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) !important;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.65),
        inset 0 -4px 6px rgba(0, 0, 0, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.12) !important;
}

body .control-bar .control-btn.wm-btn:hover {
    filter: brightness(1.06);
}

body .control-bar .control-btn.wm-btn:active {
    transform: translateY(1px);
}

body .control-bar .control-btn.wm-btn i {
    font-size: 12px;
}

/* 「方法」按钮右上角的公共数量 */
body .control-bar .control-btn.wm-btn .wm-btn-num {
    display: block;
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #0b5c46;
    border: 1.5px solid #fff;
    color: #eafff7;
    font-size: 9px;
    font-weight: 900;
    line-height: 13px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 5px rgba(11, 92, 70, 0.35);
    pointer-events: none;
    z-index: 2;
}

body .control-bar .control-btn.wm-btn .wm-btn-num:empty {
    display: none;
}

/* ---------- 遮罩 ---------- */
.wm-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(20, 28, 52, 0.5);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.26s ease, visibility 0.26s ease;
}

.wm-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ---------- 弹窗主体 ---------- */
.wm-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 540px;
    max-height: 88vh;
    background: #ffffff;
    border-radius: 28px;
    box-shadow:
        0 30px 70px -18px rgba(16, 27, 58, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.9) inset;
    overflow: hidden;
    transform: translateY(22px) scale(0.96);
    transition: transform 0.34s cubic-bezier(0.34, 1.5, 0.64, 1);
}

.wm-overlay.active .wm-modal {
    transform: none;
}

/* ---------- 弹窗统一水印「词老大英语」 ---------- */
.wm-modal::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='120'%3E%3Ctext x='44' y='30' text-anchor='middle' transform='rotate(-22 44 30)' font-family='-apple-system, PingFang SC, Microsoft YaHei, sans-serif' font-size='14' font-weight='600' fill='%230E1A31' fill-opacity='0.055'%3E%E8%AF%8D%E8%80%81%E5%A4%A7%E8%8B%B1%E8%AF%AD%3C/text%3E%3Ctext x='129' y='91' text-anchor='middle' transform='rotate(-22 129 91)' font-family='-apple-system, PingFang SC, Microsoft YaHei, sans-serif' font-size='14' font-weight='600' fill='%230E1A31' fill-opacity='0.055'%3E%E8%AF%8D%E8%80%81%E5%A4%A7%E8%8B%B1%E8%AF%AD%3C/text%3E%3C/svg%3E");
    background-size: 170px 120px;
}

/* ---------- 头部 ---------- */
.wm-head {
    position: relative;
    flex: none;
    padding: 20px 22px 16px;
    background:
        radial-gradient(120px 90px at 88% 0%, rgba(255, 209, 102, 0.28), transparent 70%),
        radial-gradient(160px 120px at 0% 100%, rgba(79, 142, 247, 0.12), transparent 70%),
        linear-gradient(135deg, #fffaf0 0%, #f6fbff 100%);
    border-bottom: 1px solid #eef2fa;
}

/* 顶部一条渐变细线 */
.wm-head::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffd166, #7fd4ff 50%, #3fd6a4);
}

.wm-word {
    padding-right: 44px;
    font-size: 30px;
    font-weight: 900;
    line-height: 1.15;
    color: #16224a;
    letter-spacing: 0.2px;
    word-break: break-word;
}

.wm-title-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    min-height: 24px;
}

/* 音标：/.../ 胶囊 */
.wm-phonetic {
    flex: none;
    padding: 3px 11px;
    border-radius: 999px;
    background: rgba(79, 142, 247, 0.1);
    border: 1px solid rgba(79, 142, 247, 0.18);
    color: #3a6fd0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.4;
}

/* 发音按钮：直接复用单词卡的 dict.png 图标 */
.wm-sound {
    flex: none;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.wm-sound-icon {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.wm-sound:hover {
    transform: scale(1.06);
}

.wm-sound:active {
    transform: scale(0.94);
}

.wm-sound.is-playing {
    animation: wm-sound-beat 0.55s ease-in-out infinite alternate;
}

@keyframes wm-sound-beat {
    from { transform: scale(0.9); }
    to { transform: scale(1.06); }
}

/* 中文意思 */
.wm-trans {
    flex: 1 1 auto;
    min-width: 0;
    color: #4d5c85;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
}

.wm-total {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #fff3d6;
    color: #9a6b10;
    font-size: 11.5px;
    font-weight: 800;
}

.wm-total:empty {
    display: none;
}

/* 关闭 */
.wm-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(24, 38, 74, 0.12);
    color: #6b7a9e;
    font-size: 21px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    z-index: 2;
}

.wm-close:hover {
    background: #fff;
    transform: rotate(90deg);
}

/* ---------- 列表 ---------- */
.wm-list {
    flex: 1;
    min-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px 14px;
    background: linear-gradient(180deg, #f8faff 0%, #f3f6ff 100%);
}

.wm-list::-webkit-scrollbar {
    width: 7px;
    height: 0;
}

.wm-list::-webkit-scrollbar-thumb {
    background: rgba(79, 142, 247, 0.22);
    border-radius: 4px;
}

.wm-list::-webkit-scrollbar-track {
    background: transparent;
}

.wm-item {
    position: relative;
    margin-bottom: 10px;
    padding: 12px 14px 10px;
    background: #ffffff;
    border: 1px solid #eaeffa;
    border-radius: 16px;
    box-shadow: 0 4px 14px -6px rgba(31, 52, 104, 0.16);
    animation: wmItemIn 0.28s ease both;
}

@keyframes wmItemIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.wm-item:last-child {
    margin-bottom: 0;
}

.wm-item.is-mine {
    border-color: #ffd98f;
    background: linear-gradient(180deg, #fffdf7 0%, #fff8e6 100%);
    box-shadow: 0 6px 16px -8px rgba(214, 152, 24, 0.35);
}

/* 头像 / 昵称 / 时间 */
.wm-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wm-avatar {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: #eef2fb;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #e6ecf8, 0 3px 8px rgba(31, 52, 104, 0.12);
}

.wm-meta {
    flex: 1;
    min-width: 0;
}

.wm-nick {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 800;
    color: #1d2b53;
    white-space: nowrap;
}

.wm-nick-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wm-mine {
    flex: none;
    padding: 0 7px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffe7a8, #ffcf5c);
    color: #7a4b00;
    font-size: 9.5px;
    font-weight: 900;
    letter-spacing: 0.3px;
}

.wm-time {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: 10.5px;
    color: #93a0c0;
}

.wm-time i {
    font-size: 9.5px;
}

/* 正文 */
.wm-content {
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 12px;
    background: #f5f9ff;
    font-size: 14.5px;
    line-height: 1.72;
    color: #33405f;
    white-space: pre-wrap;
    word-break: break-word;
}

.wm-item.is-mine .wm-content {
    background: #fff8e7;
}

/* 赞 / 踩 */
.wm-votes {
    display: flex;
    gap: 8px;
    margin-top: 11px;
}

.wm-vote {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 56px;
    justify-content: center;
    padding: 6px 13px;
    border: 1px solid #e5ecf9;
    border-radius: 999px;
    background: #f7faff;
    color: #78859f;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease,
        color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
    -webkit-tap-highlight-color: transparent;
}

.wm-vote:hover {
    background: #eef4ff;
    border-color: #cfdcf5;
}

.wm-vote .wm-vote-num {
    font-variant-numeric: tabular-nums;
}

.wm-vote.up.on {
    background: linear-gradient(180deg, #d6fbec, #a8f0d2);
    border-color: #6fdcb2;
    color: #0c6b4e;
    box-shadow: 0 3px 9px -3px rgba(34, 201, 147, 0.5);
}

.wm-vote.down.on {
    background: linear-gradient(180deg, #ffe4df, #ffc7bd);
    border-color: #ff9c8d;
    color: #9c3b2c;
    box-shadow: 0 3px 9px -3px rgba(255, 107, 94, 0.45);
}

.wm-vote:active {
    transform: scale(0.94);
}

/* 赞 / 踩：点击动效 */
@keyframes wmVotePop {
    0% { transform: scale(1); }
    35% { transform: scale(1.18); }
    62% { transform: scale(0.94); }
    100% { transform: scale(1); }
}

@keyframes wmThumbPop {
    0% { transform: rotate(0) scale(1); }
    35% { transform: rotate(-20deg) scale(1.35); }
    65% { transform: rotate(10deg) scale(1.1); }
    100% { transform: rotate(0) scale(1); }
}

@keyframes wmVoteRing {
    0% { opacity: 0.55; transform: scale(0.9); }
    100% { opacity: 0; transform: scale(1.4); }
}

@keyframes wmVoteFloat {
    0% { opacity: 0; transform: translate(-50%, 2px) scale(0.7); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -30px) scale(1.15); }
}

.wm-vote.is-pop {
    animation: wmVotePop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wm-vote.is-pop i {
    animation: wmThumbPop 0.46s ease;
}

.wm-vote.is-pop::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 999px;
    border: 2px solid currentColor;
    pointer-events: none;
    animation: wmVoteRing 0.5s ease-out forwards;
}

.wm-vote-float {
    position: absolute;
    top: -4px;
    left: 50%;
    z-index: 3;
    padding: 1px 6px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(31, 52, 104, 0.18);
    font-size: 10.5px;
    font-weight: 900;
    line-height: 1.3;
    white-space: nowrap;
    pointer-events: none;
    animation: wmVoteFloat 0.72s ease-out forwards;
}

.wm-vote.up .wm-vote-float {
    color: #0c6b4e;
}

.wm-vote.down .wm-vote-float {
    color: #b3402f;
}

/* ---------- 空态 / 加载 ---------- */
.wm-loading,
.wm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 34px 16px;
    text-align: center;
    color: #93a0c0;
    font-size: 13px;
}

.wm-loading i {
    margin-right: 6px;
    color: #7fa8f0;
}

.wm-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: linear-gradient(160deg, #fff6da, #ffe9a8);
    box-shadow: 0 8px 18px -8px rgba(214, 152, 24, 0.5),
        inset 0 1px 0 #fff;
    color: #e0a21a;
    font-size: 26px;
}

.wm-empty-title {
    margin: 0;
    font-size: 14.5px;
    font-weight: 800;
    color: #46547a;
}

.wm-empty-sub {
    margin: 6px 0 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: #9aa6c2;
}

.wm-empty p {
    margin: 0;
}

.wm-retry {
    margin-top: 14px;
    padding: 8px 20px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffd97a, #ffc23d);
    color: #7a4b00;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 3px 8px -2px rgba(214, 152, 24, 0.5);
}

/* ---------- 底部输入区 ---------- */
.wm-compose {
    flex: none;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    border-top: 1px solid #eef2fa;
    box-shadow: 0 -8px 20px -16px rgba(31, 52, 104, 0.35);
}

.wm-form textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 48px;
    min-height: 48px;
    max-height: 96px;
    padding: 7px 10px;
    border: 1.5px solid #dfe8f8;
    border-radius: 14px;
    background: #f9fbff;
    color: #2d3a58;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    resize: none;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    overflow-y: auto;
}

.wm-form textarea::placeholder {
    color: #a8b4cc;
}

.wm-form textarea:focus {
    background: #fff;
    border-color: #8ab6ff;
    box-shadow: 0 0 0 4px rgba(79, 142, 247, 0.14);
}

/* AI 灵感 */
.wm-ai {
    margin-bottom: 6px;
    padding: 6px 9px 5px;
    border: 1px solid #dbe8ff;
    border-radius: 12px;
    background: linear-gradient(180deg, #f6faff, #eef5ff);
}
.wm-ai-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.wm-ai-pet {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}
.wm-ai-avatar-wrap {
    position: relative;
    width: 26px;
    height: 26px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wm-ai-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 8%;
    background: #eafff7;
    box-shadow: 0 0 0 1.5px #bff0df, 0 2px 6px rgba(11, 143, 106, 0.18);
    transition: transform 0.2s ease;
}
.wm-ai-tech {
    position: absolute;
    inset: -4px;
    border: 1.5px dashed rgba(63, 214, 164, 0.7);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.wm-ai-sparks {
    position: absolute;
    inset: -6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.wm-ai-sparks i {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #3fd6a4;
    box-shadow: 0 0 8px rgba(63, 214, 164, 0.85);
    animation: wmSpark 1.2s ease-in-out infinite;
}
.wm-ai-sparks i:nth-child(1) { left: -2px; top: 2px; animation-delay: 0s; }
.wm-ai-sparks i:nth-child(2) { right: -3px; top: 10px; animation-delay: 0.2s; }
.wm-ai-sparks i:nth-child(3) { left: 10px; bottom: -3px; animation-delay: 0.4s; }
.wm-ai-pet.is-thinking .wm-ai-tech {
    opacity: 1;
    animation: wmTechSpin 1.5s linear infinite;
}
.wm-ai-pet.is-thinking .wm-ai-avatar {
    animation: wmPetThink 1.2s ease-in-out infinite;
}
.wm-ai-pet.is-thinking .wm-ai-sparks,
.wm-ai-pet.is-happy .wm-ai-sparks {
    opacity: 1;
}
.wm-ai-pet.is-happy .wm-ai-avatar {
    animation: wmPetHappy 0.5s ease 3;
}
.wm-ai-pet.is-sad .wm-ai-avatar {
    animation: wmPetSad 0.4s ease 2;
}
@keyframes wmTechSpin { to { transform: rotate(360deg); } }
@keyframes wmPetThink {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-2px) scale(1.06); }
}
@keyframes wmPetHappy {
    0%, 100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-5px) scale(1.12) rotate(-4deg); }
    70% { transform: translateY(0) scale(1.04) rotate(3deg); }
}
@keyframes wmPetSad {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px) rotate(-3deg); }
    75% { transform: translateX(2px) rotate(3deg); }
}
@keyframes wmSpark {
    0%, 100% { opacity: 0.35; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.15); }
}
.wm-ai-copy {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 800;
    color: #2b4a7a;
    white-space: nowrap;
}
.wm-ai-name {
    display: inline-block;
    padding: 0 5px;
    border-radius: 6px;
    background: linear-gradient(180deg, #e9fff8, #c9f7e6);
    color: #0b8f6a;
    font-weight: 900;
    letter-spacing: 0.5px;
    box-shadow: inset 0 -2px 0 rgba(11, 143, 106, 0.12);
}
.wm-ai-tip {
    flex: none;
    margin-left: auto;
    font-size: 10px;
    color: #8a9ab8;
    white-space: nowrap;
}
.wm-ai-chips {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 0;
}
.wm-ai-chip {
    padding: 3px 8px;
    border: 1px solid #d7e5ff;
    border-radius: 999px;
    background: #fff;
    color: #2456df;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.wm-ai-chip:hover {
    border-color: #9fc3ff;
    background: #f0f7ff;
}
.wm-ai-chip:active {
    transform: translateY(1px);
}
.wm-ai-chip.is-active {
    border-color: #2f8df0;
    background: linear-gradient(180deg, #6cb8ff, #2f8df0);
    color: #fff;
    box-shadow: 0 4px 10px -4px rgba(47, 141, 240, 0.65);
}
.wm-ai-chip:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}
.wm-ai-status {
    margin-top: 4px;
    font-size: 10.5px;
    line-height: 1.4;
    color: #6b7a99;
}
.wm-ai-status:empty {
    display: none;
}
.wm-ai-status.is-error {
    color: #d9534f;
}
.wm-ai-status.is-loading::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 5px;
    border: 2px solid #b9d4ff;
    border-top-color: #2f8df0;
    border-radius: 50%;
    vertical-align: -1px;
    animation: wm-ai-spin 0.8s linear infinite;
}
@keyframes wm-ai-spin {
    to { transform: rotate(360deg); }
}

.wm-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
}

.wm-counter {
    font-size: 10.5px;
    color: #9aa6c2;
    font-variant-numeric: tabular-nums;
}

.wm-submit {
    padding: 7px 18px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(180deg, #6cb8ff, #2f8df0);
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.4px;
    cursor: pointer;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.55),
        0 5px 12px -4px rgba(47, 141, 240, 0.6);
    transition: filter 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.wm-submit:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.wm-submit:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.4),
        0 2px 6px -3px rgba(47, 141, 240, 0.5);
}

.wm-submit:disabled {
    opacity: 0.62;
    cursor: default;
    transform: none;
    filter: none;
}

.wm-login-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: #6e7c9e;
}

/* ---------- 提示 ---------- */
.wm-toast {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -6px);
    max-width: 80vw;
    padding: 11px 22px;
    border-radius: 999px;
    background: rgba(24, 34, 58, 0.88);
    color: #fff;
    font-size: 13.5px;
    text-align: center;
    z-index: 100002;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.wm-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- 头部：消息铃铛 ---------- */
.wm-word {
    padding-right: 100px;
}

.wm-bell {
    position: absolute;
    top: 14px;
    right: 56px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(24, 38, 74, 0.12);
    color: #6b7a9e;
    font-size: 15px;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    z-index: 2;
}

.wm-bell:hover {
    background: #fff;
    color: #3a6fd0;
}

.wm-bell.has-news {
    color: #e0563f;
}

.wm-bell-num {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff5a4e;
    color: #fff;
    font-size: 9.5px;
    font-weight: 900;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.wm-bell-num:empty,
.wm-bell-num[style*="display: none"] {
    display: none !important;
}

/* 卡片按钮上的新消息小红点 */
body .control-bar .control-btn.wm-btn {
    position: relative;
}

body .control-bar .control-btn.wm-btn.wm-btn--news::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 6px;
    right: auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff4d4f;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

/* ---------- 条目操作（回复 / 编辑 / 删除） ---------- */
.wm-acts {
    flex: none;
    display: flex;
    align-items: center;
    gap: 2px;
}

.wm-act {
    padding: 3px 7px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #8391b4;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.wm-act:hover {
    background: #eef4ff;
    color: #3a6fd0;
}

.wm-act.danger:hover {
    background: #ffece9;
    color: #d9534f;
}

.wm-act.primary {
    padding: 5px 14px;
    background: linear-gradient(180deg, #6cb8ff, #2f8df0);
    color: #fff;
    box-shadow: 0 3px 8px -3px rgba(47, 141, 240, 0.6);
}

.wm-act.primary:hover {
    color: #fff;
    filter: brightness(1.05);
}

/* ---------- 回复引用 ---------- */
.wm-reply-to {
    margin-top: 8px;
    font-size: 11.5px;
    color: #8b98b8;
}

.wm-reply-to b {
    color: #3a6fd0;
    font-weight: 800;
}

/* ---------- 回复列表 ---------- */
.wm-replies {
    margin: -2px 0 8px 10px;
    padding-left: 12px;
    border-left: 2px dashed #dfe8f8;
}

.wm-item--reply {
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 16px;
    background: #fbfcff;
    border-color: #eef2fa;
    box-shadow: none;
}

.wm-item--reply .wm-avatar {
    width: 24px;
    height: 24px;
}

.wm-item--reply .wm-nick {
    font-size: 11.5px;
}

.wm-item--reply .wm-time {
    font-size: 10px;
}

.wm-item--reply .wm-content {
    margin-top: 7px;
    padding: 7px 9px;
    border-radius: 10px;
    background: #f1f6ff;
    font-size: 13px;
    line-height: 1.65;
}

.wm-item--reply .wm-votes {
    margin-top: 8px;
}

.wm-item--reply .wm-vote {
    min-width: 46px;
    padding: 4px 10px;
    font-size: 11px;
}

/* ---------- 行内编辑 ---------- */
.wm-editor {
    margin-top: 10px;
}

.wm-editor textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 68px;
    padding: 10px 12px;
    border: 1.5px solid #8ab6ff;
    border-radius: 14px;
    background: #fff;
    color: #2d3a58;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    resize: none;
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 142, 247, 0.12);
}

.wm-editor-foot {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
}

/* ---------- 回复栏 ---------- */
.wm-reply-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
    padding: 7px 12px;
    border-radius: 12px;
    background: #eef5ff;
    color: #4a6b9e;
    font-size: 12px;
}

.wm-reply-bar b {
    color: #2f6fd0;
    font-weight: 800;
}

.wm-reply-bar button {
    padding: 2px 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #8391b4;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

.wm-reply-bar button:hover {
    background: rgba(79, 142, 247, 0.12);
    color: #3a6fd0;
}

/* ---------- 消息面板 ---------- */
.wm-notices {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    background: #f8faff;
    z-index: 4;
}

.wm-notices.active {
    display: flex;
}

.wm-notices-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #eef2fa;
}

.wm-notices-title {
    flex: 1;
    font-size: 14px;
    font-weight: 900;
    color: #1d2b53;
}

.wm-notices-back {
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f1f5ff;
    color: #58709e;
    font-size: 12px;
    cursor: pointer;
}

.wm-notices-back:hover {
    background: #e6eeff;
}

.wm-notices-readall {
    padding: 4px 10px;
    border: none;
    border-radius: 999px;
    background: #eef4ff;
    color: #3a6fd0;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
}

.wm-notices-readall:hover {
    background: #e0ebff;
}

.wm-notices-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    background: linear-gradient(180deg, #f8faff 0%, #f3f6ff 100%);
}

.wm-notices-list::-webkit-scrollbar {
    width: 7px;
    height: 0;
}

.wm-notices-list::-webkit-scrollbar-thumb {
    background: rgba(79, 142, 247, 0.22);
    border-radius: 4px;
}

.wm-notice {
    position: relative;
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 9px;
    padding: 11px 12px;
    border: 1px solid #eef2fa;
    border-radius: 16px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.wm-notice:hover {
    border-color: #d9e5fb;
}

.wm-notice.unread {
    background: #fffdf4;
    border-color: #ffe2a8;
}

.wm-notice-body {
    flex: 1;
    min-width: 0;
}

.wm-notice-line {
    font-size: 12.5px;
    line-height: 1.5;
    color: #3b4a6b;
}

.wm-notice-line b {
    color: #16224a;
    font-weight: 800;
}

.wm-notice-line i {
    margin-right: 3px;
    color: #7fa8f0;
    font-size: 11px;
}

.wm-notice-word {
    display: inline-block;
    margin-top: 5px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #eef4ff;
    color: #3a6fd0;
    font-size: 10.5px;
    font-weight: 800;
}

.wm-notice-snippet {
    display: -webkit-box;
    margin-top: 5px;
    overflow: hidden;
    color: #8b98b8;
    font-size: 11.5px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wm-notice-time {
    margin-top: 4px;
    color: #aab4cc;
    font-size: 10px;
}

.wm-notice-dot {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff5a4e;
}

/* ---------- 移动端 ---------- */
@media (max-width: 600px) {
    .wm-overlay {
        padding: 12px;
    }

    .wm-modal {
        width: 100%;
        max-width: 540px;
        max-height: 90vh;
        border-radius: 24px;
    }

    .wm-head {
        padding: 17px 18px 14px;
    }

    .wm-word {
        padding-right: 95px;
        font-size: 25px;
    }

    .wm-trans {
        font-size: 13px;
    }

    .wm-list {
        padding: 13px 13px 15px;
    }

    .wm-item {
        padding: 13px 13px 11px;
        border-radius: 18px;
    }
}

@media (max-width: 380px) {
    body .control-bar .control-btn.wm-btn {
        padding: 0 9px;
    }

    /* 极窄屏先藏图标，保证五颗按钮仍在一排 */
    body .control-bar .control-btn.wm-btn i {
        display: none;
    }

    .wm-word {
        font-size: 22px;
    }

    .wm-phonetic {
        font-size: 12.5px;
    }
}

/* ---------- 小屏：整体缩小（全部用固定值，避免大字挤压） ---------- */
@media (max-width: 420px) {
    .wm-overlay {
        padding: 6px;
    }

    .wm-modal {
        border-radius: 18px;
        max-height: 94vh;
    }

    .wm-head {
        padding: 13px 13px 10px;
    }

    .wm-head::before {
        height: 3px;
    }

    .wm-word {
        padding-right: 74px;
        font-size: 21px;
        line-height: 1.2;
    }

    .wm-title-sub {
        margin-top: 7px;
        gap: 6px;
    }

    .wm-phonetic {
        padding: 2px 8px;
        font-size: 11.5px;
    }

    .wm-sound {
        width: 24px;
        height: 24px;
    }

    .wm-trans {
        font-size: 11.5px;
        line-height: 1.45;
    }

    .wm-total {
        padding: 1px 8px;
        font-size: 10px;
    }

    .wm-close {
        top: 9px;
        right: 9px;
        width: 30px;
        height: 30px;
        font-size: 18px;
        line-height: 28px;
    }

    .wm-bell {
        top: 9px;
        right: 44px;
        width: 30px;
        height: 30px;
        font-size: 13px;
        line-height: 30px;
    }

    .wm-bell-num {
        min-width: 15px;
        height: 15px;
        font-size: 9px;
        line-height: 15px;
    }

    .wm-list {
        padding: 9px 9px 11px;
    }

    .wm-item {
        margin-bottom: 8px;
        padding: 9px 10px 8px;
        border-radius: 14px;
    }

    .wm-item-head {
        gap: 7px;
    }

    .wm-avatar {
        width: 26px;
        height: 26px;
    }

    .wm-nick {
        gap: 4px;
        font-size: 11.5px;
    }

    .wm-mine {
        padding: 0 5px;
        font-size: 9px;
    }

    .wm-time {
        margin-top: 1px;
        font-size: 9.5px;
    }

    .wm-acts {
        gap: 0;
    }

    .wm-act {
        padding: 2px 4px;
        border-radius: 6px;
        font-size: 10px;
    }

    .wm-content {
        margin-top: 8px;
        padding: 7px 9px;
        border-radius: 10px;
        font-size: 12.5px;
        line-height: 1.62;
    }

    .wm-votes {
        gap: 6px;
        margin-top: 8px;
    }

    .wm-vote {
        min-width: 44px;
        gap: 4px;
        padding: 4px 8px;
        font-size: 10.5px;
    }

    .wm-vote i {
        font-size: 10px;
    }

    .wm-replies {
        margin-left: 6px;
        padding-left: 8px;
    }

    .wm-item--reply {
        padding: 8px 9px;
        border-radius: 12px;
    }

    .wm-item--reply .wm-avatar {
        width: 21px;
        height: 21px;
    }

    .wm-item--reply .wm-nick {
        font-size: 10.5px;
    }

    .wm-item--reply .wm-content {
        padding: 6px 8px;
        font-size: 12px;
    }

    .wm-item--reply .wm-vote {
        min-width: 38px;
        padding: 3px 7px;
        font-size: 10px;
    }

    .wm-reply-to {
        margin-top: 6px;
        font-size: 10.5px;
    }

    .wm-compose {
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .wm-form textarea {
        height: 48px;
        min-height: 48px;
        max-height: 84px;
        padding: 7px 10px;
        border-radius: 12px;
        font-size: 16px;
        line-height: 1.45;
    }

    .wm-ai {
        padding: 6px 8px 5px;
        border-radius: 12px;
    }

    .wm-ai-copy {
        font-size: 11px;
    }

    .wm-ai-tip {
        display: none;
    }

    .wm-ai-chips {
        gap: 4px;
    }

    .wm-ai-chip {
        padding: 3px 7px;
        font-size: 10.5px;
    }

    .wm-ai-status {
        font-size: 10px;
    }

    .wm-ai-avatar-wrap,
    .wm-ai-avatar {
        width: 24px;
        height: 24px;
    }

    .wm-ai-name {
        padding: 0 4px;
    }

    .wm-ai-chip {
        padding: 4px 9px;
        font-size: 11.5px;
    }

    .wm-ai-status {
        font-size: 11px;
    }

    .wm-form-foot {
        margin-top: 7px;
    }

    .wm-counter {
        font-size: 10px;
    }

    .wm-submit {
        padding: 8px 18px;
        font-size: 12px;
    }

    .wm-login-box {
        font-size: 11.5px;
    }

    .wm-reply-bar {
        margin-bottom: 7px;
        padding: 6px 10px;
        font-size: 11px;
    }

    .wm-empty {
        padding: 26px 12px;
    }

    .wm-empty-icon {
        width: 52px;
        height: 52px;
        margin-bottom: 10px;
        font-size: 21px;
    }

    .wm-empty-title {
        font-size: 13px;
    }

    .wm-empty-sub {
        font-size: 11.5px;
    }

    .wm-notices-head {
        padding: 10px 12px;
    }

    .wm-notices-title {
        font-size: 13px;
    }

    .wm-notice {
        padding: 9px 10px;
        border-radius: 13px;
    }

    .wm-notice-line {
        font-size: 11.5px;
    }

    .wm-notice-snippet {
        font-size: 11px;
    }
}
