* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: #0a0e27;
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
}

.container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 背景网格 */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    z-index: 0;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* 背景粒子 */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 主内容区 */
.main-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 600px;
    width: 100%;
}

/* 标题 */
.title {
    margin-bottom: 40px;
}

.title-text {
    display: block;
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    letter-spacing: 4px;
}

.title-subtitle {
    display: block;
    font-size: 14px;
    color: #00ffff;
    letter-spacing: 8px;
    margin-top: 10px;
    opacity: 0.7;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* 诵经显示区 */
.merit-display {
    background: rgba(10, 14, 39, 0.8);
    border: 2px solid #00ffff;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.3),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.merit-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(0, 255, 255, 0.1), transparent);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.merit-label {
    font-size: 16px;
    color: #00ffff;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.merit-value {
    font-size: 72px;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 
        0 0 10px #ffff00,
        0 0 20px #ffff00,
        0 0 30px #ffff00;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.merit-value.pulse {
    animation: meritPulse 0.5s ease;
}

@keyframes meritPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.merit-unit {
    font-size: 12px;
    color: #00ffff;
    margin-top: 10px;
    letter-spacing: 3px;
    opacity: 0.7;
}

/* 经文类型选择器 */
.merit-type-selector {
    background: rgba(10, 14, 39, 0.6);
    border: 2px solid rgba(255, 0, 255, 0.5);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.3),
        inset 0 0 20px rgba(255, 0, 255, 0.1);
}

.selector-label {
    font-size: 16px;
    color: #ff00ff;
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-align: center;
}

.selector-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.type-button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 25px;
    background: rgba(10, 14, 39, 0.8);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
    overflow: hidden;
}

.type-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.type-button:hover::before {
    left: 100%;
}

.type-button:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 255, 255, 0.8);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.4);
}

.type-button.active {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.3), rgba(0, 255, 255, 0.3));
    border-color: #00ffff;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.6),
        inset 0 0 20px rgba(0, 255, 255, 0.2);
}

.type-button.active::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #00ffff;
    color: #0a0e27;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.type-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 0, 0.5));
}

.type-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 1px;
}

.type-desc {
    font-size: 12px;
    color: #ffff00;
    opacity: 0.8;
    text-align: center;
}

/* 飘字效果 */
.floating-text {
    position: fixed;
    font-size: 32px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 
        0 0 15px rgba(255, 215, 0, 0.9),
        0 0 30px rgba(255, 215, 0, 0.7),
        0 0 45px rgba(255, 215, 0, 0.5);
    pointer-events: none;
    z-index: 9999;
    animation: floatUp 3s ease-out forwards;
    white-space: nowrap;
    letter-spacing: 2px;
}

.floating-text.dizang {
    color: #ffd700;
    text-shadow: 
        0 0 15px rgba(255, 215, 0, 0.9),
        0 0 30px rgba(255, 215, 0, 0.7),
        0 0 45px rgba(255, 215, 0, 0.5);
}

.floating-text.facai {
    color: #ffd700;
    text-shadow: 
        0 0 15px rgba(255, 215, 0, 0.9),
        0 0 30px rgba(255, 215, 0, 0.7),
        0 0 45px rgba(255, 215, 0, 0.5);
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.8);
    }
    10% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-150px) scale(1.3);
    }
    100% {
        opacity: 0;
        transform: translateY(-300px) scale(0.5);
    }
}

/* 诵经法器主体 */
.merit-box {
    position: relative;
    width: 300px;
    height: 350px;
    margin: 0 auto 40px;
    perspective: 1000px;
}

.box-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 370px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent 70%);
    border-radius: 20px;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.box-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.box-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 80px;
    background: linear-gradient(135deg, #ff00ff, #00ffff);
    border-radius: 20px 20px 0 0;
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.box-body {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 270px;
    background: linear-gradient(180deg, #1a1a3e, #0a0e27);
    border: 3px solid #00ffff;
    border-radius: 10px;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.5),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
    overflow: hidden;
}

.box-slot {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 8px;
    background: #000;
    border-radius: 4px;
    box-shadow: 
        0 0 10px rgba(255, 215, 0, 0.5),
        inset 0 0 5px rgba(255, 215, 0, 0.3);
}

.box-pattern {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 180px;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(0, 255, 255, 0.1) 10px, rgba(0, 255, 255, 0.1) 11px),
        repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(0, 255, 255, 0.1) 10px, rgba(0, 255, 255, 0.1) 11px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
}

/* 金光粒子 */
.golden-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.golden-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #ffff00, #ffd700);
    border-radius: 50%;
    box-shadow: 0 0 10px #ffff00;
    animation: particleFloat 1.5s ease-out forwards;
    opacity: 0;
}

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

/* 点击按钮 */
.donate-button {
    position: relative;
    padding: 20px 60px;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.5),
        0 0 40px rgba(0, 255, 255, 0.3);
}

.donate-button:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 0 30px rgba(255, 0, 255, 0.8),
        0 0 60px rgba(0, 255, 255, 0.5);
}

.donate-button:active {
    transform: translateY(-2px) scale(0.98);
}

.button-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: buttonGlow 3s linear infinite;
}

@keyframes buttonGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.button-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.button-icon {
    font-size: 28px;
    animation: iconBounce 1s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.button-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.button-ripple.active {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* 祝福语 */
.blessing {
    margin-top: 30px;
    font-size: 18px;
    color: #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
    min-height: 30px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.blessing.show {
    opacity: 1;
}

/* 装饰元素 */
.decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.deco-circle {
    position: absolute;
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 50%;
    animation: decoFloat 10s ease-in-out infinite;
}

.deco-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.deco-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.deco-3 {
    width: 100px;
    height: 100px;
    bottom: 15%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes decoFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translate(20px, -20px) rotate(180deg);
        opacity: 0.6;
    }
}

/* 静音控制按钮 - 右上角固定 */
.audio-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.mute-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(10, 14, 39, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 0, 0.4);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffff00;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.2);
}

.mute-button:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 0, 0.8);
    box-shadow: 0 0 25px rgba(255, 255, 0, 0.5);
    background: rgba(10, 14, 39, 0.8);
}

.mute-button:active {
    transform: scale(0.98);
}

.mute-button.muted {
    border-color: rgba(128, 128, 128, 0.4);
    color: #888;
    box-shadow: 0 0 15px rgba(128, 128, 128, 0.2);
    background: rgba(10, 14, 39, 0.5);
}

.mute-button.muted:hover {
    border-color: rgba(128, 128, 128, 0.8);
    box-shadow: 0 0 25px rgba(128, 128, 128, 0.5);
    background: rgba(10, 14, 39, 0.7);
}

.mute-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
}

.mute-text {
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 10px;
    }
    
    .main-content {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .title {
        margin-bottom: 25px;
    }
    
    .title-text {
        font-size: 32px;
        letter-spacing: 2px;
    }
    
    .title-subtitle {
        font-size: 11px;
        letter-spacing: 4px;
        margin-top: 8px;
    }
    
    .merit-display {
        padding: 20px 15px;
        margin-bottom: 25px;
        border-radius: 15px;
    }
    
    .merit-label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .merit-value {
        font-size: 48px;
    }
    
    .merit-unit {
        font-size: 10px;
        margin-top: 8px;
    }
    
    /* 移动端咒语选择器 - 可折叠设计 */
    .merit-type-selector {
        padding: 15px;
        margin-bottom: 25px;
        border-radius: 15px;
        max-height: 60px;
        overflow: hidden;
        transition: max-height 0.4s ease, padding 0.4s ease;
    }
    
    .merit-type-selector.expanded {
        max-height: 400px;
        padding: 20px 15px;
    }
    
    .selector-label {
        font-size: 14px;
        margin-bottom: 0;
        cursor: pointer;
        position: relative;
        padding-right: 30px;
        transition: margin-bottom 0.3s ease;
    }
    
    .merit-type-selector.expanded .selector-label {
        margin-bottom: 15px;
    }
    
    .selector-label::after {
        content: '▼';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        font-size: 12px;
        transition: transform 0.3s ease;
    }
    
    .merit-type-selector.expanded .selector-label::after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    .selector-buttons {
        gap: 10px;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        pointer-events: none;
    }
    
    .merit-type-selector.expanded .selector-buttons {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    .type-button {
        padding: 15px 20px;
        min-width: 140px;
        gap: 6px;
        border-radius: 12px;
    }
    
    .type-icon {
        font-size: 24px;
    }
    
    .type-name {
        font-size: 14px;
    }
    
    .type-desc {
        font-size: 11px;
    }
    
    /* 飘字效果 - 移动端优化 */
    .floating-text {
        font-size: 24px;
    }
    
    /* 移动端静音按钮 */
    .audio-control {
        top: 15px;
        right: 15px;
    }
    
    .mute-button {
        padding: 10px;
        font-size: 12px;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        justify-content: center;
    }
    
    .mute-icon {
        font-size: 20px;
    }
    
    .mute-text {
        display: none;
    }
    
    .merit-box {
        width: 220px;
        height: 260px;
        margin-bottom: 25px;
    }
    
    .box-glow {
        width: 240px;
        height: 280px;
    }
    
    .box-top {
        width: 200px;
        height: 55px;
        border-radius: 15px 15px 0 0;
    }
    
    .box-body {
        top: 55px;
        width: 180px;
        height: 205px;
        border-radius: 8px;
        border-width: 2px;
    }
    
    .box-slot {
        top: 20px;
        width: 140px;
        height: 6px;
    }
    
    .box-pattern {
        top: 40px;
        width: 150px;
        height: 140px;
    }
    
    .donate-button {
        padding: 15px 40px;
        font-size: 18px;
        border-radius: 40px;
    }
    
    .button-icon {
        font-size: 22px;
    }
    
    .blessing {
        font-size: 15px;
        margin-top: 20px;
        padding: 0 10px;
    }
    
    .deco-circle {
        display: none;
    }
}

/* 超小屏幕优化 */
@media (max-width: 375px) {
    .title-text {
        font-size: 28px;
    }
    
    .merit-value {
        font-size: 42px;
    }
    
    .merit-box {
        width: 180px;
        height: 220px;
    }
    
    .box-glow {
        width: 200px;
        height: 240px;
    }
    
    .box-top {
        width: 160px;
        height: 45px;
    }
    
    .box-body {
        top: 45px;
        width: 150px;
        height: 175px;
    }
    
    .box-slot {
        width: 110px;
    }
    
    .box-pattern {
        width: 120px;
        height: 120px;
    }
    
    .type-button {
        min-width: 120px;
        padding: 12px 15px;
    }
    
    .donate-button {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .floating-text {
        font-size: 20px;
    }
}