* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #ebc196 0%, #e7ae7d 100%);
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* 顶部Logo */
.header {
    width: 100%;
    display: contents;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    gap: 15px;
    margin-top: 20px;
}

.logo {
    height: 88px;
    width: auto;
    object-fit: contain;
}

.title {
    font-size: 48px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    margin: 0;
    margin-top: 20px;
}

.sub-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    margin: 0;
}
/* 木鱼区域 */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
    gap: 30px;
}

/* 功德计数器 */
.merit-counter {
    font-size: 36px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    letter-spacing: 1px;

}

#meritCount {
    color: #FFD700;
    font-size: 42px;
}

.muyu-container {
    position: relative;
    width: 80vw;
    max-width: 400px;
    aspect-ratio: 1;
    cursor: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    overflow: visible;
    margin-top: 10px;

}

/* 功德+1 文字 */
.merit-text {
    position: absolute;
    font-size: 32px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    animation: merit-float 1s ease-out forwards;
    z-index: 100;
    white-space: nowrap;
    transform: translateX(-50%);
}

/* 功德-1 负面文字 */
.merit-text.merit-negative {
    color: #FF4444;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

/* 日志悬浮按钮 */
.log-toggle-btn {
    position: fixed;
    left: 20px;
    top: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #C5722B;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: all 0.3s ease;
}

.log-toggle-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.log-toggle-btn:active {
    transform: scale(0.95);
}

/* 日志悬浮窗 */
.log-panel {
    position: fixed;
    left: -350px;
    top: 50%;
    transform: translateY(-50%);
    width: 320px;
    max-height: 80vh;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 12px 12px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 998;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.log-panel.open {
    left: 0;
}

.log-header {
    padding: 15px 20px;
    background: #C5722B;
    color: white;
    border-radius: 0 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-header h2 {
    margin: 0;
    font-size: 20px;
}

.log-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.log-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.log-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.log-section {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.log-section h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #C5722B;
    border-bottom: 2px solid #C5722B;
    padding-bottom: 5px;
    flex-shrink: 0;
}

.log-section-content {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

/* 自定义滚动条样式 */
.log-section-content::-webkit-scrollbar {
    width: 6px;
}

.log-section-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.log-section-content::-webkit-scrollbar-thumb {
    background: #C5722B;
    border-radius: 3px;
}

.log-section-content::-webkit-scrollbar-thumb:hover {
    background: #A85A1F;
}

.log-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    font-size: 13px;
}

.log-time {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 3px;
}

.log-text {
    font-weight: 500;
}

.log-gain {
    background: #E8F5E9;
    color: #2E7D32;
}

.log-loss {
    background: #FFEBEE;
    color: #C62828;
}

.log-bonus {
    background: #FFF9C4;
    color: #F57F17;
    border-left: 4px solid #FDD835;
}

.log-penalty {
    background: #FFCCBC;
    color: #BF360C;
    border-left: 4px solid #FF5722;
}

.log-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* 说明悬浮按钮 */
.help-toggle-btn {
    position: fixed;
    right: 20px;
    top: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #C5722B;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: all 0.3s ease;
}

.help-toggle-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.help-toggle-btn:active {
    transform: scale(0.95);
}

/* 分享悬浮按钮 */
.share-toggle-btn {
    position: fixed;
    right: 80px;
    top: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #C5722B;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: all 0.3s ease;
}

.share-toggle-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.share-toggle-btn:active {
    transform: scale(0.95);
}

/* 说明悬浮窗 */
.help-panel {
    position: fixed;
    right: -370px;
    top: 50%;
    transform: translateY(-50%);
    width: 340px;
    max-height: 80vh;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px 0 0 12px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 998;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.help-panel.open {
    right: 0;
}

.help-header {
    padding: 15px 20px;
    background: #C5722B;
    color: white;
    border-radius: 12px 0 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-header h2 {
    margin: 0;
    font-size: 20px;
}

.help-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.help-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.help-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.help-section {
    margin-bottom: 25px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #C5722B;
    border-bottom: 2px solid #C5722B;
    padding-bottom: 6px;
}

.help-section ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.help-section ul li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #333;
    font-size: 14px;
    position: relative;
    padding-left: 0;
}

.help-section ul li::before {
    content: "•";
    color: #C5722B;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.help-section ul li strong {
    color: #A85A1F;
}

/* 自定义滚动条样式（说明面板） */
.help-content::-webkit-scrollbar {
    width: 6px;
}

.help-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.help-content::-webkit-scrollbar-thumb {
    background: #C5722B;
    border-radius: 3px;
}

.help-content::-webkit-scrollbar-thumb:hover {
    background: #A85A1F;
}

/* 分享弹窗遮罩 */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.share-modal.show {
    display: flex;
}

/* 分享弹窗内容 */
.share-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.share-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.share-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.share-logo {
    margin-bottom: 20px;
}

.share-logo img {
    height: 60px;
    width: auto;
}

.share-title {
    margin: 0 0 15px 0;
    font-size: 22px;
    color: #333;
    font-weight: bold;
}

.share-merit {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #666;
}

.share-merit span {
    color: #C5722B;
    font-size: 24px;
    font-weight: bold;
}

.share-url {
    margin: 0 0 25px 0;
    font-size: 18px;
    color: #C5722B;
    font-weight: bold;
    padding: 12px 20px;
    background: #FFF5E6;
    border-radius: 8px;
    border: 2px dashed #C5722B;
}

.share-qrcode {
    display: flex;
    justify-content: center;
    margin: 0 0 15px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.share-qrcode .qrcode-img {
    width: 200px;
    height: 200px;
    display: block;
}

.share-tip {
    margin: 0;
    font-size: 14px;
    color: #999;
}

/* 皮肤切换按钮 */
.skin-selector {
    width: 100%;
    text-align: center;
    padding: 10px 0;
}

.skin-btn {
    padding: 10px 30px;
    background: rgba(255, 255, 255, 0.9);
    color: #C5722B;
    border: 2px solid #C5722B;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(197, 114, 43, 0.3);
    transition: all 0.3s ease;
}

.skin-btn:hover {
    background: #C5722B;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(197, 114, 43, 0.4);
}

.skin-btn:active {
    transform: translateY(0);
}

/* 皮肤选择弹窗 */
.skin-modal-content {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.skin-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.skin-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.skin-item:hover {
    border-color: #C5722B;
    box-shadow: 0 4px 12px rgba(197, 114, 43, 0.2);
    transform: translateY(-2px);
}

.skin-item.active {
    border-color: #C5722B;
    background: #FFF5E6;
}

.skin-preview {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
    flex-shrink: 0;
}

.skin-info {
    flex: 1;
}

.skin-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.skin-text {
    font-size: 14px;
    color: #666;
}

.skin-text::before {
    content: "文本：";
    color: #999;
}

.muyu {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.chui {
    position: absolute;
    top: -10%;
    left: 10%;
    transform: translateX(-50%) rotate(30deg);
    transform-origin: bottom center;
    width: 30%;
    height: auto;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

/* 鼠标移入木鱼区域时，显示棒槌 */
.muyu-container:hover .chui {
    opacity: 1;
}

/* 棒槌敲击动画 */
.chui.hit {
    animation: hit 0.3s ease-out;
}

@keyframes hit {
    0% {
        transform: translateX(-50%) rotate(30deg) translateY(-20px);
    }
    50% {
        transform: translateX(-50%) rotate(10deg) translateY(0);
    }
    100% {
        transform: translateX(-50%) rotate(30deg) translateY(-20px);
    }
}

/* 功德+1 向上弧形漂浮动画 */
@keyframes merit-float {
    0% {
        opacity: 1;
        transform: translateX(calc(-50% + 0px)) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(calc(-50% + var(--random-x))) translateY(-150px);
    }
}

/* 底部提示 */
.footer {
    width: 100%;
    text-align: center;
    padding: 20px;
    color: #ffffff;
    font-size: 14px;
}

.footer a {
    color: #FFE4B5;
    text-decoration: none;
    font-weight: bold;
}

.footer a:hover {
    text-decoration: underline;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .logo {
        height: 60px;
    }

    .title {
        font-size: 36px;
    }

    .merit-counter {
        font-size: 28px;
    }

    #meritCount {
        font-size: 32px;
    }

    .muyu-container {
        width: 70vw;
        max-width: 300px;
    }

    .footer {
        font-size: 12px;
        padding: 15px 10px;
    }
    
    /* 小屏幕默认收起日志面板 */
    .log-toggle-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
        left: 10px;
        top: 10px;
    }
    
    .log-panel {
        width: 280px;
        left: -290px;
    }
    
    .help-toggle-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
        right: 10px;
        top: 10px;
    }
    
    .share-toggle-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
        right: 65px;
        top: 10px;
    }
    
    .help-panel {
        width: 300px;
        right: -310px;
    }
    
    .share-modal-content {
        padding: 30px 20px;
        max-width: 350px;
    }
    
    .share-title {
        font-size: 20px;
    }
    
    .share-merit {
        font-size: 16px;
    }
    
    .share-merit span {
        font-size: 22px;
    }
    
    .share-url {
        font-size: 16px;
    }
    
    .skin-btn {
        font-size: 14px;
        padding: 8px 24px;
    }
    
    .skin-preview {
        width: 60px;
        height: 60px;
    }
    
    .skin-name {
        font-size: 16px;
    }
}

@media screen and (max-width: 480px) {
    .header {
        padding: 15px 0;
        gap: 10px;
    }

    .logo {
        height: 50px;
    }

    .title {
        font-size: 28px;
    }

    .merit-counter {
        font-size: 24px;
    }

    #meritCount {
        font-size: 28px;
    }

    .main {
        gap: 20px;
    }

    .muyu-container {
        width: 65vw;
    }

    .footer {
        font-size: 11px;
    }
    
    .log-panel {
        width: 260px;
        left: -270px;
        max-height: 70vh;
    }
    
    .log-header h2 {
        font-size: 18px;
    }
    
    .help-panel {
        width: 280px;
        right: -290px;
        max-height: 70vh;
    }
    
    .help-header h2 {
        font-size: 18px;
    }
    
    .help-section h3 {
        font-size: 15px;
    }
    
    .help-section ul li {
        font-size: 13px;
    }
}

/* 横屏适配 */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .logo {
        height: 50px;
    }

    .title {
        font-size: 32px;
    }

    .merit-counter {
        font-size: 24px;
    }

    #meritCount {
        font-size: 28px;
    }

    .header {
        padding: 10px 0;
    }

    .main {
        gap: 15px;
    }

    .footer {
        padding: 10px;
        font-size: 12px;
    }

    .muyu-container {
        max-width: 250px;
    }
    
    .log-panel {
        max-height: 90vh;
    }
    
    .help-panel {
        max-height: 90vh;
    }
}
