/* ===== 电子木鱼 v2 ===== */
.wf-hero {
    position: relative;
    background: linear-gradient(160deg, #fff7ed 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: 22px;
    padding: 28px 30px 32px;
    margin-bottom: 26px;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(245, 158, 11, .12);
}

.wf-glow {
    position: absolute;
    bottom: -90px;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, .26), transparent 70%);
    pointer-events: none;
}

/* ===== 顶栏：称号 + 重置 ===== */
.wf-topbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.wf-rank {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, .65);
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    box-shadow: 0 2px 6px rgba(245, 158, 11, .12);
}

.wf-reset {
    background: transparent;
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    color: #b45309;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.wf-reset:hover {
    background: rgba(245, 158, 11, .14);
    color: #7c2d12;
}

/* ===== 功德计数 ===== */
.wf-counter {
    position: relative;
    margin-bottom: 8px;
}

.wf-count-label {
    font-size: 13px;
    color: #b45309;
    letter-spacing: 2px;
}

.wf-count {
    font-size: 66px;
    font-weight: 800;
    color: #92400e;
    line-height: 1.08;
    font-variant-numeric: tabular-nums;
}

.wf-count.pop {
    animation: wf-count-pop .22s ease;
}

@keyframes wf-count-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.14); color: #d97706; }
    100% { transform: scale(1); }
}

.wf-total {
    font-size: 13px;
    color: #d97706;
    margin-top: 2px;
}

/* ===== 敲击舞台 ===== */
.wf-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 6px 0 0;
}

.wf-combo {
    position: relative;
    min-height: 28px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #b45309;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s, transform .2s;
    font-variant-numeric: tabular-nums;
}

.wf-combo.show {
    opacity: 1;
    transform: translateY(0);
}

.wf-combo.fire {
    color: #ea580c;
    animation: wf-combo-fire .5s ease;
}

@keyframes wf-combo-fire {
    0% { transform: scale(1); }
    50% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

.wf-fish {
    position: relative;
    width: 250px;
    height: 210px;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

/* 木鱼主体（CSS 绘制：卧鱼造型 + 中央开口） */
.wf-fish-shape {
    position: absolute;
    left: 50%;
    top: 56%;
    width: 196px;
    height: 148px;
    transform: translate(-50%, -50%);
    border-radius: 52% 48% 45% 55% / 52% 52% 44% 48%;
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .28), transparent 42%),
        radial-gradient(ellipse at 40% 30%, #f59e0b, #b45309 58%, #92400e);
    box-shadow:
        inset 0 -10px 18px rgba(120, 53, 15, .35),
        inset 0 8px 12px rgba(255, 236, 179, .35),
        0 16px 30px rgba(146, 64, 14, .28);
    transition: transform .09s;
}

/* 中央开口 */
.wf-fish-shape::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 10px;
    width: 7px;
    height: 58px;
    transform: translateX(-50%);
    border-radius: 7px;
    background: rgba(69, 26, 3, .6);
    box-shadow: 0 0 0 3px rgba(255, 236, 179, .4);
}

/* 鱼头凸起（右） */
.wf-fish-shape::before {
    content: '';
    position: absolute;
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle at 62% 38%, #f59e0b, #a1440d);
    box-shadow: inset -4px -6px 10px rgba(120, 53, 15, .4);
}

/* 底座阴影 */
.wf-base {
    position: absolute;
    left: 50%;
    top: 76%;
    width: 210px;
    height: 30px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(146, 64, 14, .22), transparent 70%);
    pointer-events: none;
}

.wf-fish.hit .wf-fish-shape {
    transform: translate(-50%, -50%) scale(.95) translateY(4px);
}

.wf-fish.hit .wf-base {
    transform: translateX(-50%) scale(.88);
}

/* 木鱼槌：杆 + 球形槌头 */
.wf-mallet {
    position: absolute;
    right: 18px;
    top: -8px;
    width: 16px;
    height: 100px;
    transform-origin: 50% 6%;
    transform: rotate(16deg);
    z-index: 3;
    pointer-events: none;
}

.wf-mallet::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 8px;
    height: 84px;
    border-radius: 8px;
    background: linear-gradient(90deg, #c2410c, #7c2d12);
}

.wf-mallet::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 76px;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #f97316, #9a3412);
    box-shadow: 0 3px 6px rgba(120, 53, 15, .45);
}

.wf-fish.hit .wf-mallet {
    transform: rotate(56deg);
}

.wf-mallet {
    transition: transform .1s;
}

/* 波纹扩散 */
.wf-ripple {
    position: absolute;
    left: 50%;
    top: 56%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(245, 158, 11, .65);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.wf-fish.hit .wf-ripple {
    animation: wf-ripple .5s ease-out;
}

@keyframes wf-ripple {
    0% { opacity: .85; transform: translate(-50%, -50%) scale(.3); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(3.1); }
}

/* 飘字层（JS 动态创建） */
.wf-float {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 4;
}

.wf-float-item {
    position: absolute;
    left: 50%;
    top: 42%;
    font-size: 21px;
    font-weight: 800;
    color: #d97706;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(255, 255, 255, .9);
    animation: wf-float-up .85s ease-out forwards;
}

.wf-float-item.big {
    font-size: 30px;
    color: #ea580c;
    animation-duration: 1.1s;
}

@keyframes wf-float-up {
    0% { opacity: 0; transform: translate(-50%, 6px) scale(.6); }
    16% { opacity: 1; transform: translate(-50%, -10px) scale(1.18); }
    100% { opacity: 0; transform: translate(-50%, -52px) scale(1); }
}

/* 金色粒子（JS 动态创建） */
.wf-spark {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
    background: radial-gradient(circle, #fef3c7, #f59e0b);
    box-shadow: 0 0 8px rgba(245, 158, 11, .8);
    animation: wf-spark .6s ease-out forwards;
}

@keyframes wf-spark {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.15); }
}

.wf-tip {
    position: relative;
    margin-top: 8px;
    font-size: 14px;
    color: #a16207;
}

.wf-tip kbd {
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
}

/* ===== 控制栏 ===== */
.wf-controls {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 22px;
    margin-top: 18px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .6);
    border: 1px solid #fde68a;
    border-radius: 16px;
}

.wf-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wf-control-label {
    font-size: 13px;
    color: #92400e;
}

.wf-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.wf-switch input {
    display: none;
}

.wf-slider {
    width: 42px;
    height: 22px;
    background: #d1d5db;
    border-radius: 999px;
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}

.wf-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.wf-switch input:checked + .wf-slider {
    background: #f59e0b;
}

.wf-switch input:checked + .wf-slider::after {
    transform: translateX(20px);
}

/* 音色按钮组 */
.wf-tone-group {
    display: inline-flex;
    gap: 5px;
}

.wf-tone {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #fde68a;
    background: #fff;
    color: #92400e;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}

.wf-tone:hover {
    background: rgba(245, 158, 11, .1);
}

.wf-tone.active {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
    box-shadow: 0 3px 8px rgba(245, 158, 11, .35);
}

/* 音量滑块 */
.wf-vol {
    width: 110px;
    accent-color: #f59e0b;
    cursor: pointer;
}

/* ===== 统计面板 ===== */
.wf-stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.wf-stat {
    background: rgba(255, 255, 255, .62);
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 10px 6px;
}

.wf-stat-num {
    font-size: 22px;
    font-weight: 800;
    color: #92400e;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.wf-stat-label {
    font-size: 12px;
    color: #a16207;
    margin-top: 2px;
}

/* ===== 称号进度条 ===== */
.wf-rankbar {
    position: relative;
    margin-top: 12px;
    text-align: left;
    background: rgba(255, 255, 255, .58);
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 12px 14px;
}

.wf-rankbar-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 8px;
}

.wf-rank-next {
    font-size: 12px;
    color: #b45309;
}

.wf-rank-progress {
    height: 8px;
    border-radius: 999px;
    background: #fde68a;
    overflow: hidden;
}

.wf-rank-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    width: 0%;
    transition: width .5s;
}

/* ===== 深色模式 ===== */
[data-theme="dark"] .wf-hero {
    background: linear-gradient(160deg, #431407 0%, #422006 100%);
    border-color: rgba(253, 230, 138, 0.16);
}

[data-theme="dark"] .wf-rank {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(253, 230, 138, 0.22);
    color: #fde68a;
}

[data-theme="dark"] .wf-reset {
    border-color: rgba(253, 230, 138, 0.22);
    color: #fcd34d;
}

[data-theme="dark"] .wf-reset:hover {
    background: rgba(245, 158, 11, 0.16);
    color: #fde68a;
}

[data-theme="dark"] .wf-count { color: #fef3c7; }
[data-theme="dark"] .wf-count-label,
[data-theme="dark"] .wf-total,
[data-theme="dark"] .wf-combo { color: #fbbf24; }
[data-theme="dark"] .wf-float-item { color: #fbbf24; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
[data-theme="dark"] .wf-float-item.big { color: #fb923c; }
[data-theme="dark"] .wf-tip { color: #fcd34d; }
[data-theme="dark"] .wf-tip kbd {
    background: rgba(255, 255, 255, 0.10);
    color: #fef3c7;
    border-color: rgba(253, 230, 138, 0.25);
}

[data-theme="dark"] .wf-controls,
[data-theme="dark"] .wf-stat,
[data-theme="dark"] .wf-rankbar {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(253, 230, 138, 0.16);
}

[data-theme="dark"] .wf-control-label,
[data-theme="dark"] .wf-stat-label,
[data-theme="dark"] .wf-rank-next { color: #fbbf24; }
[data-theme="dark"] .wf-stat-num { color: #fef3c7; }

[data-theme="dark"] .wf-tone {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(253, 230, 138, 0.25);
    color: #fde68a;
}

[data-theme="dark"] .wf-tone:hover {
    background: rgba(245, 158, 11, 0.18);
}

[data-theme="dark"] .wf-tone.active {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}

[data-theme="dark"] .wf-rank-progress {
    background: rgba(253, 230, 138, 0.2);
}

@media (max-width: 480px) {
    .wf-count { font-size: 54px; }
    .wf-stats { grid-template-columns: repeat(2, 1fr); }
    .wf-fish { width: 220px; height: 190px; }
    .wf-fish-shape { width: 176px; height: 134px; }
}
