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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    width: 100%;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1a2a6c, #2a3a7c);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.header h1 {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 159, 28, 0.7);
    font-size: 28px;
    letter-spacing: 1px;
    position: relative;
    margin: 0;
}

.level-selector {
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.level-btn {
    padding: 8px 16px;
    background-color: #eee;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.level-btn:hover::after {
    left: 100%;
}

.level-btn[data-level^="1"] {
    background: linear-gradient(to right, rgba(76, 175, 80, 0.3), rgba(76, 175, 80, 0.1));
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.level-btn[data-level^="2"] {
    background: linear-gradient(to right, rgba(0, 188, 212, 0.3), rgba(0, 188, 212, 0.1));
    border: 1px solid rgba(0, 188, 212, 0.4);
}

.level-btn[data-level^="3"] {
    background: linear-gradient(to right, rgba(156, 39, 176, 0.3), rgba(156, 39, 176, 0.1));
    border: 1px solid rgba(156, 39, 176, 0.4);
}

.level-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: white;
}

.level-btn.active {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 159, 28, 0.5);
}

.level-btn[data-level^="1"].active {
    background: linear-gradient(to right, #4caf50, #8bc34a);
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.level-btn[data-level^="2"].active {
    background: linear-gradient(to right, #00bcd4, #03a9f4);
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.level-btn[data-level^="3"].active {
    background: linear-gradient(to right, #9c27b0, #e91e63);
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.game-board {
    display: grid;
    /*grid-template-columns: repeat(15, 40px); /* 网格尺寸由JS动态设置 */
    /*grid-template-rows: repeat(12, 40px); /* 网格尺寸由JS动态设置 */
    grid-auto-flow: row dense; /* 确保网格元素正确填充 */
    grid-auto-columns: auto; /* 允许自动调整列宽 */
    gap: 1px;
    background-color: #90EE90; /* 将背景色设置为绿色 */
    padding: 5px;
    margin-bottom: 20px;
    border-radius: 8px;
    align-self: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.3);
    margin: 20px auto;
    border-radius: 10px;
    padding: 10px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
    min-width: min-content; /* 确保宽度至少足够容纳所有内容 */
    overflow-x: auto; /* 允许在需要时横向滚动 */
}

.cell {
    width: var(--cell-size, 40px);
    height: var(--cell-size, 40px);
    min-width: var(--cell-size, 40px);
    min-height: var(--cell-size, 40px);
    position: relative;
    transition: all 0.2s ease;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 3px;
    box-sizing: border-box;
    overflow: visible;
}

/* 新增地面类 */
.ground {
    background-color: #f0f0f0;
    border: 1px solid #e0e0e0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

/* 让游戏元素在鼠标悬停时显示可点击状态 */
.player, .cardboard-box, .aluminum-box, .lead-box, 
.goal, .alpha-emitter, .beta-emitter, .gamma-emitter,
.alpha-ray, .beta-ray, .gamma-ray, .electric-field, 
.magnetic-field-dot, .magnetic-field-cross,
.weak-sensor, .medium-sensor, .strong-sensor {
    cursor: pointer;
}

.player:hover, .cardboard-box:hover, .aluminum-box:hover, .lead-box:hover, 
.goal:hover, .alpha-emitter:hover, .beta-emitter:hover, .gamma-emitter:hover,
.electric-field:hover, .magnetic-field-dot:hover, .magnetic-field-cross:hover,
.weak-sensor:hover, .medium-sensor:hover, .strong-sensor:hover {
    filter: brightness(1.2);
}

/* 墙壁样式 */
.wall {
    background-image: url('fixed_svg/wall.svg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 3;
    background-color: rgba(30, 30, 50, 0.8);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.player {
    background-image: url('fixed_svg/player.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 5;
    transition: all 0.2s ease-in-out;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
    animation: playerPulse 2s infinite ease-in-out;
}

.cardboard-box {
    background-image: url('fixed_svg/box/cardboard_box.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
    transition: all 0.2s ease-in-out;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.aluminum-box {
    background-image: url('fixed_svg/box/aluminum_box.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
    transition: all 0.2s ease-in-out;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.lead-box {
    background-image: url('fixed_svg/box/lead_box.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
    transition: all 0.2s ease-in-out;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

/* 传感器样式 */
.weak-sensor {
    background-image: url('fixed_svg/sensor/weak_sensor.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.medium-sensor {
    background-image: url('fixed_svg/sensor/medium_sensor.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.strong-sensor {
    background-image: url('fixed_svg/sensor/strong_sensor.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

/* 传感器状态样式 */
.sensor-activated {
    animation: pulse 1.5s infinite;
    filter: brightness(1.5) hue-rotate(60deg);
}

.sensor-damaged {
    filter: brightness(0.7) grayscale(0.8) hue-rotate(-30deg);
    opacity: 0.8;
}

@keyframes pulse {
    0% { filter: brightness(1) hue-rotate(60deg); }
    50% { filter: brightness(1.8) hue-rotate(60deg); }
    100% { filter: brightness(1) hue-rotate(60deg); }
}

.goal {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: goalGlow 2s infinite alternate;
}

@keyframes goalGlow {
    0% { filter: brightness(1) drop-shadow(0 0 5px gold); }
    100% { filter: brightness(1.3) drop-shadow(0 0 15px gold); }
}

.goal::after {
    content: "★";
    font-size: 30px;
    color: gold;
    text-shadow: 0 0 10px gold;
}

.alpha-emitter {
    background-image: url('fixed_svg/ray_emitter/alpha_ray_emitter.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
    transform: rotate(0deg);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    transition: all 0.3s ease;
}

.beta-emitter {
    background-image: url('fixed_svg/ray_emitter/beta_ray_emitter.svg') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    z-index: 4;
    transform: rotate(0deg) !important;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    transition: all 0.3s ease;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 增强版贝塔发射器样式 */
.beta-emitter-enhanced, .beta-emitter-fixed {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-image: url('fixed_svg/ray_emitter/beta_ray_emitter.svg') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    z-index: 10 !important;
}

.gamma-emitter {
    background-image: url('fixed_svg/ray_emitter/gamma_ray_emitter.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
    transform: rotate(0deg);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    transition: all 0.3s ease;
}

.alpha-ray {
    position: absolute;
    background-color: red;
    height: 4px;
    z-index: 3;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
    animation: rayPulse 1.5s infinite alternate;
}

.alpha-ray::after {
    border-color: red;
}

.beta-ray {
    position: absolute;
    background-color: blue;
    height: 4px;
    z-index: 3;
    box-shadow: 0 0 10px rgba(0, 0, 255, 0.7);
    animation: rayPulse 1.5s infinite alternate;
}

.beta-ray::after {
    border-color: blue;
}

.gamma-ray {
    position: absolute;
    background-color: yellow;
    height: 4px;
    z-index: 3;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.7);
    animation: rayPulse 1.5s infinite alternate;
}

.gamma-ray::after {
    border-color: yellow;
}

.ray-horizontal {
    top: calc(50% - 2px);
}

.ray-vertical {
    left: calc(50% - 2px);
    width: 4px;
}

.info-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.box-info, .ray-info, .controls {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
}

h3 {
    margin-bottom: 10px;
    color: #333;
}

.box-item, .ray-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.box-icon {
    width: 40px;
    height: 40px;
}

.ray-line {
    width: 50px;
    height: 4px;
    border-radius: 2px;
}

.ray-line.alpha {
    background-color: red;
}

.ray-line.beta {
    background-color: blue;
}

.ray-line.gamma {
    background-color: yellow;
}

/* 新增控制容器样式 */
.controls-container {
    text-align: center;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#restart-btn, #back-to-menu-btn {
    background: linear-gradient(to right, #ff4e50, #f9d423);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

#restart-btn::after, #back-to-menu-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

#restart-btn:hover::after, #back-to-menu-btn:hover::after {
    left: 100%;
}

#restart-btn:hover, #back-to-menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

#restart-btn:active, #back-to-menu-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 特效切换按钮 */
#effects-toggle-btn {
    background: linear-gradient(to right, #6a11cb, #2575fc);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

#effects-toggle-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

#effects-toggle-btn:hover::after {
    left: 100%;
}

#effects-toggle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(106, 17, 203, 0.4);
}

#effects-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(106, 17, 203, 0.4);
}

/* 特效禁用时的样式 */
body.effects-disabled .alpha-ray,
body.effects-disabled .beta-ray,
body.effects-disabled .gamma-ray {
    box-shadow: none;
    animation: none;
}

body.effects-disabled .player {
    animation: none;
    filter: none;
}

body.effects-disabled .goal {
    animation: none;
    filter: none;
}

body.effects-disabled .goal::after {
    text-shadow: none;
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(10px);
}

.popup.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(240,240,250,0.95));
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 85%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    transform: scale(0.95);
    border: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.popup.show .popup-content {
    transform: scale(1);
}

#popup-title {
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 22px;
    text-align: center;
    padding: 20px 0;
    background: linear-gradient(to right, #f5f7fa, #c3cfe2);
    margin: -30px -30px 20px -30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#popup-message {
    color: #34495e;
    line-height: 1.7;
    margin-bottom: 25px;
    text-align: left;
    font-size: 16px;
    overflow-wrap: break-word;
    word-break: break-word;
    word-spacing: 1px;
    letter-spacing: 0.2px;
}

#popup-message br {
    display: block;
    content: "";
    margin: 8px 0;
}

.emitter-property {
    display: inline-block;
    font-weight: bold;
    margin-right: 6px;
    color: #333;
}

.field-info {
    margin: 15px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.field-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 17px;
    color: #222;
}

.field-detail {
    margin-bottom: 10px;
    line-height: 1.5;
}

.field-effects {
    margin: 15px 0 15px 10px;
    padding-left: 15px;
}

.field-effects li {
    margin-bottom: 8px;
    list-style-type: none;
    position: relative;
}

.field-effects li:before {
    content: "•";
    color: #4CAF50;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    font-size: 18px;
}

.field-operation {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
    font-style: italic;
    color: #666;
}

#popup-close {
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    padding: 12px 25px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#popup-close:hover {
    background-color: #3e9742;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#popup-close:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 高亮内容的样式 */
.highlight-alpha {
    color: #FF5252;
    font-weight: bold;
}

.highlight-beta {
    color: #2196F3;
    font-weight: bold;
}

.highlight-gamma {
    color: #FFC107;
    font-weight: bold;
}

.highlight-positive {
    color: #F44336;
    font-weight: bold;
}

.highlight-negative {
    color: #2196F3;
    font-weight: bold;
}

.highlight-neutral {
    color: #FFC107;
    font-weight: bold;
}

.physics-term {
    color: #9C27B0;
    font-weight: bold;
}

.physics-concept {
    color: #009688;
    font-weight: bold;
}

.field-symbol {
    font-size: 1.2em;
    font-weight: bold;
    vertical-align: middle;
    display: inline-block;
    margin: 0 2px;
}

.field-symbol.large {
    font-size: 1.5em;
    margin: 0 4px;
}

.field-direction {
    font-weight: bold;
}

.highlight-box {
    background-color: #f0f0f0;
    padding: 0 5px;
    border-radius: 3px;
    font-weight: bold;
    border: 1px solid #ddd;
}

@media (max-width: 768px) {
    .popup-content {
        width: 92%;
        padding: 20px;
        max-height: 85vh;
    }
    
    #popup-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    #popup-message {
        font-size: 15px;
        line-height: 1.5;
    }
    
    .field-info {
        padding: 12px;
        margin: 12px 0;
    }
    
    .field-effects {
        margin: 10px 0 10px 5px;
        padding-left: 10px;
    }
    
    #popup-close {
        padding: 10px 20px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .popup-content {
        width: 95%;
        padding: 15px;
    }
    
    #popup-title {
        font-size: 18px;
        padding-bottom: 10px;
        margin-bottom: 12px;
    }
    
    #popup-message {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    #popup-message br {
        margin: 6px 0;
    }
    
    .field-title {
        font-size: 16px;
    }
    
    .field-effects li:before {
        font-size: 16px;
    }
}

/* 提示区域样式 - 浮窗模式 */
.tip-container {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(240,240,250,0.95));
    border: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 25px 30px;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 85%;
    width: auto;
    display: flex;
    align-items: flex-start;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(5px);
    animation: none;
    opacity: 0;
    cursor: default;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.tip-container.highlight {
    background-color: rgba(245, 255, 250, 0.97);
    border-color: #00bcd4;
    box-shadow: 0 0 35px rgba(0, 188, 212, 0.4);
}

.tip-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.tip-icon {
    font-size: 32px;
    margin-right: 20px;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.tip-content {
    flex: 1;
    font-size: 16px;
    line-height: 1.8;
    color: #2c3e50;
    font-weight: 500;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.8);
    letter-spacing: 0.2px;
}

.tip-content strong {
    color: #e91e63;
    font-weight: 700;
    padding: 0 2px;
}

.tip-content .highlight-alpha {
    color: #f44336; /* 红色 - Alpha射线 */
    font-weight: 700;
}

.tip-content .highlight-beta {
    color: #2196f3; /* 蓝色 - Beta射线 */
    font-weight: 700;
}

.tip-content .highlight-gamma {
    color: #ffc107; /* 黄色 - Gamma射线 */
    font-weight: 700;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}

.tip-content br {
    content: "";
    display: block;
    margin-top: 8px;
}

/* 添加提示出现动画 */
@keyframes tipAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.tip-appear {
    animation: tipAppear 0.4s ease-out forwards;
    opacity: 1;
}

.controls-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#restart-btn {
    padding: 10px 20px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

#restart-btn:hover {
    background-color: #45a049;
}

/* 射线发射器样式后添加场元素样式 */

.electric-field {
    background-image: url('fixed_svg/field/electric_field.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
    position: relative;
}

.magnetic-field-dot {
    background-image: url('fixed_svg/field/magnetic_field_dot.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
    position: relative;
}

.magnetic-field-cross {
    background-image: url('fixed_svg/field/magnetic_field_cross.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
    position: relative;
}

/* 固定磁场块样式 */
.fixed-magnetic-field {
    border: 3px solid rgba(255, 215, 0, 0.9) !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8) !important;
    background-color: rgba(255, 215, 0, 0.1) !important;
}

.fixed-magnetic-field::before {
    content: '🔒';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
    background: rgba(255, 215, 0, 0.9);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* 场元素控制按钮 */
.field-control-button {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    z-index: 6; /* 确保按钮在其他元素之上 */
    transition: all 0.2s ease;
}

.field-control-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

.cell.electric-field .field-control-button {
    color: #0066cc;
}

.cell.magnetic-field-dot .field-control-button,
.cell.magnetic-field-cross .field-control-button {
    color: #cc3300;
}

/* 旋转类的基本定义（已被后面的全局定义覆盖）
.rotate-0 {
    transform: rotate(0deg);
}

.rotate-90 {
    transform: rotate(90deg);
}

.rotate-180 {
    transform: rotate(180deg);
}

.rotate-270 {
    transform: rotate(270deg);
}
*/

/* 射线拐角样式 */
.ray-corner {
    position: relative;
}

/* 上-右拐角 */
.ray-corner-up-to-right::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 50%;
    border-top-right-radius: 5px;
    border-top: 4px solid;
    border-right: 4px solid;
    border-color: inherit;
}

/* 右-下拐角 */
.ray-corner-right-to-down::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50%;
    height: 50%;
    border-bottom-right-radius: 5px;
    border-bottom: 4px solid;
    border-right: 4px solid;
    border-color: inherit;
}

/* 下-左拐角 */
.ray-corner-down-to-left::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50%;
    height: 50%;
    border-bottom-left-radius: 5px;
    border-bottom: 4px solid;
    border-left: 4px solid;
    border-color: inherit;
}

/* 左-上拐角 */
.ray-corner-left-to-up::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 50%;
    border-top-left-radius: 5px;
    border-top: 4px solid;
    border-left: 4px solid;
    border-color: inherit;
}

/* 上-左拐角 */
.ray-corner-up-to-left::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 50%;
    border-top-left-radius: 5px;
    border-top: 4px solid;
    border-left: 4px solid;
    border-color: inherit;
}

/* 左-下拐角 */
.ray-corner-left-to-down::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50%;
    height: 50%;
    border-bottom-left-radius: 5px;
    border-bottom: 4px solid;
    border-left: 4px solid;
    border-color: inherit;
}

/* 下-右拐角 */
.ray-corner-down-to-right::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50%;
    height: 50%;
    border-bottom-right-radius: 5px;
    border-bottom: 4px solid;
    border-right: 4px solid;
    border-color: inherit;
}

/* 右-上拐角 */
.ray-corner-right-to-up::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 50%;
    border-top-right-radius: 5px;
    border-top: 4px solid;
    border-right: 4px solid;
    border-color: inherit;
}

/* 磁场信息样式 */
.field-info {
    font-family: "微软雅黑", sans-serif;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.field-title {
    font-weight: bold;
    font-size: 1.1em;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.field-detail {
    margin: 10px 0;
    line-height: 1.5;
}

.field-effects {
    margin: 10px 0;
    padding-left: 20px;
}

.field-effects li {
    margin: 5px 0;
    list-style-type: disc;
}

.field-operation {
    margin-top: 12px;
    font-style: italic;
    color: #666;
    border-top: 1px dashed #ccc;
    padding-top: 8px;
}

/* 成功消息样式 */
.success-message {
    max-width: 100%;
    background: linear-gradient(to bottom, #f7f9fc, #edf1f7);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.success-title {
    color: #4caf50;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(76, 175, 80, 0.3);
    padding-bottom: 8px;
}

.physics-fact {
    background-color: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    border-left: 3px solid #2196f3;
    line-height: 1.6;
}

.practical-use {
    background-color: #f0f4c3;
    border-radius: 8px;
    padding: 10px;
    font-style: italic;
    text-align: center;
    color: #33691e;
}

/* 高亮样式 */
.highlight-alpha {
    color: red;
    font-weight: bold;
}

.highlight-beta {
    color: blue;
    font-weight: bold;
}

.highlight-gamma {
    color: #d9a520;
    font-weight: bold;
}

/* 新增：电荷高亮样式 */
.highlight-positive {
    color: red;
    font-weight: bold;
}

.highlight-negative {
    color: blue;
    font-weight: bold;
}

.highlight-neutral {
    color: #d9a520;
    font-weight: bold;
}

/* 新增：物理概念高亮样式 */
.physics-term {
    color: #9c27b0;
    font-weight: bold;
}

.physics-concept {
    color: #009688;
    font-weight: bold;
}

/* 磁场符号样式 */
.field-symbol {
    display: inline-block;
    font-weight: bold;
    font-size: 1.2em;
    color: #d32f2f;
    text-shadow: 0px 1px 2px rgba(0,0,0,0.2);
}

.field-symbol.large {
    font-size: 1.5em;
    margin-left: 10px;
    vertical-align: middle;
}

.field-direction {
    font-weight: bold;
    color: #1565c0;
    position: relative;
    padding: 0 3px;
}

/* 高亮盒子样式 */
.highlight-box {
    display: inline-block;
    background-color: #f5f5f5;
    padding: 1px 5px;
    border-radius: 3px;
    border-left: 3px solid #4caf50;
    font-weight: bold;
    color: #333;
    margin: 0 2px;
    white-space: nowrap;
}

/* 添加科普弹窗遮罩背景 */
body.science-popup-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

/* 美化科普弹窗内容 */
.science-popup {
    max-width: 100%;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin: 10px 0;
    border-left: 4px solid #3498db;
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.science-popup::-webkit-scrollbar {
    width: 6px;
}

.science-popup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.science-popup::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 10px;
}

.science-title {
    font-weight: bold;
    font-size: 18px;
    color: #2980b9;
    margin-bottom: 15px;
    text-align: center;
    position: sticky;
    top: 0;
    background: #fff;
    padding: 10px 0;
    z-index: 1;
    border-bottom: 1px solid #eee;
}

.science-image {
    text-align: center;
    margin: 15px 0;
}

.science-image img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.science-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    padding-bottom: 10px;
    text-indent: 2em; /* 首行缩进两个字符 */
}

.science-content strong {
    color: #e74c3c;
    font-weight: bold;
}

.science-content br {
    display: block;
    margin: 8px 0;
    content: "";
}

/* 科普内容高亮样式 */
.science-highlight {
    color: #e74c3c;
    font-weight: bold;
}

.science-concept {
    color: #9b59b6;
    font-weight: bold;
}

.science-application {
    color: #27ae60;
    font-weight: bold;
}

/* 自适应调整 */
@media (max-width: 768px) {
    .science-popup {
        max-height: 70vh;
        padding: 15px;
    }
    
    .science-title {
        font-size: 16px;
        padding: 8px 0;
    }
    
    .science-content {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .science-image img {
        max-height: 180px;
    }
}

/* 提示容器样式增强 */
.tip-container {
    max-height: 85vh;
    overflow-y: auto;
    scrollbar-width: thin;
    z-index: 1001;
    background-color: white;
}

.tip-container::-webkit-scrollbar {
    width: 6px;
}

.tip-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tip-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .tip-container {
        max-width: 90%;
        max-height: 75vh;
        padding: 20px 25px;
        line-height: 1.6;
        white-space: normal;
        word-wrap: break-word;
        word-break: normal;
    }
    
    .tip-content {
        font-size: 15px;
        line-height: 1.6;
        letter-spacing: 0;
        white-space: normal;
        text-align: left;
        word-break: normal;
    }
    
    .tip-content br {
        display: block;
        content: "";
        margin-bottom: 0.5em;
    }
}

/* 美化游戏首页 */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden;
}

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

.splash-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    color: white;
    text-align: center;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.splash-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 80%);
    animation: shiftLight 8s infinite linear;
    z-index: -1;
}

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

.game-title {
    font-size: 3rem;
    margin-bottom: 0.5em;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    text-shadow: 0 0 15px rgba(255, 50, 50, 0.8);
}

.subtitle {
    display: block;
    font-size: 1.8rem;
    color: #FF9F1C;
    margin-top: 8px;
    position: relative;
}

.slogan {
    font-style: italic;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
}

.story-background {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 40px;
    line-height: 1.6;
    border-left: 3px solid #FF9F1C;
}

.buttons-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.splash-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

.splash-btn:hover::after {
    left: 100%;
}

.primary-btn {
    background: linear-gradient(to right, #FF4E50, #F9D423);
    color: white;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
}

.ray-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
}

.alpha-ray-decor, .beta-ray-decor, .gamma-ray-decor {
    position: absolute;
    height: 2px;
    animation: rayAnimate 8s infinite;
    opacity: 0.4;
}

.alpha-ray-decor {
    background: linear-gradient(90deg, transparent, #ff0000, transparent);
    width: 40%;
    top: 25%;
    left: -10%;
    animation-delay: 0s;
}

.beta-ray-decor {
    background: linear-gradient(90deg, transparent, #0066ff, transparent);
    width: 60%;
    top: 65%;
    right: -20%;
    animation-delay: 1s;
}

.gamma-ray-decor {
    background: linear-gradient(90deg, transparent, #ffff00, transparent);
    width: 50%;
    top: 45%;
    left: 10%;
    animation-delay: 2s;
}

@keyframes rayAnimate {
    0% { transform: translateX(-100%) scaleY(1); opacity: 0; }
    50% { transform: translateX(100%) scaleY(3); opacity: 0.8; }
    100% { transform: translateX(300%) scaleY(1); opacity: 0; }
}

.how-to-play-content {
    background: rgba(20, 20, 30, 0.95);
    color: #f0f0f0;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
}

.manual-content {
    text-align: left;
    max-height: 50vh;
    overflow-y: auto;
    padding: 0 20px;
}

.manual-section {
    margin-bottom: 25px;
}

.manual-section h3 {
    color: #FF9F1C;
    border-bottom: 1px solid rgba(255, 159, 28, 0.3);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.key-hint {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    margin: 0 3px;
    font-family: monospace;
    font-weight: bold;
}

.ray-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
}

.ray-sample {
    width: 30px;
    height: 30px;
    margin-right: 15px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ray-sample.alpha {
    background: linear-gradient(135deg, #ff0000, #ff6666);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.ray-sample.beta {
    background: linear-gradient(135deg, #0066ff, #66a3ff);
    box-shadow: 0 0 10px rgba(0, 102, 255, 0.5);
}

.ray-sample.gamma {
    background: linear-gradient(135deg, #ffff00, #ffff99);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

.popup-button {
    background: linear-gradient(to right, #FF4E50, #F9D423);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    font-weight: bold;
    letter-spacing: 1px;
}

.popup-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 移动端样式适配 */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.4rem;
    }
    
    .splash-content {
        padding: 25px 15px;
    }
    
    .buttons-container {
        flex-direction: column;
        gap: 15px;
    }
    

    
    .splash-btn {
        width: 80%;
        margin: 0 auto;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .story-background {
        padding: 15px;
        font-size: 0.9rem;
    }
    
    .slogan {
        font-size: 1rem;
    }
    
    .game-board {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, var(--cell-size, 32px)) !important; /* 使用自动填充，每列宽度固定 */
        min-width: min-content !important;
        width: auto !important;
        max-width: none !important;
        overflow-x: auto !important;
        justify-content: start !important;
        transform: none !important;
        margin: 10px auto !important;
        padding: 5px !important;
        grid-auto-flow: row !important;
    }
    
    .game-container {
        padding: 10px !important;
        overflow-x: auto !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* 确保游戏板不会被父容器限制宽度 */
    .header, .controls-container {
        max-width: 100% !important;
        overflow-x: visible !important;
    }
    
    /* 确保单元格大小统一 */
    .cell {
        min-width: var(--cell-size, 32px) !important;
        min-height: var(--cell-size, 32px) !important;
    }
    
    .level-selector {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .level-btn {
        margin: 5px;
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* 虚拟方向键 */
.virtual-controls {
    display: none; /* 默认不显示 */
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 150px;
    height: 150px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 180px;
    height: 180px;
    backdrop-filter: blur(5px);
    bottom: 30px;
    left: 30px;
}

.v-btn {
    position: absolute;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.15));
    border: 2px solid rgba(255,255,255,0.4);
    color: white;
    font-size: 30px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.v-btn:active {
    background: linear-gradient(135deg, rgba(255,78,80,0.8), rgba(249,212,35,0.8));
    transform: scale(0.9);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.v-up {
    top: 0;
    left: 50px;
}

.v-right {
    top: 50px;
    left: 100px;
}

.v-down {
    top: 100px;
    left: 50px;
}

.v-left {
    top: 50px;
    left: 0;
}

@media (max-width: 768px) {
    .virtual-controls {
        display: block !important; /* 确保在移动设备上一定显示 */
    }
    
    /* 确保移动端游戏板显示正确 */
    .game-board {
        max-width: 100%;
        overflow: visible;
        margin: 0 auto;
        transform: none;
        gap: 1px !important; /* 强制最小间隙 */
    }
    
    /* 适配游戏板大小 */
    .game-container {
        padding: 10px;
    }
    
    /* 修复移动端图形适配问题 */
    .cell {
        transform: none;
        margin: 0;
        width: var(--cell-size, 32px) !important;
        height: var(--cell-size, 32px) !important;
    }
    
    /* 确保移动端所有元素保持原始方向 */
    .alpha-emitter, .beta-emitter, .gamma-emitter {
        transform-origin: center center;
    }
    
    /* 确保在移动端上方向正确 */
    .rotate-0 {
        transform: rotate(0deg) !important;
    }
    
    .rotate-90 {
        transform: rotate(90deg) !important;
    }
    
    .rotate-180 {
        transform: rotate(180deg) !important;
    }
    
    .rotate-270 {
        transform: rotate(270deg) !important;
    }
    
    /* 提高图像的清晰度和适配性 */
    .cell > * {
        background-size: 85% !important;
        background-position: center center !important;
    }
}

.radiation-symbol {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
    background-color: #ff0;
    border-radius: 50%;
    box-shadow: 0 0 20px #ff0;
    animation: glowPulse 3s infinite;
}

.radiation-symbol::before {
    content: "☢";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 50px;
    color: #000;
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 20px #ff0; }
    50% { box-shadow: 0 0 40px #ff0; }
    100% { box-shadow: 0 0 20px #ff0; }
}

.game-logo {
    margin-bottom: 20px;
}

/* 粒子背景 */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

/* 装饰图标 */
.icon-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
}

.icon {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.3;
    animation: floatIcon 6s infinite ease-in-out;
}

.box-icon {
    background-image: url('fixed_svg/box/lead_box.svg');
    background-size: contain;
    background-repeat: no-repeat;
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.alpha-icon {
    background-color: red;
    border-radius: 50%;
    bottom: 15%;
    left: 15%;
    animation-delay: 1s;
    width: 20px;
    height: 20px;
}

.beta-icon {
    background-color: blue;
    border-radius: 50%;
    top: 25%;
    left: 10%;
    animation-delay: 2s;
    width: 25px;
    height: 25px;
}

.gamma-icon {
    background-color: yellow;
    border-radius: 50%;
    bottom: 20%;
    right: 15%;
    animation-delay: 3s;
    width: 15px;
    height: 15px;
}

@keyframes floatIcon {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(10deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* 添加精美的射线粒子效果 */
.ray-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    animation: particleAnimation 1.5s linear infinite;
}

.alpha-particle {
    background: radial-gradient(circle, rgba(255,0,0,1) 0%, rgba(255,0,0,0) 70%);
    box-shadow: 0 0 10px rgba(255,0,0,0.8);
}

.beta-particle {
    background: radial-gradient(circle, rgba(0,0,255,1) 0%, rgba(0,0,255,0) 70%);
    box-shadow: 0 0 10px rgba(0,0,255,0.8);
}

.gamma-particle {
    background: radial-gradient(circle, rgba(255,255,0,1) 0%, rgba(255,255,0,0) 70%);
    box-shadow: 0 0 10px rgba(255,255,0,0.8);
}

@keyframes particleAnimation {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* 横屏提示样式 */
.orientation-tip {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999; /* 最高优先级 */
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.orientation-content {
    background-color: #222;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 128, 255, 0.6);
    border: 1px solid #0066cc;
    max-width: 80%;
}

.orientation-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.orientation-message {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.orientation-btn {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.orientation-btn:hover {
    background-color: #0055aa;
}

/* 修复全屏弹窗的显示问题 */
#how-to-play-popup {
    z-index: 2000;
}

/* 确保所有弹窗能正确显示 */
.popup.show {
    opacity: 1;
    visibility: visible;
}

/* 移动设备专用样式 */
.mobile-device .game-board {
    gap: 1px !important;
    max-width: none !important;  /* 移除最大宽度限制 */
    width: auto !important;      /* 让容器宽度自适应内容 */
    overflow-x: auto !important; /* 允许水平滚动 */
    overflow-y: visible !important; 
    justify-content: start !important; /* 确保从左侧开始对齐 */
    display: grid !important;    /* 强制使用网格布局 */
    padding: 5px !important;
    grid-auto-flow: row !important; /* 确保行优先填充 */
    grid-template-columns: repeat(auto-fit, var(--cell-size, 32px)) !important; /* 使用auto-fit确保填充所有空间 */
    grid-auto-columns: var(--cell-size, 32px) !important; /* 确保自动创建的列使用相同尺寸 */
    min-width: min-content !important; /* 确保宽度至少包含所有内容 */
    transform: none !important; /* 防止变换干扰布局 */
}

/* 游戏容器在移动设备上的样式 */
.mobile-device .game-container {
    padding: 5px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    max-width: 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* 添加移动端关卡选择器的水平滚动布局 */
.mobile-device .level-selector {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 8px;
    padding: 8px 4px;
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
}

.mobile-device .level-selector::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.mobile-device .level-btn {
    flex: 0 0 auto;
    margin-right: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

/* 修复移动设备上的元素方向问题 */
.mobile-device .alpha-emitter,
.mobile-device .beta-emitter,
.mobile-device .gamma-emitter {
    transform-origin: center center !important;
    position: relative !important;
    display: inline-block !important;
    width: 100% !important;
    height: 100% !important;
}

/* 强制应用正确的方向 */
/* 确保移动设备和PC上的旋转行为一致 */
.rotate-0, .mobile-device .rotate-0 { transform: rotate(0deg) !important; transform-origin: center center !important; }
.rotate-90, .mobile-device .rotate-90 { transform: rotate(90deg) !important; transform-origin: center center !important; }
.rotate-180, .mobile-device .rotate-180 { transform: rotate(180deg) !important; transform-origin: center center !important; }
.rotate-270, .mobile-device .rotate-270 { transform: rotate(270deg) !important; transform-origin: center center !important; }

/* 添加直接方向样式类，用于内联样式覆盖 */
[data-rotation="0"] { transform: rotate(0deg) !important; }
[data-rotation="90"] { transform: rotate(90deg) !important; }
[data-rotation="180"] { transform: rotate(180deg) !important; }
[data-rotation="270"] { transform: rotate(270deg) !important; }

/* 修复发射器样式层叠问题 */
.alpha-emitter, .beta-emitter, .gamma-emitter {
    transform-origin: center center !important;
}

/* 移动设备上的发射器强制样式 */
.mobile-device .alpha-emitter,
.mobile-device .beta-emitter,
.mobile-device .gamma-emitter {
    transform-origin: center center !important;
    position: relative !important;
    display: inline-block !important;
    width: 100% !important;
    height: 100% !important;
}

/* 确保单元格尺寸一致 */
.mobile-device .cell {
    min-width: var(--cell-size, 32px) !important;
    min-height: var(--cell-size, 32px) !important;
    width: var(--cell-size, 32px) !important;
    height: var(--cell-size, 32px) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    position: relative !important;
    transform: none !important;
}

/* 优化射线显示 */
.mobile-device .alpha-ray,
.mobile-device .beta-ray,
.mobile-device .gamma-ray {
    position: absolute !important;
    z-index: 3 !important;
}

/* 确保背景图像正确显示 */
.mobile-device .cell > * {
    background-size: 85% !important;
    background-position: center center !important;
}

.mobile-device .virtual-controls {
    position: fixed;
    bottom: 30px;
    right: 30px; /* 放在右下角，避免遮挡游戏视图 */
    width: 160px;
    height: 160px;
    z-index: 1000; /* 提高层级确保显示 */
    background: rgba(0, 0, 0, 0.25);
    border-radius: 50%;
    backdrop-filter: blur(5px);
    opacity: 0.9;
    display: flex !important; /* 强制显示 */
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 进度条样式 */
.progress-container {
    display: flex;
    align-items: center;
    margin: 15px 0;
    width: 100%;
    max-width: 500px;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    overflow: hidden;
    margin-right: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.progress-text {
    font-size: 14px;
    color: #fff;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

/* 当前关卡显示 */
.current-level-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    color: #fff;
    font-weight: bold;
    margin: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#current-level-text {
    background: linear-gradient(to right, #FFEB3B, #FFC107);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: bold;
    margin-left: 5px;
}

/* 大关说明弹窗样式 */
.section-intro {
    max-width: 700px;
    width: 90%;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #1a2a6c, #2a3a7c);
    color: #fff;
}

#section-title {
    background: linear-gradient(135deg, #1a2a6c, #654ea3);
    color: #fff;
    margin: 0;
    padding: 20px;
    text-align: center;
    font-size: 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.section-description {
    padding: 20px 30px;
    line-height: 1.6;
    font-size: 16px;
}

.section-image {
    text-align: center;
    margin: 20px 0;
}

.section-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#section-points {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 30px;
    border-radius: 8px;
    margin: 20px 0;
}

#section-points li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 25px;
}

#section-points li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-size: 20px;
    line-height: 1;
}

#section-intro-close {
    width: 100%;
    padding: 15px;
    background: linear-gradient(to right, #4CAF50, #8BC34A);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#section-intro-close:hover {
    background: linear-gradient(to right, #43A047, #7CB342);
}

/* 关卡完成弹窗样式 */
.level-complete {
    background: linear-gradient(135deg, #1a2a6c, #2a3a7c);
    color: #fff;
    max-width: 500px;
}

.level-complete h2 {
    color: #FFEB3B;
    text-align: center;
    margin-top: 10px;
    font-size: 30px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.level-complete-message {
    text-align: center;
    margin: 20px 0;
}

.level-stats {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
}

.stat-label {
    color: #BBDEFB;
}

#total-progress {
    font-weight: bold;
    color: #4CAF50;
}

.level-complete-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.level-complete-buttons button {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.popup-button.primary {
    background: linear-gradient(to right, #4CAF50, #8BC34A);
    color: white;
}

.popup-button.primary:hover {
    background: linear-gradient(to right, #43A047, #7CB342);
    transform: translateY(-2px);
}

.popup-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.popup-button.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .progress-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .progress-bar {
        margin-right: 0;
        margin-bottom: 5px;
        height: 14px;
        border: 2px solid rgba(255, 255, 255, 0.4);
    }
    
    .progress-fill {
        background: linear-gradient(to right, #4CAF50, #8BC34A);
        height: 100%;
        min-height: 10px;
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
    }
    
    .progress-text {
        text-align: center;
        font-size: 16px;
        margin-top: 5px;
        color: #4CAF50;
    }
    
    .current-level-display {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    #section-title {
        font-size: 20px;
        padding: 15px;
    }
    
    .section-description {
        padding: 15px;
        font-size: 14px;
    }
    
    #section-points {
        padding: 10px 20px;
    }
    
    .level-complete h2 {
        font-size: 24px;
    }
    
    .level-complete-buttons {
        flex-direction: column;
        gap: 10px;
    }
}

/* 关卡选择弹窗样式 */
.level-select {
    background: linear-gradient(135deg, #1a2a6c, #2a3a7c);
    color: #fff;
    max-width: 600px;
    padding: 0;
    overflow: hidden;
}

.level-select h2 {
    background: linear-gradient(135deg, #1a2a6c, #654ea3);
    color: #fff;
    margin: 0;
    padding: 20px;
    text-align: center;
    font-size: 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.level-select-container {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.level-select-container::-webkit-scrollbar {
    width: 8px;
}

.level-select-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.level-select-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.level-select-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.level-section {
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
}

.level-section h3 {
    color: #FFEB3B;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.level-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.level-select-btn {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
    font-weight: bold;
}

.level-select-btn.unlocked {
    background: linear-gradient(to right, rgba(76, 175, 80, 0.3), rgba(76, 175, 80, 0.1));
    color: white;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.level-select-btn.completed {
    background: linear-gradient(to right, rgba(76, 175, 80, 0.6), rgba(76, 175, 80, 0.4));
    color: white;
    border: 1px solid rgba(76, 175, 80, 0.6);
}

.level-select-btn.current {
    background: linear-gradient(to right, #FF4E50, #F9D423);
    color: white;
    border: 1px solid rgba(255, 159, 28, 0.6);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 159, 28, 0.3);
}

.level-select-btn:hover {
    transform: translateY(-2px);
}

.level-select-info {
    margin: 20px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 14px;
    color: #BBB;
}

.level-select-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.level-select-actions button {
    flex: 1;
}

#level-select-btn {
    background: linear-gradient(to right, #9C27B0, #673AB7);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

#level-select-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

#level-select-btn:hover::after {
    left: 100%;
}

#level-select-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(156, 39, 176, 0.4);
}

#level-select-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(156, 39, 176, 0.4);
}

@media (max-width: 768px) {
    .level-select {
        width: 95%;
    }
    
    .level-section h3 {
        font-size: 18px;
    }
    
    .level-buttons {
        gap: 8px;
    }
    
    .level-select-btn {
        padding: 8px 15px;
        min-width: 80px;
        font-size: 14px;
    }
    
    .level-select-actions {
        flex-direction: column;
    }
}

/* 游戏通关弹窗样式 */
.game-complete {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    background: linear-gradient(135deg, #071636 0%, #123068 100%);
    border: 2px solid #ffca28;
    box-shadow: 0 0 30px rgba(255, 202, 40, 0.5);
    color: #ffffff;
    border-radius: 15px;
}

.completion-header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

.completion-title {
    font-size: 32px;
    color: #ffca28;
    margin-bottom: 15px;
}

.completion-badge {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background-image: url('pic/5.webp');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    border: 3px solid #ffca28;
    box-shadow: 0 0 15px rgba(255, 202, 40, 0.6);
}

.completion-message {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 3px solid #4CAF50;
}

.congrats-text {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.story-conclusion {
    font-style: italic;
    color: #bbdefb;
    padding: 10px 15px;
    border-radius: 5px;
    background-color: rgba(25, 118, 210, 0.3);
}

.knowledge-summary {
    background-color: rgba(38, 50, 56, 0.6);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.knowledge-summary h3 {
    color: #4CAF50;
    font-size: 24px;
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px dashed rgba(76, 175, 80, 0.5);
    padding-bottom: 10px;
}

.ray-summary-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 15px;
    margin-bottom: 20px;
}

.ray-summary {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.alpha-summary {
    background-color: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
}

.beta-summary {
    background-color: rgba(33, 150, 243, 0.2);
    border: 1px solid rgba(33, 150, 243, 0.5);
}

.gamma-summary {
    background-color: rgba(255, 235, 59, 0.2);
    border: 1px solid rgba(255, 235, 59, 0.5);
}

.ray-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

.alpha-icon {
    background-color: rgba(244, 67, 54, 0.8);
    color: white;
}

.beta-icon {
    background-color: rgba(33, 150, 243, 0.8);
    color: white;
}

.gamma-icon {
    background-color: rgba(255, 235, 59, 0.8);
    color: black;
}

.ray-details h4 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 18px;
}

.ray-details ul {
    margin: 0;
    padding-left: 20px;
}

.ray-details li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.core-concept {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    line-height: 1.6;
    border-left: 3px solid #ffca28;
}

.completion-footer {
    text-align: center;
    margin-top: 25px;
}

.thanks-message {
    font-size: 16px;
    color: #81c784;
    margin-bottom: 20px;
}

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

/* 动画效果 */
@keyframes glow {
    from {
        text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #ffca28, 0 0 20px #ffca28;
    }
    to {
        text-shadow: 0 0 10px #fff, 0 0 15px #ffe082, 0 0 20px #ffe082, 0 0 25px #ffe082;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .game-complete {
        padding: 20px;
    }
    
    .completion-title {
        font-size: 24px;
    }
    
    .ray-summary-container {
        flex-direction: column;
    }
    
    .ray-summary {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .completion-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .completion-buttons button {
        width: 100%;
    }
}

/* 通关任务栏样式 */
.mission-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.mission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    user-select: none;
}

.mission-title {
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.mission-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.mission-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.mission-content {
    padding: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    transition: all 0.3s ease;
    max-height: 200px;
    overflow-y: auto;
}

.mission-content.collapsed {
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
}

.mission-objective {
    font-size: 15px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    padding: 10px;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    border-radius: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.mission-tips {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    padding: 8px 12px;
    background: #f8f9fa;
    border-left: 4px solid #ffd700;
    border-radius: 4px;
    margin-top: 8px;
}

.mission-tips::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 8px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .mission-panel {
        margin: 8px 0;
    }
    
    .mission-header {
        padding: 10px 12px;
    }
    
    .mission-title {
        font-size: 14px;
    }
    
    .mission-toggle {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .mission-content {
        padding: 12px;
    }
    
    .mission-objective {
        font-size: 14px;
        padding: 8px;
    }
    
    .mission-tips {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* 失败提示样式 */
.failure-hint {
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.failure-reason {
    background: #ffebee;
    border-left: 4px solid #f44336;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 4px;
    color: #c62828;
    font-size: 14px;
    line-height: 1.5;
}

.hint-steps {
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 4px;
    color: #2e7d32;
}

.hint-steps strong {
    color: #1b5e20;
    display: block;
    margin-bottom: 8px;
}

.hint-steps ol {
    margin: 0;
    padding-left: 20px;
}

.hint-steps li {
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.hint-note {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 10px;
    border-radius: 4px;
    color: #ef6c00;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 768px) {
    .failure-reason,
    .hint-steps,
    .hint-note {
        padding: 10px;
        font-size: 13px;
    }
    
    .hint-steps li {
        font-size: 13px;
    }
}