/* 移动端专用样式 - 完全重写 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 禁用移动端双击缩放和文本选择 */
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* 全局移动端优化 */
html {
    /* 禁用双击缩放 */
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    /* 防止iOS Safari的自动缩放 */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-size: 16px; /* 防止iOS缩放 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.4;
    color: #ffffff;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    /* 防止橡皮筋效果 */
    overscroll-behavior: none;
    /* 优化滚动性能 */
    -webkit-overflow-scrolling: touch;
    padding: 0;
    margin: 0;
}

.container {
    width: 100vw;
    min-height: 100vh;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

/* 标题区域 */
header {
    text-align: center;
    padding: 15px 0;
    margin-bottom: 15px;
}

header h1 {
    color: #00d4ff;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
    margin: 0;
}

/* 标签导航 - 手机端优化 */
.tabs {
    display: flex;
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    /* 移动端优化 */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    min-height: 48px;
    user-select: none;
}

.tab-btn.active {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* 模拟器主区域 */
.simulator {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

/* 装备展示区域 */
.equipment {
    text-align: center;
    margin-bottom: 25px;
}

.equipment-visual {
    position: relative;
    display: inline-block;
    margin: 15px 0;
}

.equipment-visual img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    border: 2px solid #00d4ff;
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.level-display {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.level-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: #ffffff;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.4);
}

/* 状态指标区域 */
.status-indicators {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-item {
    text-align: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
    font-weight: 500;
}

.status-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #00d4ff;
}



/* 选项区域 */
.options {
    margin-bottom: 20px;
    text-align: center;
}

.toggle {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* 移动端优化 */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 48px;
    user-select: none;
}

.toggle input {
    margin-right: 10px;
    transform: scale(1.2);
}

/* 按钮组 */
.buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-bottom: 20px;
}

.buttons button {
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    /* 移动端优化 */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    min-height: 44px;
    user-select: none;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

#enhance-btn {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #ffffff;
}

#enhance-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.4);
}

#reset-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: #ffffff;
}

#reset-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

/* 消费统计 */
.consumption-stats {
    margin-top: 20px;
}

.consumption-stats h3 {
    color: #00d4ff;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
}

.exchange-rate {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.exchange-rate label {
    color: #00d4ff;
    font-weight: 600;
    font-size: 0.9rem;
}

.exchange-rate input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 0.9rem;
    width: 80px;
    text-align: center;
}

.exchange-rate span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.stats-info {
    background: rgba(0, 212, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.stats-info p {
    margin: 0;
    color: #00d4ff;
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
}

.bath-service {
    margin-top: 8px !important;
    color: #ff6b6b !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
}



/* 数学期望表格 */
.expectations-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.expectations-table {
    width: 100%;
    min-width: 400px;
    border-collapse: collapse;
}

.expectations-table th,
.expectations-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

.expectations-table th {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    font-weight: 700;
}

/* 说明信息 */
.info-content {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-content h3 {
    color: #00d4ff;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-content p,
.info-content ul {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.info-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.85rem;
}

.info-content th,
.info-content td {
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.info-content th {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

/* 炫酷动画效果 */
.enhance-animation {
    animation: enhance 0.8s ease-in-out;
    position: relative;
    z-index: 10;
}

.success-animation {
    animation: success 1.5s ease-in-out, successPulse 0.3s ease-in-out 1.2s;
    position: relative;
    z-index: 10;
}

.success-animation::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(0, 255, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: successRipple 1.5s ease-out;
    pointer-events: none;
    z-index: -1;
}

.fail-animation {
    animation: fail 1.2s ease-in-out, failShake 0.1s ease-in-out 1s 3;
    position: relative;
    z-index: 10;
}

.fail-animation::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: failCrack 1.2s ease-out;
    pointer-events: none;
    z-index: -1;
}

/* 增幅过程动画 - 充能效果 */
@keyframes enhance {
    0% { 
        transform: scale(1) rotate(0deg);
        box-shadow: 0 0 0 rgba(0, 212, 255, 0);
    }
    25% { 
        transform: scale(1.02) rotate(1deg);
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    50% { 
        transform: scale(1.05) rotate(0deg);
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
        filter: brightness(1.2) contrast(1.1);
    }
    75% { 
        transform: scale(1.02) rotate(-1deg);
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    100% { 
        transform: scale(1) rotate(0deg);
        box-shadow: 0 0 0 rgba(0, 212, 255, 0);
    }
}

/* 成功动画 - 绿光效果 */
@keyframes success {
    0% { 
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
        box-shadow: 0 0 0 rgba(0, 255, 0, 0);
    }
    15% {
        transform: scale(1.15) rotate(5deg);
        filter: brightness(1.5);
        box-shadow: 0 0 50px rgba(0, 255, 0, 0.8);
    }
    30% {
        transform: scale(1.25) rotate(-3deg);
        filter: brightness(2);
        box-shadow: 0 0 80px rgba(0, 255, 0, 0.9),
                    0 0 120px rgba(0, 255, 0, 0.6);
    }
    50% {
        transform: scale(1.1) rotate(2deg);
        filter: brightness(1.5);
        box-shadow: 0 0 60px rgba(0, 255, 0, 0.7);
    }
    75% {
        transform: scale(1.05) rotate(-1deg);
        filter: brightness(1.2);
        box-shadow: 0 0 30px rgba(0, 255, 0, 0.4);
    }
    100% { 
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
        box-shadow: 0 0 0 rgba(0, 255, 0, 0);
    }
}

/* 失败动画 - 红光效果 */
@keyframes fail {
    0% { 
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
        box-shadow: 0 0 0 rgba(255, 0, 0, 0);
    }
    10% {
        transform: scale(0.95) rotate(-5deg);
        filter: brightness(0.7);
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
    }
    20% {
        transform: scale(1.05) rotate(3deg);
        filter: brightness(0.4);
        box-shadow: 0 0 50px rgba(255, 0, 0, 0.8);
    }
    30% {
        transform: scale(0.9) rotate(-8deg);
        filter: brightness(0.3);
        box-shadow: 0 0 40px rgba(255, 0, 0, 0.9),
                    0 0 80px rgba(255, 0, 0, 0.5);
    }
    45% {
        transform: scale(1.1) rotate(6deg);
        filter: brightness(0.5);
        box-shadow: 0 0 60px rgba(255, 0, 0, 0.7);
    }
    60% {
        transform: scale(0.95) rotate(-4deg);
        filter: brightness(0.6);
        box-shadow: 0 0 35px rgba(255, 0, 0, 0.5);
    }
    75% {
        transform: scale(1.02) rotate(2deg);
        filter: brightness(0.8);
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
    }
    90% {
        transform: scale(0.98) rotate(-1deg);
        filter: brightness(0.9);
        box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
    }
    100% { 
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
        box-shadow: 0 0 0 rgba(255, 0, 0, 0);
    }
}

/* 成功脉冲动画 */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* 成功波纹动画 */
@keyframes successRipple {
    0% {
        transform: scale(0);
        opacity: 0.8;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* 失败震动动画 */
@keyframes failShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* 失败裂纹动画 */
@keyframes failCrack {
    0% {
        transform: scale(1);
        opacity: 0.6;
        filter: blur(0px);
    }
    30% {
        opacity: 0.8;
        filter: blur(1px);
    }
    60% {
        transform: scale(1.5);
        opacity: 0.3;
        filter: blur(2px);
    }
    100% {
        transform: scale(2);
        opacity: 0;
        filter: blur(3px);
    }
}

/* 隐藏桌面端样式 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}
