/* ========================================================== */
/* ==================== 天赋选择样式 ==================== */
/* ========================================================== */

/* 天赋区域容器 */
#talents-section {
    margin-top: 0px;
    margin-bottom: 10px;
    padding: 0px;
    background-color: #2a2a2a;
    border: 0px solid #444;
    border-radius: 5px;
    position: relative;
    z-index: 100; /* 确保天赋栏显示在其他元素之上 */
    
    /* 默认收起状态 */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-10px);
    
    /* 平滑过渡动画 */
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                margin 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                padding 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 天赋栏展开状态 */
#talents-section.expanded {
    max-height: none; /* 移除高度限制，允许内容完全展开 */
    height: auto; /* 自动高度 */
    opacity: 1;
    transform: translateY(0);
    margin-bottom: 5px;
    padding: 0px; /* 增加内边距 */
    /*border: 1px solid #444;*/ /* 恢复边框 */
    /* 调试：添加明显的背景色确保可见性 */
    /*background-color: #2a2a2a !important;*/
    /*box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);*/
    
    /* 确保内容可见 */
    overflow: visible; /* 必须可见以显示容器外扩的发光 */
    z-index: 10; /* 提高层级 */
}

/* 天赋栏收起状态 */
#talents-section.collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    margin-bottom: 0;
}

.talents-header {
    text-align: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.talents-header h3 {
    color: #d1b06b;
    margin: 0;
    font-size: clamp(0.9em, 1.5vw, 1.1em);
    font-weight: bold;
}

/* 天赋槽位容器 */
#talents-slots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: clamp(10px, 2vw, 16px) clamp(6px, 1vw, 10px); /* 进一步减小间距 */
    min-height: clamp(150px, 22vw, 220px); /* 进一步减小最小高度 */
    padding: clamp(10px, 2vw, 16px) clamp(10px, 1.5vw, 14px) clamp(22px, 3.5vw, 32px) clamp(10px, 1.5vw, 14px); /* 进一步减小边距 */
}

/* 天赋槽位容器 - 自适应尺寸 */
.talent-slot-container {
    position: relative;
    margin: clamp(3px, 0.8vw, 6px) auto clamp(18px, 2.5vw, 28px) auto; /* 再次减小间距 */
    width: clamp(44px, 6vw, 60px); /* 再次减小槽位尺寸 */
    height: clamp(44px, 6vw, 60px);
    
    /* 默认状态 */
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: all 0.3s ease;
    
    /* 确保槽位始终可见 */
    min-height: 44px; /* 调整最小尺寸 */
    min-width: 44px;
}

/* 选中容器的外部发光层（非阴影） */
.talent-slot-container.selected::before {
    content: '';
    position: absolute;
    top: 55%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    border: 1px solid rgba(209,176,107,0.55);
    box-shadow: 0 0 8px rgba(209,176,107,0.45);
    background: transparent;
    transform: translate(-50%, -50%) rotate(45deg);
    transform-origin: 50% 50%;
}

/* 当天赋栏展开时的动画效果 */
#talents-section.expanded .talent-slot-container {
    animation: slideInTalent 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 错开动画延迟 - 只在展开时生效 */
#talents-section.expanded .talent-slot-container:nth-child(1) { animation-delay: 0.3s; }
#talents-section.expanded .talent-slot-container:nth-child(2) { animation-delay: 0.4s; }
#talents-section.expanded .talent-slot-container:nth-child(3) { animation-delay: 0.5s; }
#talents-section.expanded .talent-slot-container:nth-child(4) { animation-delay: 0.6s; }

/* 天赋槽位滑入动画 */
@keyframes slideInTalent {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 单个天赋槽位 - 菱形样式 - 自适应尺寸 */
.talent-slot {
    width: clamp(44px, 6vw, 60px); /* 与容器尺寸保持一致 */
    height: clamp(44px, 6vw, 60px);
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1; /* 确保高于容器伪元素的发光层 */
}

/* 外层菱形边框 */
.talent-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #555;
    background-color: #1e1e1e;
    transition: all 0.2s ease;
}

/* 内层菱形边框 */
.talent-slot::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    border: 1px solid #444;
    background: transparent;
    transition: all 0.2s ease;
}

.talent-slot:hover {
    transform: rotate(45deg) scale(1.05);
}

.talent-slot:hover::before {
    border-color: #d1b06b;
    background-color: #3a3a2a;
    /* 透明处理：移除悬停光晕 */
    box-shadow: none;
}

.talent-slot:hover::after {
    border-color: #888;
}

.talent-slot.selected {
    animation: selectPulse 0.5s ease;
}

.talent-slot.selected::before {
    border-color: #b8860b;
    border-width: 2px;
    /* 使用径向渐变实现内发光，避免阴影视觉 */
    background: radial-gradient(closest-side, rgba(209, 176, 107, 0.30) 0%, rgba(209, 176, 107, 0.14) 55%, rgba(209, 176, 107, 0.06) 72%, transparent 78%), #3d3d2d;
    box-shadow: none;
}

.talent-slot.selected::after {
    border-color: #b8860b;
}

/* 选中时的脉冲动画 */
@keyframes selectPulse {
    0% {
        transform: rotate(45deg) scale(1);
    }
    50% {
        transform: rotate(45deg) scale(1.1);
    }
    100% {
        transform: rotate(45deg) scale(1);
    }
}

/* 天赋图标 - 调整到150% */
.talent-slot-icon {
    width: 150%;
    height: 150%;
    background-color: transparent;
    border-radius: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    transform: rotate(-45deg);
    z-index: 2;
    position: absolute;
    /* 提高图标亮度 */
    filter: brightness(1.3) contrast(1.1);
    top: 54%;
    left: 54%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* 确保图标无任何边框效果 */
.talent-slot-icon,
.talent-slot-icon:hover,
.talent-slot-icon:focus,
.talent-slot-icon:active,
.talent-slot.selected .talent-slot-icon {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background-clip: border-box !important;
}

/* 天赋名称文本 */
.talent-slot-text {
    position: absolute;
    top: clamp(62px, 7.6vw, 75px); /* 向下移动一点 */
    left: 50%;
    color: #ccc;
    font-size: clamp(0.8em, 1.2vw, 1em); /* 适当减小字体大小 */
    text-align: center;
    line-height: 1.3;
    white-space: nowrap;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    max-width: clamp(80px, 12vw, 120px); /* 减小最大宽度以适应更紧凑布局 */
    overflow: visible; /* 改为可见，确保文本显示 */
    text-overflow: ellipsis;
}

.talent-slot-container.selected .talent-slot-text {
    color: #d1b06b;
    font-weight: bold;
}

/* 天赋选择弹窗样式 - 自适应 */
.talent-modal-content {
    max-width: clamp(75vw, 70vw, 900px);
    max-height: clamp(95vh, 96vh, 97vh);
    width: 75vw;
    display: flex;
    flex-direction: column;
    border: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    padding: clamp(15px, 2vw, 25px) !important;
    justify-content: center;
    align-items: center;
}



/* 天赋列表容器 - 响应式网格卡片布局 */
.talent-list {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100% - 20px);
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #1e1e1e;
    padding: clamp(15px, 2vw, 25px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(120px, 18vw, 250px), 1fr));
    gap: clamp(15px, 2vw, 25px);
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

/* 单个天赋项 - 自适应卡片样式 */
.talent-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(12px, 1.8vw, 20px);
    border: 2px solid #444;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #2a2a2a;
    min-height: clamp(200px, 28vw, 260px);
    text-align: center;
    width: 100%;
    max-width: clamp(120px, 22vw, 280px);
    margin: 0 auto;
    box-sizing: border-box;
}

.talent-item:hover {
    background-color: #333;
    border-color: #d1b06b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(209, 176, 107, 0.2);
}

/* 天赋图标在卡片中 - 自适应尺寸 */
.talent-item-icon {
    width: clamp(52px, 8.5vw, 85px);
    height: clamp(52px, 8.5vw, 85px);
    background-color: transparent;
    border-radius: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: none;
    flex-shrink: 0;
    transition: none;
    /* 提高图标亮度 */
    filter: brightness(1.3) contrast(1.1);
}

/* 天赋标题容器 - 图标和名称水平排列 */
.talent-item-header {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 12px);
    margin-bottom: clamp(8px, 1vw, 12px);
    width: 100%;
}

/* 天赋信息 */
.talent-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0px;
    width: 100%;
}

.talent-item-name {
    color: #d1b06b;
    font-weight: bold;
    font-size: clamp(1.15em, 1.7vw, 1.35em);
    margin-bottom: 0;
    line-height: 1.3;
    flex: 1;
}

.talent-item-description {
    color: #ccc;
    font-size: clamp(0.8em, 1.1vw, 0.9em);
    line-height: 1.4;
    flex: 1;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    padding: 0;
    margin: 0;
    white-space: normal;
}

/* 数字高亮样式 */
.talent-item-description .highlight-number {
    color: #ffd700; /* 金色高亮 */
    font-weight: bold;
    text-shadow: 0 0 2px rgba(255, 215, 0, 0.3);
}

/* 空状态提示 */
.talent-list-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-style: italic;
}

/* 移除数字高亮样式，统一文本显示 */

/* 加载状态 */
.talent-list-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #d1b06b;
}

.talent-list-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #d1b06b;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 右键取消天赋功能样式 */
.talent-slot-container {
    position: relative;
}

/* 右键提示 */
.talent-slot-container::after {
    content: '右键取消';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #ccc;
    font-size: 0.7em;
    padding: 3px 6px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
}

/* 只有在已选择的天赋槽位悬停时显示提示 */
.talent-slot-container.selected:hover::after {
    opacity: 1;
}

/* 移除动画效果 */
.talent-slot.removing {
    animation: removeFlash 0.5s ease;
}

@keyframes removeFlash {
    0% { opacity: 1; transform: rotate(45deg) scale(1); }
    25% { opacity: 0.5; transform: rotate(45deg) scale(0.9); }
    50% { opacity: 0.3; transform: rotate(45deg) scale(0.8); }
    75% { opacity: 0.6; transform: rotate(45deg) scale(0.95); }
    100% { opacity: 1; transform: rotate(45deg) scale(1); }
}

/* 通知中的天赋移除样式 */
.talent-removed {
    color: #ff6b6b;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(255, 107, 107, 0.3);
}


