/* 电子木鱼页面样式 */

.tool-content {
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 控制面板 */
.control-panel {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.active {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.3);
}

.btn-icon {
    font-size: 20px;
}

/* 木鱼区域 */
.wooden-fish-area {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

/* 功德显示 */
.merit-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    font-size: 24px;
    color: #333;
}

.merit-label {
    font-weight: 600;
    color: #667eea;
}

.merit-count {
    font-size: 48px;
    font-weight: 700;
    color: #764ba2;
    min-width: 120px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.merit-unit {
    font-weight: 600;
    color: #667eea;
}

/* 木鱼容器 */
.wooden-fish-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 40px auto;
}

/* 木鱼 */
.wooden-fish {
    width: 300px;
    height: 300px;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s ease;
    user-select: none;
    perspective: 1000px;
}

.wooden-fish:hover {
    transform: scale(1.02);
}

.wooden-fish:active {
    transform: scale(0.98);
}

.wooden-fish.tap-animation {
    animation: tap 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes tap {
    0%, 100% {
        transform: scale(1) rotate(0deg) translateZ(0);
    }
    15% {
        transform: scale(0.95) rotate(-3deg) translateZ(-10px);
    }
    30% {
        transform: scale(0.92) rotate(0deg) translateZ(-15px);
    }
    45% {
        transform: scale(0.95) rotate(3deg) translateZ(-10px);
    }
    60% {
        transform: scale(0.97) rotate(-1deg) translateZ(-5px);
    }
    75% {
        transform: scale(1.01) rotate(1deg) translateZ(0);
    }
}

.fish-body {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(145deg, #a0522d 0%, #8B4513 20%, #654321 60%, #4a2f1a 100%);
    border-radius: 50% 50% 48% 48%;
    box-shadow:
        inset -15px -15px 30px rgba(0, 0, 0, 0.5),
        inset 15px 15px 30px rgba(205, 133, 63, 0.3),
        inset 0 -5px 25px rgba(101, 67, 33, 0.6),
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 10px 25px rgba(0, 0, 0, 0.3),
        0 5px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: visible;
    transform-style: preserve-3d;
}

/* 木纹纹理 */
.fish-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50% 50% 48% 48%;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(139, 69, 19, 0.1) 3px,
            rgba(139, 69, 19, 0.1) 4px
        ),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(160, 82, 45, 0.05) 10px,
            rgba(160, 82, 45, 0.05) 20px
        ),
        radial-gradient(ellipse at 30% 30%, rgba(205, 133, 63, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(101, 67, 33, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

/* 高光效果 */
.fish-body::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 15%;
    width: 35%;
    height: 25%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 40%, transparent 70%);
    border-radius: 50%;
    transform: rotate(-25deg);
    pointer-events: none;
}

.fish-pattern {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 65%;
    height: 65%;
    background:
        radial-gradient(ellipse at center,
            rgba(210, 140, 70, 0.3) 0%,
            rgba(160, 82, 45, 0.4) 30%,
            rgba(101, 67, 33, 0.5) 60%,
            rgba(74, 47, 26, 0.6) 100%
        );
    border-radius: 50%;
    box-shadow:
        0 0 40px rgba(139, 69, 19, 0.6),
        inset 0 0 30px rgba(0, 0, 0, 0.4),
        inset 0 5px 15px rgba(255, 215, 0, 0.2),
        inset 0 -5px 15px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(101, 67, 33, 0.8);
}

/* 中心雕刻文字 */
.fish-pattern::before {
    content: '木魚';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: 900;
    color: #D4AF37;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.8),
        0 -1px 0 rgba(255, 215, 0, 0.5),
        2px 2px 4px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(212, 175, 55, 0.5);
    letter-spacing: 10px;
    font-family: 'KaiTi', '楷体', serif;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.6));
}

/* 装饰纹路 */
.fish-pattern::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    height: 110%;
    border-radius: 50%;
    border: 2px dashed rgba(212, 175, 55, 0.3);
    box-shadow:
        inset 0 0 20px rgba(212, 175, 55, 0.2),
        0 0 15px rgba(212, 175, 55, 0.2);
}

.fish-shadow {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 50px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 40%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    transition: all 0.3s ease;
}

.wooden-fish.tap-animation .fish-shadow {
    width: 320px;
    opacity: 0.6;
}

/* 敲击波纹效果 */
.ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
}

.ripple-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 215, 0, 0.8);
    border-radius: 50%;
    animation: ripple-expand 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ripple-expand {
    0% {
        width: 100%;
        height: 100%;
        opacity: 1;
        border-width: 3px;
    }
    50% {
        border-width: 2px;
        opacity: 0.6;
    }
    100% {
        width: 150%;
        height: 150%;
        opacity: 0;
        border-width: 1px;
    }
}

/* 金色光晕效果 */
.golden-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 60%);
    animation: glow-pulse 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes glow-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

/* 功德粒子效果 */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #FFD700 0%, #FFA500 100%);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.particle-animation {
    animation: particle-float 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes particle-float {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* 木槌效果 */
.wooden-mallet {
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
}

.mallet-handle {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 50px;
    background: linear-gradient(90deg, #8B4513 0%, #654321 50%, #8B4513 100%);
    border-radius: 5px;
    box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.3);
}

.mallet-head {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 35px;
    background: linear-gradient(145deg, #a0522d 0%, #8B4513 50%, #654321 100%);
    border-radius: 50% 50% 45% 45%;
    box-shadow:
        inset -3px -3px 8px rgba(0, 0, 0, 0.4),
        inset 2px 2px 6px rgba(205, 133, 63, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.wooden-mallet.strike {
    animation: mallet-strike 0.4s ease-out forwards;
}

@keyframes mallet-strike {
    0% {
        opacity: 1;
        transform: translate(-50%, -120px) rotate(-30deg);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -20px) rotate(-5deg);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -25px) rotate(-8deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -30px) rotate(-10deg);
    }
}

.tap-hint {
    margin-top: 25px;
    font-size: 16px;
    color: #666;
    opacity: 0.8;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

/* 提示文字 */
.merit-text {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
    margin: 20px 0;
    position: relative;
}

.merit-text-item {
    position: absolute;
    animation: float-up 1.5s ease-out forwards;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes float-up {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-80px) scale(1.3);
        opacity: 0;
    }
}

/* 重置按钮 */
.reset-btn {
    margin-top: 20px;
    padding: 10px 30px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
}

.reset-btn:active {
    transform: translateY(0);
}

/* 设置弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
}

.settings-group {
    margin-bottom: 24px;
}

.settings-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.settings-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.settings-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.settings-presets {
    margin-top: 20px;
}

.presets-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-size: 16px;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.preset-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.preset-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.modal-footer {
    padding: 20px 24px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
}

.btn-save {
    padding: 12px 32px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.3);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 233, 123, 0.4);
}

.btn-save:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .control-panel {
        gap: 10px;
    }

    .control-btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .wooden-fish-area {
        padding: 30px 20px;
    }

    .merit-display {
        font-size: 20px;
    }

    .merit-count {
        font-size: 36px;
        min-width: 100px;
    }

    .wooden-fish {
        width: 240px;
        height: 240px;
    }

    .fish-shadow {
        width: 240px;
        bottom: -25px;
    }

    .fish-pattern::before {
        font-size: 32px;
        letter-spacing: 8px;
    }

    .wooden-mallet {
        width: 60px;
        height: 60px;
    }

    .mallet-handle {
        width: 8px;
        height: 40px;
    }

    .mallet-head {
        width: 28px;
        height: 28px;
    }

    .merit-text {
        font-size: 24px;
        min-height: 50px;
    }

    .modal-content {
        width: 95%;
    }

    .presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .control-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .btn-icon {
        font-size: 18px;
    }

    .wooden-fish-area {
        padding: 20px 15px;
    }

    .merit-display {
        font-size: 18px;
        gap: 8px;
    }

    .merit-count {
        font-size: 32px;
        min-width: 80px;
    }

    .wooden-fish {
        width: 200px;
        height: 200px;
    }

    .fish-shadow {
        width: 200px;
        bottom: -20px;
        height: 40px;
    }

    .fish-pattern::before {
        font-size: 28px;
        letter-spacing: 6px;
    }

    .wooden-mallet {
        width: 50px;
        height: 50px;
    }

    .mallet-handle {
        width: 7px;
        height: 35px;
    }

    .mallet-head {
        width: 24px;
        height: 24px;
    }

    .particle {
        width: 6px;
        height: 6px;
    }

    .tap-hint {
        font-size: 14px;
    }

    .merit-text {
        font-size: 20px;
        min-height: 40px;
    }

    .reset-btn {
        padding: 8px 24px;
        font-size: 14px;
    }

    .presets-grid {
        grid-template-columns: 1fr;
    }
}
