微件

配队模拟器:修订间差异

来自卡厄思梦境WIKI

律Rhyme留言 | 贡献
无编辑摘要
律Rhyme留言 | 贡献
无编辑摘要
第707行: 第707行:
}
}


/* 防止模态框内容溢出 */
/* 修复灵光一闪和神光一闪视图的居中问题 */
.inspiration-view,
.inspiration-view,
.god-inspiration-view {
.god-inspiration-view {
     max-height: 70vh;
     max-height: 70vh;
     overflow-y: auto;
     overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
}
/* 确保变体容器正确布局 */
.inspiration-variants-container,
.god-groups-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
/* 灵光一闪变体容器 */
.inspiration-variant {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* 神光一闪组容器 */
.god-group {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* 神光一闪变体卡片容器 */
.god-variants-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}
.god-variant-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* 修复返回按钮不遮挡内容 */
.card-modal-content {
    position: relative;
    padding-top: 60px !important; /* 为返回按钮留出空间 */
}
.card-modal .modal-back-button {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1001;
}
/* 确保卡牌列表不被遮挡 */
.inspiration-view > *:first-child,
.god-inspiration-view > *:first-child {
    margin-top: 0;
}
}
</style>
</style>

2025年10月19日 (日) 17:31的版本

<script> (function() {

   // 等待DOM加载完成
   function initTeamSimulator() {
       // 保存当前选择的战斗员名称
       var currentCharacterName = null;
       var cardIdCounter = 0; // 用于生成唯一ID
       var selectedCards = {}; // 记录每个卡牌的状态
       // 点击角色槽位显示选择窗口
       document.getElementById('character-slot').addEventListener('click', function() {
           document.getElementById('character-modal').style.display = 'block';
       });
       
       // 关闭角色选择窗口
       document.getElementById('close-character-modal').addEventListener('click', function() {
           document.getElementById('character-modal').style.display = 'none';
       });
       
       // 点击遮罩层关闭窗口
       document.getElementById('character-modal').addEventListener('click', function(e) {
           if (e.target === this) {
               this.style.display = 'none';
           }
       });
       
       // 加载战斗员卡牌
       function loadCharacterCards(characterName) {
           if (!characterName) {
               console.error('战斗员名称为空');
               return;
           }
           
           currentCharacterName = characterName;
           console.log('加载战斗员卡牌:', characterName);
           
           // 清空卡组区域并显示加载中
           var deckArea = document.getElementById('deck-area');

deckArea.innerHTML = '

加载中...

';

           // 通过API调用模块获取卡牌HTML
           var apiUrl = mw.util.wikiScript('api');
           var params = {
               action: 'parse',
               format: 'json',
               text: '错误: 找不到模块 "Module:卡牌/' + characterName + '"',
               contentmodel: 'wikitext',
               disablelimitreport: true,
               wrapoutputclass: 
           };
           
           fetch(apiUrl + '?' + new URLSearchParams(params))
               .then(response => response.json())
               .then(data => {
                   if (data.parse && data.parse.text) {
                       deckArea.innerHTML = data.parse.text['*'];
                       deckArea.style.border = 'none';
                       deckArea.style.padding = '10px';
                       
                       // 重置
                       selectedCards = {};
                       cardIdCounter = 0;
                       
                       // 为每张卡牌添加功能
                       setTimeout(function() {
                           initializeCardFeatures();
                       }, 100);
                   } else {

deckArea.innerHTML = '

加载卡牌失败

';

                   }
               })
               .catch(error => {
                   console.error('加载卡牌失败:', error);

deckArea.innerHTML = '

加载卡牌出错:' + error.message + '

';

               });
       }
       
       // 初始化卡牌功能
       function initializeCardFeatures() {
           var wrappers = document.querySelectorAll('#deck-area .deck-card-wrapper');
           
           wrappers.forEach(function(wrapper) {
               var card = wrapper.querySelector('.card-small-wrapper');
               if (!card) return;
               
               // 给每个wrapper分配唯一ID
               var uniqueId = 'deck-card-' + (++cardIdCounter);
               wrapper.setAttribute('data-unique-id', uniqueId);
               
               // 记录原始状态
               selectedCards[uniqueId] = {
                   module: wrapper.getAttribute('data-module') || currentCharacterName,
                   cardName: wrapper.getAttribute('data-card'),
                   variantType: null,
                   variantParam: null,
                   variantIndex: null
               };
               
               // 添加删除按钮
               if (!card.querySelector('.card-delete-btn')) {
                   var deleteBtn = document.createElement('div');
                   deleteBtn.className = 'card-delete-btn';
                   deleteBtn.innerHTML = '×';
                   deleteBtn.style.cssText = 'position:absolute;top:5px;right:5px;width:20px;height:20px;background:rgba(255,0,0,0.7);color:white;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:100;font-size:16px;line-height:1;font-weight:bold;';
                   
                   deleteBtn.addEventListener('click', function(e) {
                       e.stopPropagation();
                       wrapper.remove();
                       delete selectedCards[uniqueId];
                   });
                   
                   card.style.position = 'relative';
                   card.appendChild(deleteBtn);
               }
           });
           
           // 全局监听卡牌模态框的显示
           setupGlobalModalListener();
       }
       
       // 设置全局模态框监听器
       function setupGlobalModalListener() {
           // 移除之前的全局监听器
           if (window.deckModalObserver) {
               window.deckModalObserver.disconnect();
           }
           
           // 创建新的观察器
           window.deckModalObserver = new MutationObserver(function(mutations) {
               mutations.forEach(function(mutation) {
                   if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
                       var modal = mutation.target;
                       if (modal.classList.contains('card-modal') && modal.style.display !== 'none') {
                           // 延迟处理,确保模态框内容已经渲染
                           setTimeout(function() {
                               enhanceActiveModal(modal);
                           }, 100);
                       }
                   }
               });
           });
           
           // 观察所有模态框
           document.querySelectorAll('.card-modal').forEach(function(modal) {
               window.deckModalObserver.observe(modal, { 
                   attributes: true, 
                   attributeFilter: ['style'] 
               });
           });
       }
       
       // 增强当前活动的模态框
       function enhanceActiveModal(modal) {
           // 查找是哪张卡牌打开的模态框
           var cardId = modal.id ? modal.id.replace('-modal', ) : null;
           if (!cardId) return;
           
           // 查找对应的deck卡牌
           var deckCard = null;
           var uniqueId = null;
           
           // 遍历所有deck中的卡牌,找到匹配的那个
           document.querySelectorAll('#deck-area .deck-card-wrapper').forEach(function(wrapper) {
               var wrapperCard = wrapper.querySelector('.card-small-wrapper');
               if (wrapperCard && wrapperCard.getAttribute('data-card-id') === cardId) {
                   deckCard = wrapper;
                   uniqueId = wrapper.getAttribute('data-unique-id');
               }
           });
           
           if (!deckCard || !uniqueId) {
               console.log('未找到对应的deck卡牌');
               return;
           }
           
           var cardData = selectedCards[uniqueId];
           if (!cardData) {
               console.log('未找到卡牌数据:', uniqueId);
               return;
           }
           
           console.log('增强模态框,卡牌:', cardData.cardName);
           
           // 标记已处理
           if (modal.hasAttribute('data-deck-enhanced')) {
               return;
           }
           modal.setAttribute('data-deck-enhanced', 'true');
           
           // 处理灵光一闪
           var inspirationButton = modal.querySelector('.inspiration-button');
           if (inspirationButton) {
               inspirationButton.addEventListener('click', function() {
                   setTimeout(function() {
                       enhanceInspirationView(modal, uniqueId);
                   }, 100);
               });
           }
           
           // 处理神光一闪
           var godButton = modal.querySelector('.god-inspiration-button');
           if (godButton) {
               godButton.addEventListener('click', function() {
                   setTimeout(function() {
                       enhanceGodView(modal, uniqueId);
                   }, 100);
               });
           }
       }
       
       // 关闭模态框并恢复滚动
       function closeModalAndRestoreScroll(modal) {
           // 关闭模态框
           modal.style.display = 'none';
           
           // 移除可能存在的data属性
           modal.removeAttribute('data-deck-enhanced');
           
           // 确保body可以滚动
           document.body.style.overflow = ;
           document.body.style.position = ;
           document.documentElement.style.overflow = ;
           
           // 移除可能存在的其他样式
           document.body.classList.remove('modal-open');
           document.documentElement.classList.remove('modal-open');
           
           // 触发resize事件,有些框架依赖这个
           window.dispatchEvent(new Event('resize'));
       }
       
       // 增强灵光一闪视图
       function enhanceInspirationView(modal, uniqueId) {
           var inspirationView = modal.querySelector('.inspiration-view');
           if (!inspirationView) return;
           
           var cardData = selectedCards[uniqueId];
           if (!cardData) return;
           
           console.log('增强灵光一闪视图,卡牌:', cardData.cardName);
           
           var variants = inspirationView.querySelectorAll('.inspiration-variant');
           variants.forEach(function(variant, index) {
               if (!variant.querySelector('.select-variant-btn')) {
                   var selectBtn = document.createElement('div');
                   selectBtn.className = 'select-variant-btn';
                   selectBtn.innerHTML = '选择此变体';
                   selectBtn.style.cssText = 'margin-top:10px;padding:8px 15px;background:linear-gradient(135deg,#28a745 0%,#218838 100%);color:white;font-size:14px;font-weight:bold;border-radius:6px;cursor:pointer;text-align:center;';
                   
                   selectBtn.addEventListener('click', function() {
                       console.log('选择灵光一闪变体', index + 1, '对于卡牌:', cardData.cardName);
                       replaceCard(uniqueId, '灵光一闪', index + 1);
                       closeModalAndRestoreScroll(modal);
                   });
                   
                   variant.appendChild(selectBtn);
               }
           });
       }
       
       // 增强神光一闪视图
       function enhanceGodView(modal, uniqueId) {
           var godView = modal.querySelector('.god-inspiration-view');
           if (!godView) return;
           
           var cardData = selectedCards[uniqueId];
           if (!cardData) return;
           
           console.log('增强神光一闪视图,卡牌:', cardData.cardName);
           
           var godGroups = godView.querySelectorAll('.god-group');
           godGroups.forEach(function(group) {
               var groupNameEl = group.querySelector('div[style*="color:#ffd36a"]');
               if (!groupNameEl) return;
               
               var groupName = groupNameEl.textContent.trim();
               var variants = group.querySelectorAll('.god-variant-card');
               
               variants.forEach(function(variant, index) {
                   if (!variant.querySelector('.select-variant-btn')) {
                       var selectBtn = document.createElement('div');
                       selectBtn.className = 'select-variant-btn';
                       selectBtn.innerHTML = '选择';
                       selectBtn.style.cssText = 'margin-top:5px;padding:6px 12px;background:linear-gradient(135deg,#28a745 0%,#218838 100%);color:white;font-size:12px;font-weight:bold;border-radius:4px;cursor:pointer;text-align:center;';
                       
                       selectBtn.addEventListener('click', function() {
                           console.log('选择神光一闪变体', groupName, index + 1, '对于卡牌:', cardData.cardName);
                           replaceCard(uniqueId, '神光一闪', groupName, index + 1);
                           closeModalAndRestoreScroll(modal);
                       });
                       
                       variant.appendChild(selectBtn);
                   }
               });
           });
       }
       
       // 替换卡牌
       function replaceCard(uniqueId, variantType, param1, param2) {
           var cardData = selectedCards[uniqueId];
           if (!cardData) {
               console.error('找不到卡牌数据:', uniqueId);
               return;
           }
           
           var wrapper = document.querySelector('[data-unique-id="' + uniqueId + '"]');
           if (!wrapper) {
               console.error('找不到卡牌容器:', uniqueId);
               return;
           }
           
           console.log('替换卡牌:', cardData.cardName, '变体类型:', variantType, '参数:', param1, param2);
           
           // 更新记录
           cardData.variantType = variantType;
           cardData.variantParam = param1;
           cardData.variantIndex = param2;
           
           // 显示加载中
           var oldContent = wrapper.innerHTML;

wrapper.innerHTML = '

加载中...

';

           // 构建invoke调用
           var invokeText = '错误: 找不到模块 "Module:卡牌/' + cardData.module + '"';
           
           console.log('调用文本:', invokeText);
           
           // 通过API获取新卡牌HTML
           var apiUrl = mw.util.wikiScript('api');
           var params = {
               action: 'parse',
               format: 'json',
               text: invokeText,
               contentmodel: 'wikitext',
               disablelimitreport: true
           };
           
           fetch(apiUrl + '?' + new URLSearchParams(params))
               .then(response => response.json())
               .then(data => {
                   if (data.parse && data.parse.text) {
                       wrapper.innerHTML = data.parse.text['*'];
                       
                       // 重新添加删除按钮
                       setTimeout(function() {
                           var newCard = wrapper.querySelector('.card-small-wrapper');
                           if (newCard) {
                               // 添加删除按钮
                               var deleteBtn = document.createElement('div');
                               deleteBtn.className = 'card-delete-btn';
                               deleteBtn.innerHTML = '×';
                               deleteBtn.style.cssText = 'position:absolute;top:5px;right:5px;width:20px;height:20px;background:rgba(255,0,0,0.7);color:white;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:100;font-size:16px;line-height:1;font-weight:bold;';
                               
                               deleteBtn.addEventListener('click', function(e) {
                                   e.stopPropagation();
                                   wrapper.remove();
                                   delete selectedCards[uniqueId];
                               });
                               
                               newCard.style.position = 'relative';
                               newCard.appendChild(deleteBtn);
                           }
                           
                           // 重新设置全局监听
                           setupGlobalModalListener();
                           
                           // 确保滚动恢复
                           document.body.style.overflow = ;
                           document.documentElement.style.overflow = ;
                       }, 100);
                   } else {
                       console.error('API返回数据无效');
                       wrapper.innerHTML = oldContent;
                   }
               })
               .catch(error => {
                   console.error('替换卡牌失败:', error);
                   wrapper.innerHTML = oldContent;
                   // 恢复滚动
                   document.body.style.overflow = ;
                   document.documentElement.style.overflow = ;
               });
       }
       
       // 选择角色 - 使用事件委托
       document.getElementById('character-list').addEventListener('click', function(e) {
           var characterOption = e.target.closest('.character-option');
           if (characterOption) {
               // 获取战斗员名称
               var characterName = characterOption.getAttribute('data-character-name') || 
                                 characterOption.getAttribute('data-name') ||
                                 characterOption.getAttribute('title');
               
               if (!characterName) {
                   var nameEl = characterOption.querySelector('.character-name, [class*="name"]');
                   if (nameEl) characterName = nameEl.textContent.trim();
               }
               
               console.log('选中的战斗员:', characterName);
               
               // 克隆卡片显示
               var clonedCard = characterOption.cloneNode(true);
               clonedCard.classList.remove('character-option');
               clonedCard.style.cursor = 'default';
               
               var characterSlot = document.getElementById('character-slot');
               characterSlot.innerHTML = ;
               characterSlot.appendChild(clonedCard);
               characterSlot.style.border = 'none';
               
               document.getElementById('character-modal').style.display = 'none';
               
               if (characterName) {
                   loadCharacterCards(characterName);
               }
           }
       });
       
       // 伙伴相关代码
       document.getElementById('partner-slot').addEventListener('click', function() {
           document.getElementById('partner-modal').style.display = 'block';
       });
       
       document.getElementById('close-partner-modal').addEventListener('click', function() {
           document.getElementById('partner-modal').style.display = 'none';
       });
       
       document.getElementById('partner-modal').addEventListener('click', function(e) {
           if (e.target === this) {
               this.style.display = 'none';
           }
       });
       
       document.getElementById('partner-list').addEventListener('click', function(e) {
           var partnerOption = e.target.closest('.partner-option');
           if (partnerOption) {
               var partnerId = partnerOption.dataset.partnerId || partnerOption.getAttribute('data-partner-id');
               
               var partnerImg = document.createElement('img');
               partnerImg.src = '/index.php?title=Special:Redirect/file/Portrait_character_wide_' + partnerId + '.png';
               partnerImg.style.width = '150px';
               partnerImg.style.height = '77px';
               partnerImg.style.objectFit = 'cover';
               
               var partnerSlot = document.getElementById('partner-slot');
               partnerSlot.innerHTML = ;
               partnerSlot.appendChild(partnerImg);
               partnerSlot.style.border = 'none';
               
               document.getElementById('partner-modal').style.display = 'none';
           }
       });
       
       // 装备相关代码
       // 装备类型映射
       var equipmentTypes = {
           'weapon-slot': { type: '武器', title: '选择武器' },
           'armor-slot': { type: '装甲', title: '选择装甲' },
           'ring-slot': { type: '戒指', title: '选择戒指' }
       };
       // 当前选择的装备槽位
       var currentEquipmentSlot = null;
       // 装备槽位点击事件
       ['weapon-slot', 'armor-slot', 'ring-slot'].forEach(function(slotId) {
           document.getElementById(slotId).addEventListener('click', function() {
               currentEquipmentSlot = slotId;
               loadEquipmentList(equipmentTypes[slotId]);
           });
       });
       // 加载装备列表
       function loadEquipmentList(equipmentInfo) {
           // 设置标题
           document.getElementById('equipment-modal-title').textContent = equipmentInfo.title;
           
           // 显示加载中
           var equipmentList = document.getElementById('equipment-list');

equipmentList.innerHTML = '

加载中...

';

           // 显示模态框
           document.getElementById('equipment-modal').style.display = 'block';
           
           // 通过API调用模块获取装备HTML
           var apiUrl = mw.util.wikiScript('api');
           var params = {
               action: 'parse',
               format: 'json',

text: '

',

               contentmodel: 'wikitext',
               disablelimitreport: true,
               wrapoutputclass: 
           };
           
           fetch(apiUrl + '?' + new URLSearchParams(params))
               .then(response => response.json())
               .then(data => {
                   if (data.parse && data.parse.text) {
                       equipmentList.innerHTML = data.parse.text['*'];
                       
                       // 为每个装备添加点击事件
                       setTimeout(function() {
                           addEquipmentClickHandlers();
                       }, 100);
                   } else {

equipmentList.innerHTML = '

加载装备失败

';

                   }
               })
               .catch(error => {
                   console.error('加载装备失败:', error);

equipmentList.innerHTML = '

加载装备出错:' + error.message + '

';

               });
       }
       // 为装备添加点击事件
       function addEquipmentClickHandlers() {
           var equipmentCards = document.querySelectorAll('#equipment-list > div > div[style*="position:relative"]');
           
           equipmentCards.forEach(function(card) {
               card.style.cursor = 'pointer';
               card.addEventListener('click', function() {
                   selectEquipment(card);
               });
           });
       }
       // 选择装备
       function selectEquipment(equipmentCard) {
           if (!currentEquipmentSlot) return;
           
           // 克隆装备卡片
           var clonedCard = equipmentCard.cloneNode(true);
           clonedCard.style.cursor = 'default';
           clonedCard.style.margin = '0';
           
           // 调整尺寸以适应槽位
           clonedCard.style.width = '100px';
           clonedCard.style.height = '100px';
           
           // 调整内部元素尺寸
           var innerElements = clonedCard.querySelectorAll('div');
           innerElements.forEach(function(el) {
               if (el.style.width === '124px') el.style.width = '100px';
               if (el.style.height === '124px') el.style.height = '100px';
               if (el.style.width === '112px') el.style.width = '88px';
               if (el.style.height === '112px') el.style.height = '88px';
               if (el.style.width === '110px') el.style.width = '86px';
               if (el.style.height === '110px') el.style.height = '86px';
               if (el.style.top === '7px') el.style.top = '6px';
               if (el.style.left === '7px') el.style.left = '6px';
               if (el.style.top === '6px') el.style.top = '5px';
               if (el.style.left === '6px') el.style.left = '5px';
           });
           
           // 调整图片大小
           var imgs = clonedCard.querySelectorAll('img');
           imgs.forEach(function(img) {
               if (img.style.width === '124px' || img.width === 124) {
                   img.style.width = '100px';
                   img.style.height = '100px';
               }
               if (img.style.width === '112px' || img.width === 112) {
                   img.style.width = '88px';
                   img.style.height = '88px';
               }
           });
           
           // 隐藏或缩小装备名称
           var nameDiv = clonedCard.querySelector('div[style*="bottom"]');
           if (nameDiv) {
               nameDiv.style.fontSize = '10px';
               nameDiv.style.bottom = '2px';
               nameDiv.style.left = '2px';
           }
           
           // 放置到对应槽位
           var slot = document.getElementById(currentEquipmentSlot);
           slot.innerHTML = ;
           slot.appendChild(clonedCard);
           slot.style.border = 'none';
           slot.style.padding = '0';
           
           // 关闭模态框
           document.getElementById('equipment-modal').style.display = 'none';
           currentEquipmentSlot = null;
       }
       // 关闭装备选择窗口
       document.getElementById('close-equipment-modal').addEventListener('click', function() {
           document.getElementById('equipment-modal').style.display = 'none';
           currentEquipmentSlot = null;
       });
       // 点击遮罩层关闭装备窗口
       document.getElementById('equipment-modal').addEventListener('click', function(e) {
           if (e.target === this) {
               this.style.display = 'none';
               currentEquipmentSlot = null;
           }
       });
       // 页面卸载时清理
       window.addEventListener('beforeunload', function() {
           if (window.deckModalObserver) {
               window.deckModalObserver.disconnect();
           }
           // 确保恢复滚动
           document.body.style.overflow = ;
           document.documentElement.style.overflow = ;
       });
       // 监听所有模态框关闭,确保滚动恢复
       setInterval(function() {
           var hasOpenModal = false;
           document.querySelectorAll('.card-modal, #character-modal, #partner-modal, #equipment-modal').forEach(function(modal) {
               if (modal.style.display !== 'none' && modal.style.display !== ) {
                   hasOpenModal = true;
               }
           });
           
           if (!hasOpenModal) {
               // 没有打开的模态框,确保滚动正常
               document.body.style.overflow = ;
               document.documentElement.style.overflow = ;
               document.body.style.position = ;
           }
       }, 500);
   }
   
   // 确保DOM加载完成后执行
   if (document.readyState === 'loading') {
       document.addEventListener('DOMContentLoaded', initTeamSimulator);
   } else {
       initTeamSimulator();
   }

})(); </script>

<style> .character-option:hover {

   transform: scale(1.05);
   box-shadow: 0 4px 8px rgba(0,0,0,0.2);

}

.partner-option {

   cursor: pointer;
   transition: transform 0.2s;

}

.partner-option:hover {

   transform: scale(1.05);
   box-shadow: 0 4px 8px rgba(0,0,0,0.2);

}

.card-delete-btn:hover {

   background: rgba(255,0,0,1) !important;
   transform: scale(1.1);

}

.select-variant-btn {

   transition: all 0.3s;

}

.select-variant-btn:hover {

   opacity: 0.9;
   transform: translateY(-2px);
   box-shadow: 0 6px 12px rgba(0,0,0,0.3);

}

/* 防止模态框影响滚动 */ body.modal-open {

   overflow: auto !important;
   position: static !important;

}

html.modal-open {

   overflow: auto !important;

}

/* 确保模态框正确显示 */ .card-modal {

   position: fixed !important;
   overflow: auto !important;

}

/* 修复可能的滚动问题 */

  1. team-simulator {
   position: relative;
   overflow: visible;

}

.deck-card-wrapper {

   position: relative;

}

/* 确保选择按钮在正确的层级 */ .select-variant-btn {

   position: relative;
   z-index: 10;

}

/* 修复灵光一闪和神光一闪视图的居中问题 */ .inspiration-view, .god-inspiration-view {

   max-height: 70vh;
   overflow-y: auto;
   display: flex;
   flex-direction: column;
   align-items: center;
   padding: 20px 10px;

}

/* 确保变体容器正确布局 */ .inspiration-variants-container, .god-groups-container {

   width: 100%;
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 20px;

}

/* 灵光一闪变体容器 */ .inspiration-variant {

   width: 100%;
   max-width: 600px;
   display: flex;
   flex-direction: column;
   align-items: center;

}

/* 神光一闪组容器 */ .god-group {

   width: 100%;
   max-width: 800px;
   display: flex;
   flex-direction: column;
   align-items: center;

}

/* 神光一闪变体卡片容器 */ .god-variants-row {

   display: flex;
   flex-wrap: wrap;
   justify-content: center;
   gap: 15px;
   margin-top: 10px;

}

.god-variant-card {

   display: flex;
   flex-direction: column;
   align-items: center;

}

/* 修复返回按钮不遮挡内容 */ .card-modal-content {

   position: relative;
   padding-top: 60px !important; /* 为返回按钮留出空间 */

}

.card-modal .modal-back-button {

   position: absolute;
   top: 10px;
   left: 10px;
   z-index: 1001;

}

/* 确保卡牌列表不被遮挡 */ .inspiration-view > *:first-child, .god-inspiration-view > *:first-child {

   margin-top: 0;

} </style>