/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "微软雅黑", "PingFang SC", sans-serif;
}

/* 页面背景 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8f4e9;
    padding: 20px;
}

/* 计数区域 */
.counter-container {
    text-align: center;
    margin-bottom: 40px;
}
.counter-container h2 {
    color: #704214;
    font-size: 28px;
    margin-bottom: 10px;
}
.counter {
    font-size: 52px;
    font-weight: bold;
    color: #5c3c1e;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* 木鱼外层容器（核心交互区） */
.wooden-fish-wrapper {
    position: relative;
    width: 300px;
    height: 280px;
    margin-bottom: 40px;
    cursor: pointer; /* 明确提示可点击 */
}

/* 木鱼主体（视觉突出，纹理真实） */
.wooden-fish {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 200px;
    background: linear-gradient(135deg, #d2b48c 0%, #b8860b 100%);
    border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
    box-shadow: 
        inset 0 -15px 20px rgba(0,0,0,0.2),
        0 10px 15px rgba(0,0,0,0.15),
        0 0 0 8px rgba(139, 69, 19, 0.1);
    z-index: 1;
    transition: all 0.1s ease; /* 敲击缩放动画 */
}
/* 木鱼敲击时的按压效果 */
.wooden-fish.hit {
    transform: translate(-50%, -50%) scale(0.98);
    box-shadow: 
        inset 0 -15px 20px rgba(0,0,0,0.2),
        0 5px 10px rgba(0,0,0,0.15),
        0 0 0 8px rgba(139, 69, 19, 0.1);
}

/* 木鱼细节：嘴巴 */
.fish-mouth {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 80px;
    background-color: #8b4513;
    border-radius: 50%;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.2);
}
/* 木鱼细节：眼睛 */
.fish-eye {
    position: absolute;
    top: 25%;
    width: 20px;
    height: 20px;
    background-color: #000;
    border-radius: 50%;
}
.left-eye {
    left: 25%;
}
.right-eye {
    right: 25%;
}

/* 木鱼槌（位置合理，敲击动画自然） */
.mallet {
    position: absolute;
    right: -20px;
    top: 20px;
    transform-origin: right center; /* 以槌柄末端为旋转中心 */
    transform: rotate(-20deg); /* 初始抬起角度 */
    transition: transform 0.1s ease; /* 敲击旋转动画 */
    z-index: 2; /* 木鱼槌在木鱼上方 */
    pointer-events: none; /* 不遮挡木鱼点击 */
}
/* 木鱼槌敲击动画 */
.mallet.hit {
    transform: rotate(10deg); /* 敲击下压角度 */
}

/* 槌头 */
.mallet-head {
    width: 45px;
    height: 45px;
    background-color: #8b5a2b;
    border-radius: 50%;
    box-shadow: 
        inset 0 -5px 10px rgba(0,0,0,0.2),
        0 3px 5px rgba(0,0,0,0.1);
}
/* 槌柄 */
.mallet-handle {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 14px;
    background: linear-gradient(90deg, #d2b48c 0%, #c19a6b 100%);
    border-radius: 7px;
    box-shadow: inset 0 -2px 5px rgba(0,0,0,0.1);
}

/* 漂浮文字容器 */
.float-text-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 3;
}
/* 漂浮文字样式 */
.float-text {
    position: absolute;
    color: #704214;
    font-size: 22px;
    font-weight: bold;
    opacity: 0;
    animation: floatUp 1.5s ease-out forwards;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.15);
}
/* 文字上浮动画 */
@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-70px) rotate(5deg);
    }
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    gap: 20px;
}
.reset-btn, .change-text-btn {
    padding: 12px 30px;
    background-color: #8b5a2b;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.reset-btn:hover, .change-text-btn:hover {
    background-color: #6d4420;
}

/* 移动端适配 */
@media (max-width: 400px) {
    .wooden-fish-wrapper {
        width: 260px;
        height: 240px;
    }
    .wooden-fish {
        width: 200px;
        height: 160px;
    }
    .mallet {
        right: -10px;
        top: 15px;
    }
    .mallet-handle {
        width: 100px;
    }
    .counter {
        font-size: 40px;
    }
}