/* ========================================
   单词PK系统 - 样式
   ======================================== */

/* ---------- PK 按钮 ---------- */
.pk-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    background: #000000;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
}

.pk-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.pk-btn:active {
    transform: scale(0.96);
}

.pk-btn i {
    font-size: 16px;
}

/* 闪光动画 - 从左到右扫过 */
.pk-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 40%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.3) 60%,
        transparent 100%
    );
    transform: skewX(-25deg);
    animation: pk-shine 2.5s infinite ease-in-out;
}

@keyframes pk-shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 150%;
    }
}

/* 脉冲闪烁效果 */
.pk-btn.pulse {
    animation: pk-pulse 2s infinite;
}

@keyframes pk-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 8px rgba(255, 215, 0, 0);
    }
}

/* ---------- PK 模态框 ---------- */
.pk-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.pk-modal {
    position: relative;
    width: 92%;
    max-width: 480px;
    max-height: 85vh;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pk-modal-overlay.active .pk-modal {
    transform: scale(1) translateY(0);
}

/* 关闭按钮：它永远压在深色的 .pk-header 上，所以必须走「浅磨砂圆 + 白图标」。
   ⚠️ 别再用深灰图标 / 深色半透明底 —— 在 header 渐变上只有 ~2.7:1，根本看不清。
   白图标压 rgba(255,255,255,.22) 叠深蓝实测 9.1:1（图形要求 3:1）。 */
.pk-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    font-size: 18px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.pk-modal-close:hover {
    background: rgba(255, 255, 255, 0.38);
}

.pk-modal-close:active {
    transform: scale(0.92);
}

.pk-modal-close:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* ---------- PK 头部 - 单词展示 ---------- */
.pk-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 30px 20px 25px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

.pk-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(0, 200, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.pk-word {
    font-size: 36px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.pk-phonetic {
    font-size: 16px;
    color: #aaa;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.pk-pos {
    display: inline-block;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 10px;
    border-radius: 10px;
    margin-right: 6px;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.pk-translation {
    font-size: 15px;
    color: #ddd;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.pk-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    z-index: 1;
}

.pk-play-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ---------- 录音区域 ---------- */
.pk-record-section {
    padding: 20px;
    background: #f8f9fa;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    max-height: 500px;
    overflow: hidden;
    opacity: 1;
}

/* 录音区折叠状态 */
.pk-record-section.pk-collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* 录音区不参与 flex 压缩，确保按钮不被遮挡 */
.pk-record-section:not(.pk-collapsed) {
    flex-shrink: 0;
}

.pk-record-btn {
    position: relative;              /* 录音涟漪的定位基准（见下） */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(238, 90, 90, 0.4);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.pk-record-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(238, 90, 90, 0.5);
}

.pk-record-btn:active {
    transform: scale(0.95);
}

.pk-record-btn:focus-visible {
    outline: 3px solid #1d2b53;
    outline-offset: 4px;
}

/* ---------- 录音中：涟漪 + 呼吸（不要方块 stop 图标） ----------
   ⚠️ 涟漪必须画在 ::before / ::after 上，不能画在按钮本体的 box-shadow 上。
   原因：phonetics.html 的皮肤写了 `.pk-modal .pk-record-btn{ box-shadow:…!important }`，
   而 @keyframes 里的声明优先级低于任何 `!important` 声明 —— 原来的 pk-record-pulse
   （动 box-shadow）就是这样被整条干掉的，录音时只剩变色、完全没动画。
   伪元素不被那条规则命中，动画因此永远有效。
   同理：图标保持麦克风，换成 `fa-stop` 会得到一个白色方块（「方头方脑」的来源）。 */
.pk-record-btn.recording {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    box-shadow: 0 4px 15px rgba(81, 207, 102, 0.4);
}

.pk-record-btn.recording::before,
.pk-record-btn.recording::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(64, 192, 87, 0.65);
    pointer-events: none;
    animation: pk-rec-ripple 1.8s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}

.pk-record-btn.recording::after {
    animation-delay: 0.9s;
}

@keyframes pk-rec-ripple {
    /* 收在 1.5 倍并把透明度提前压掉：环最大只探出按钮 25px，
       而计时器与按钮之间留了 20px —— 环不会从「00:07」上横穿过去。 */
    0%   { transform: scale(1);    opacity: 0.9; }
    60%  { transform: scale(1.28); opacity: 0.28; }
    100% { transform: scale(1.5);  opacity: 0; }
}

/* 麦克风呼吸，替代原来的方块 stop */
.pk-record-btn.recording i {
    animation: pk-rec-breathe 1.4s ease-in-out infinite;
}

@keyframes pk-rec-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.18); }
}

/* 计时器闪烁，让「正在录音」这件事在视觉上一直有动静 */
.pk-record-section.is-recording .pk-record-timer {
    color: #e03131;
    animation: pk-timer-blink 1.2s ease-in-out infinite;
}

@keyframes pk-timer-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
    .pk-record-btn.recording::before,
    .pk-record-btn.recording::after,
    .pk-record-btn.recording i,
    .pk-record-section.is-recording .pk-record-timer { animation: none; }
    .pk-record-btn.recording::before,
    .pk-record-btn.recording::after { opacity: 0.5; transform: scale(1.12); }
}

.pk-record-btn i {
    font-size: 32px;
}

.pk-record-btn span {
    font-size: 12px;
    font-weight: 500;
}

.pk-record-timer {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    /* 20px（原 12px）：给录音涟漪环留出扩散空间，环不横穿计时器文字 */
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.pk-record-tip {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
}

/* 录音操作按钮组 */
.pk-record-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.pk-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 18px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.pk-action-btn:active {
    transform: scale(0.96);
}

.pk-action-btn.secondary {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.pk-action-btn.secondary:hover {
    background: #f5f5f5;
}

.pk-action-btn.primary {
    background: linear-gradient(135deg, #339af0 0%, #228be6 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(34, 139, 230, 0.3);
}

.pk-action-btn.primary:hover {
    box-shadow: 0 4px 12px rgba(34, 139, 230, 0.4);
}

.pk-action-btn.success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(64, 192, 87, 0.3);
}

.pk-action-btn.success:hover {
    box-shadow: 0 4px 12px rgba(64, 192, 87, 0.4);
}

.pk-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 上传进度 */
.pk-upload-progress {
    margin-top: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    display: none;
}

.pk-upload-progress.active {
    display: block;
}

.pk-upload-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.pk-upload-fill {
    height: 100%;
    background: linear-gradient(90deg, #339af0, #51cf66);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.pk-upload-text {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* ---------- 排行榜 ---------- */
.pk-ranking-section {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px 20px;
    min-height: 0;
}

.pk-ranking-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pk-ranking-title h3 {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pk-ranking-title h3 i {
    color: #ffd43b;
}

.pk-ranking-count {
    font-size: 12px;
    color: #999;
}

/* "我也要PK" 按钮 */
.pk-join-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ff922b 0%, #fa5252 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(250, 82, 82, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    animation: pk-join-glow 2s ease-in-out infinite;
}

.pk-join-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(250, 82, 82, 0.4);
}

.pk-join-btn:active {
    transform: scale(0.97);
}

@keyframes pk-join-glow {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(250, 82, 82, 0.3);
    }
    50% {
        box-shadow: 0 2px 16px rgba(250, 82, 82, 0.6);
    }
}

/* 录音按钮高亮动画 */
.pk-record-btn.pk-highlight {
    animation: pk-highlight-pulse 0.6s ease-in-out 3;
}

@keyframes pk-highlight-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(238, 90, 90, 0.4), 0 0 0 0 rgba(255, 210, 63, 0.6);
    }
    50% {
        box-shadow: 0 4px 15px rgba(238, 90, 90, 0.4), 0 0 0 12px rgba(255, 210, 63, 0);
    }
}

.pk-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pk-rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pk-rank-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 排名数字 */
.pk-rank-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #999;
    background: #f1f3f5;
    border-radius: 50%;
    flex-shrink: 0;
}

/* 前三名特殊样式 */
.pk-rank-item.rank-1 {
    background: linear-gradient(135deg, #fff9db 0%, #fff3bf 100%);
    border: 2px solid #ffd43b;
    box-shadow: 0 2px 12px rgba(255, 212, 59, 0.3);
}

.pk-rank-item.rank-1 .pk-rank-num {
    background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(255, 176, 5, 0.4);
}

.pk-rank-item.rank-2 {
    background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%);
    border: 2px solid #adb5bd;
    box-shadow: 0 2px 12px rgba(173, 181, 189, 0.3);
}

.pk-rank-item.rank-2 .pk-rank-num {
    background: linear-gradient(135deg, #ced4da 0%, #adb5bd 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(173, 181, 189, 0.4);
}

.pk-rank-item.rank-3 {
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8cc 100%);
    border: 2px solid #ff922b;
    box-shadow: 0 2px 12px rgba(255, 146, 43, 0.3);
}

.pk-rank-item.rank-3 .pk-rank-num {
    background: linear-gradient(135deg, #ffa94d 0%, #ff922b 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(255, 146, 43, 0.4);
}

/* 奖牌图标 —— emoji 换成内联 SVG，规则见文件末尾「PK 图标层」 */

/* 用户头像 */
.pk-rank-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #fff;
}

.pk-rank-item.rank-1 .pk-rank-avatar {
    border-color: #ffd43b;
}

.pk-rank-item.rank-2 .pk-rank-avatar {
    border-color: #adb5bd;
}

.pk-rank-item.rank-3 .pk-rank-avatar {
    border-color: #ff922b;
}

/* 用户信息 */
.pk-rank-info {
    flex: 1;
    min-width: 0;
}

.pk-rank-nickname {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pk-rank-detail {
    font-size: 11px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pk-rank-duration {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* 播放按钮 */
.pk-rank-play {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f3f5;
    border: none;
    color: #339af0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pk-rank-play:hover {
    background: #339af0;
    color: #fff;
}

.pk-rank-play.playing {
    background: #51cf66;
    color: #fff;
}

/* 点赞按钮 */
.pk-like-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.pk-like-btn:active {
    transform: scale(0.9);
}

.pk-like-btn i {
    font-size: 18px;
    color: #ccc;
    transition: all 0.2s ease;
}

.pk-like-btn.liked i {
    color: #ff6b6b;
    animation: pk-heart-pop 0.4s ease;
}

@keyframes pk-heart-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.pk-like-count {
    font-size: 11px;
    color: #999;
    font-weight: 500;
}

.pk-like-btn.liked .pk-like-count {
    color: #ff6b6b;
}

/* 点赞粒子特效 */
.pk-like-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    width: 100px;
    height: 100px;
}

.pk-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0;
    animation: pk-particle-fly 0.8s ease-out forwards;
}

@keyframes pk-particle-fly {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* 心形飞出动画 */
.pk-fly-heart {
    position: absolute;
    font-size: 16px;
    color: #ff6b6b;
    pointer-events: none;
    animation: pk-fly-heart 1s ease-out forwards;
    z-index: 10001;
}

@keyframes pk-fly-heart {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

/* 空状态 */
.pk-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.pk-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.pk-empty p {
    font-size: 14px;
    margin: 0;
}

/* 登录提示 */
.pk-login-prompt {
    padding: 15px;
    background: #fff9db;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 15px;
}

.pk-login-prompt p {
    font-size: 13px;
    color: #666;
    margin: 0 0 10px 0;
}

.pk-login-btn {
    padding: 8px 24px;
    background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(250, 176, 5, 0.3);
}

/* 数字跳动动画 */
.pk-count-bump {
    animation: pk-count-bump 0.3s ease;
}

@keyframes pk-count-bump {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* 加载状态 */
.pk-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: #999;
    font-size: 13px;
}

.pk-loading i {
    margin-right: 8px;
    animation: pk-spin 1s linear infinite;
}

@keyframes pk-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==================== 播放声波动画 ==================== */

/* 录音区试听时的均衡器动画 */
.pk-equalizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 24px;
    margin: 10px auto 0;
    width: 80px;
}

.pk-equalizer span {
    display: block;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, #339af0, #51cf66);
    border-radius: 3px;
    animation: pk-eq-bounce 0.8s ease-in-out infinite;
}

.pk-equalizer span:nth-child(1) { animation-delay: 0s; }
.pk-equalizer span:nth-child(2) { animation-delay: 0.15s; }
.pk-equalizer span:nth-child(3) { animation-delay: 0.3s; }
.pk-equalizer span:nth-child(4) { animation-delay: 0.1s; }
.pk-equalizer span:nth-child(5) { animation-delay: 0.25s; }

@keyframes pk-eq-bounce {
    0%, 100% { transform: scaleY(0.3); }
    50%      { transform: scaleY(1); }
}

/* 排行榜播放时的均衡器动画 */
.pk-rank-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    width: 18px;
    flex-shrink: 0;
}

.pk-rank-equalizer span {
    display: block;
    width: 3px;
    height: 100%;
    background: #51cf66;
    border-radius: 2px;
    animation: pk-rank-eq 0.6s ease-in-out infinite;
}

.pk-rank-equalizer span:nth-child(1) { animation-delay: 0s; }
.pk-rank-equalizer span:nth-child(2) { animation-delay: 0.2s; }
.pk-rank-equalizer span:nth-child(3) { animation-delay: 0.1s; }

@keyframes pk-rank-eq {
    0%, 100% { transform: scaleY(0.2); }
    50%      { transform: scaleY(1); }
}

/* 试听按钮 playing 状态 */
.pk-action-btn.playing {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);

    border-color: transparent;
    box-shadow: 0 2px 8px rgba(64, 192, 87, 0.4);
}

.pk-action-btn.playing i {
    animation: pk-pulse-icon 1s ease-in-out infinite;
}

@keyframes pk-pulse-icon {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

/* 响应式 */
@media (max-width: 400px) {
    .pk-word {
        font-size: 28px;
    }
    
    .pk-record-btn {
        width: 80px;
        height: 80px;
    }
    
    .pk-record-btn i {
        font-size: 26px;
    }
    
    .pk-action-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* ==================================================================
   PK 图标层 —— 内联 SVG，不依赖 Font Awesome / 网络字体
   ------------------------------------------------------------------
   背景：pk.js 输出 <i class="fas fa-*">，靠 Font Awesome 的 ::before 字形渲染。
   但只有 units/36.html 引了 FA 的 CDN，yb/qm/phonetics.html 没引 ——
   同一套 DOM 在一页有图标、在另一页整片空白（那边曾用 emoji 兜底，已移除）。
   这里统一用 mask + data-URI SVG 画出来：
     · 不依赖字体与网络，断网/被墙一样有图标
     · 颜色 = background-color:currentColor → 与按钮文字同色，对比度天然一致
     · 尺寸 = 1em，沿用各按钮原有的 font-size，不必逐个调整
   作用域严格限定在 .pk-modal / .pk-btn 内 —— 36.html 自身别处的 FA 图标不受影响。
   ================================================================== */
.pk-modal i.fa-times,
.pk-modal i.fa-volume-up,
.pk-modal i.fa-microphone,
.pk-modal i.fa-microphone-alt,
.pk-modal i.fa-microphone-alt-slash,
.pk-modal i.fa-stop,
.pk-modal i.fa-play,
.pk-modal i.fa-pause,
.pk-modal i.fa-redo,
.pk-modal i.fa-paper-plane,
.pk-modal i.fa-trophy,
.pk-modal i.fa-bolt,
.pk-modal i.fa-spinner,
.pk-modal i.far.fa-clock,
.pk-modal i.fas.fa-heart,
.pk-modal i.far.fa-heart,
.pk-modal i.fa-exclamation-circle,
.pk-modal i.fa-wifi,
.pk-btn i.fa-microphone-alt {
    display: inline-block !important;
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
    background-color: currentColor;
    /* 兜底成一张空 SVG → 万一某个图标没映射到，是「看不见」而不是「黑方块」 */
    --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'/%3E");
    -webkit-mask-image: var(--pkico);
    mask-image: var(--pkico);
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain;   mask-size: contain;
    vertical-align: -.14em;
}
/* 36.html 引了 FA：关掉它的字体字形，避免两套图标叠在一起 */
.pk-modal i[class*="fa-"]::before,
.pk-btn i[class*="fa-"]::before { content: none !important; }

/* 关闭 */
.pk-modal i.fa-times { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 6.5 17.5 17.5M17.5 6.5 6.5 17.5' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* 喇叭（#pk-play-word 实际用 dict.png，这里是没被替换时的兜底） */
.pk-modal i.fa-volume-up { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.2 9.4h3.4l5.2-4.4v14l-5.2-4.4H4.2z' fill='%23000'/%3E%3Cpath d='M15.8 8.8a4.6 4.6 0 0 1 0 6.4M18.6 6a8.4 8.4 0 0 1 0 12' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* 话筒 */
.pk-modal i.fa-microphone,
.pk-modal i.fa-microphone-alt,
.pk-btn i.fa-microphone-alt { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='9' y='2.4' width='6' height='11.4' rx='3' fill='%23000'/%3E%3Cpath d='M5.4 11.2a6.6 6.6 0 0 0 13.2 0M12 17.9v3.4M8.4 21.3h7.2' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* 无话筒（空状态） */
.pk-modal i.fa-microphone-alt-slash { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='9' y='2.4' width='6' height='11.4' rx='3' fill='%23000'/%3E%3Cpath d='M5.4 11.2a6.6 6.6 0 0 0 13.2 0M12 17.9v3.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M3.6 3.6 20.4 20.4' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* 停止 */
.pk-modal i.fa-stop { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6.2' y='6.2' width='11.6' height='11.6' rx='2.8' fill='%23000'/%3E%3C/svg%3E"); }
/* 播放 / 暂停 */
.pk-modal i.fa-play { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.2 5.2 18.6 12 8.2 18.8z' fill='%23000'/%3E%3C/svg%3E"); }
.pk-modal i.fa-pause { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6.6' y='5.2' width='4.2' height='13.6' rx='1.9' fill='%23000'/%3E%3Crect x='13.2' y='5.2' width='4.2' height='13.6' rx='1.9' fill='%23000'/%3E%3C/svg%3E"); }
/* 重录 */
.pk-modal i.fa-redo { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.2 11.6a8.2 8.2 0 1 1-2.6-6' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round'/%3E%3Cpath d='M20.4 3.4v5.4h-5.4' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
/* 提交 */
.pk-modal i.fa-paper-plane { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 3 3.4 10.4a.55.55 0 0 0 .04 1.04l6.9 2.5 2.5 6.9a.55.55 0 0 0 1.04.04z' fill='%23000'/%3E%3C/svg%3E"); }
/* 奖杯 */
.pk-modal i.fa-trophy { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 3.4h10.8v5.8a5.4 5.4 0 0 1-10.8 0z' fill='%23000'/%3E%3Cpath d='M6.6 5.2H4.1a2.9 2.9 0 0 0 2.9 2.9M17.4 5.2h2.5a2.9 2.9 0 0 1-2.9 2.9' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'/%3E%3Cpath d='M12 14.6v2.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M8 20.6h8l-.9-3.6H8.9z' fill='%23000'/%3E%3C/svg%3E"); }
/* 闪电（我也要PK） */
.pk-modal i.fa-bolt { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.6 2.2 4.6 13.8h6l-1 8 9-11.6h-6z' fill='%23000'/%3E%3C/svg%3E"); }
/* 加载中（沿用 pk.css 里的 pk-spin 旋转动画） */
.pk-modal i.fa-spinner { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.6a8.4 8.4 0 1 1-6 2.5' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* 点赞：实心 / 空心两种 */
.pk-modal i.fas.fa-heart { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.6S3.4 15.7 3.4 9.8A4.8 4.8 0 0 1 12 6.9a4.8 4.8 0 0 1 8.6 2.9c0 5.9-8.6 10.8-8.6 10.8z' fill='%23000'/%3E%3C/svg%3E"); }
.pk-modal i.far.fa-heart { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.6S3.4 15.7 3.4 9.8A4.8 4.8 0 0 1 12 6.9a4.8 4.8 0 0 1 8.6 2.9c0 5.9-8.6 10.8-8.6 10.8z' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E"); }
/* 录音时长 */
.pk-modal i.far.fa-clock { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8.6' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M12 6.9V12l3.4 2' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* 空状态：加载失败 / 断网 */
.pk-modal i.fa-exclamation-circle { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8.8' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M12 7.2v5.4' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='16.3' r='1.35' fill='%23000'/%3E%3C/svg%3E"); }
.pk-modal i.fa-wifi { --pkico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.2 8.6a13.2 13.2 0 0 1 17.6 0M6.6 12.2a8.4 8.4 0 0 1 10.8 0M9.7 15.7a3.7 3.7 0 0 1 4.6 0' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='19' r='1.5' fill='%23000'/%3E%3C/svg%3E"); }

/* 听发音按钮里的 dict.png（站点统一播放图标，由 pk.js 直接输出 <img>） */
.pk-modal .pk-ico-play { width: 20px; height: 20px; display: block; flex: 0 0 auto; }

/* 前三名奖牌：改成内联 SVG 星，颜色按名次，替掉跨平台不一致的 emoji 奖牌 */
.pk-medal {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: inline-block;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.9 6.1 6.7.8-5 4.6 1.3 6.6L12 17.4l-5.9 3.3 1.3-6.6-5-4.6 6.7-.8z' fill='%23000'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.9 6.1 6.7.8-5 4.6 1.3 6.6L12 17.4l-5.9 3.3 1.3-6.6-5-4.6 6.7-.8z' fill='%23000'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
    margin-right: -2px;
}
/* 深端实色：对各自名次底色实测 5.54 / 4.91 / 6.03:1（图形要求 3:1） */
.pk-rank-item.rank-1 .pk-medal { color: #9a5100; }
.pk-rank-item.rank-2 .pk-medal { color: #5c6b7a; }
.pk-rank-item.rank-3 .pk-medal { color: #a03d00; }
