/* =========================================
   1. 規則說明區
   ========================================= */
.rule-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.rule-box h3 {
    margin-top: 0;
    color: var(--primary-gold, #fbb750);
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.check-list li {
    margin-bottom: 12px;
    color: #ddd;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.check-list i {
    margin-top: 4px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.check-list li div {
    flex: 1;
}

/* NPC 圖片樣式更新 (放大) */
.npc-box {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    display: inline-block;
    /* 讓背景包覆圖片 */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.npc-img-large {
    max-width: 200px;
    /* 電腦版限制最大寬度，避免過大 */
    width: 100%;
    /* 手機版自適應 */
    height: auto;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* 顏色工具 */
.text-gold {
    color: #ffd700;
}

.text-green {
    color: #81c784;
}

.text-blue {
    color: #64b5f6;
}

.highlight {
    color: #ffd700;
    font-weight: bold;
}

/* =========================================
   2. 天賦卡片網格 (Talent Grid)
   ========================================= */
.talent-grid {
    display: grid;
    /* 電腦版：自動適應，一排約 2 個 */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.talent-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s;
    border-top: 4px solid #ccc;
    display: flex;
    flex-direction: column;
}

.talent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 各系配色 */
.tier-defense {
    border-top-color: #795548;
}

.tier-defense .card-header i {
    color: #a1887f;
}

.tier-range {
    border-top-color: #4caf50;
}

.tier-range .card-header i {
    color: #81c784;
}

.tier-magic {
    border-top-color: #2196f3;
}

.tier-magic .card-header i {
    color: #64b5f6;
}

.tier-melee {
    border-top-color: #f44336;
}

.tier-melee .card-header i {
    color: #e57373;
}

.card-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 15px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 圖片群組 (天賦樹圖 + 角色圖) */
.talent-img-group {
    display: flex;
    gap: 15px;
    /* 增加間距 */
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    justify-content: center;
    align-items: flex-end;
    /* 讓圖片底部對齊 */
}

.t-img-box {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.t-img-box .img-label {
    font-size: 0.9rem;
    /* 字體稍微加大 */
    color: #aaa;
    margin-bottom: 8px;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    padding-bottom: 3px;
}

.t-img-box img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);

    /* ★ 關鍵修正：放寬高度限制，讓 190x248 的圖片能完整顯示 */
    max-height: 250px;

    object-fit: contain;
    transition: transform 0.2s;
}

.t-img-box img:hover {
    transform: scale(1.05);
    /* 滑鼠移過去稍微放大 */
}


.talent-list {
    list-style: none;
    padding: 10px 15px;
    margin: 0;
    flex: 1;
}

.talent-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    color: #ccc;
}

.talent-list li:last-child {
    border-bottom: none;
}

.lv-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-gold, #fbb750);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.talent-list li.locked {
    opacity: 0.5;
}

.talent-list li.locked .desc {
    color: #666;
    font-style: italic;
}

/* =========================================
   3. RWD 手機版優化
   ========================================= */
@media (max-width: 768px) {
    .talent-grid {
        grid-template-columns: 1fr;
    }

    /* 手機版圖片稍微縮小，確保併排時不擠壓 */
    .t-img-box img {
        max-height: 100px;
    }

    .npc-img-large {
        max-width: 150px;
    }
}