/* =========================================
   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; }

.rule-img {
    max-width: 100%;
    margin-top: 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 顏色工具 */
.text-gold { color: #ffd700; }
.text-blue { color: #64b5f6; }
.text-red { color: #ff5252; }
.text-green { color: #81c784; }
.highlight { color: #ffd700; font-weight: bold; }

/* =========================================
   2. 貢獻任務卡片 (Task Cards)
   ========================================= */
.task-grid {
    display: grid;
    /* 電腦版：三欄排列 */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.task-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.task-img {
    /* ★ 修改：高度增加到 260px，以容納 240px 高的圖片 */
    height: 260px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.2);
    padding: 10px; /* 增加內距，避免圖片貼邊 */
}

.task-img img {
    /* ★ 修改：設定高度為 240px，寬度自適應 (保持比例) */
    height: 240px;
    width: auto; 
    max-width: 100%; /* 確保手機版不會超出容器 */
    
    /* ★ 關鍵：改為 contain，讓圖片完整顯示，不會被裁切 */
    object-fit: contain; 
    
    transition: transform 0.3s;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5)); /* 增加陰影，讓視窗截圖更有立體感 */
}

.task-card:hover .task-img img { transform: scale(1.05); }

.task-icon {
    /* ★ 修改：配合圖片高度，也調整為 260px，讓卡片高度一致 */
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.2);
    font-size: 4rem; /* Icon 稍微放大 */
    color: #ef5350;
}

.task-info { padding: 15px; text-align: center; /* 文字置中比較好看 */ }
.task-info h4 { margin: 0 0 5px 0; color: var(--primary-gold, #fbb750); font-size: 1.1rem; }
.task-info p { margin: 0; color: #ccc; font-size: 0.95rem; line-height: 1.5; }

/* =========================================
   3. 血盟等級表格 (Table)
   ========================================= */
.wiki-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.wiki-table th { background: rgba(0, 0, 0, 0.5); padding: 12px 8px; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.1); vertical-align: middle; }
.wiki-table td { padding: 12px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: center; color: #ddd; }

.sub-th { font-size: 0.85rem; color: #aaa; font-weight: normal; }

.lv-badge {
    background: var(--primary-gold, #fbb750);
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9rem;
}

.exp-cell { color: #81c784; font-family: monospace; font-weight: bold; }

/* =========================================
   4. RWD 手機版優化
   ========================================= */
@media (max-width: 768px) {
    /* 表格轉卡片模式 */
    .wiki-table thead { display: none; }
    .wiki-table, .wiki-table tbody, .wiki-table tr, .wiki-table td { display: block; width: 100%; }
    
    .wiki-table tr {
        margin-bottom: 15px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding-bottom: 10px;
    }
    
    /* 等級標題列 (卡片頭) */
    .clan-table td.lv-cell {
        background: rgba(0, 0, 0, 0.3);
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 10px;
    }
    
    /* 內容列 (Flex 左右排列) */
    .clan-table td {
        display: flex;
        justify-content: space-between;
        padding: 8px 15px;
        text-align: right;
        border-bottom: 1px dashed rgba(255,255,255,0.05);
    }
    
    .clan-table td:last-child { border-bottom: none; }
    
    .clan-table td::before {
        content: attr(data-label);
        color: #aaa;
        font-weight: normal;
    }
}