/* =========================================
   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 {
    margin-top: 10px;
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 顏色工具 */
.text-gold { color: #ffd700; }
.text-green { color: #81c784; }
.text-blue { color: #64b5f6; }
.text-red { color: #ff5252; }
.highlight { color: #ffd700; font-weight: bold; }

/* =========================================
   2. 等級需求網格 (Rank Grid)
   ========================================= */
.rank-grid {
    display: grid;
    /* 電腦版：自動適應，一排約 4 個 */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 30px;
}

.rank-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.rank-lv { color: #aaa; font-weight: bold; width: 40px; }
.rank-name { color: #fff; flex: 1; text-align: center; }
.rank-exp { font-weight: bold; text-align: right; }

/* =========================================
   3. 聲望類型卡片 (Type Cards)
   ========================================= */
.type-grid {
    display: grid;
    /* 電腦版：一排 2 個 */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.type-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    border-top: 3px solid #ccc;
    display: flex;
    flex-direction: column;
}

.type-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }

/* 類型配色 */
.type-melee { border-top-color: #ef5350; } .type-melee .card-header i { color: #ef5350; }
.type-range { border-top-color: #81c784; } .type-range .card-header i { color: #81c784; }
.type-magic { border-top-color: #4fc3f7; } .type-magic .card-header i { color: #4fc3f7; }
.type-guard { border-top-color: #ffb74d; } .type-guard .card-header i { color: #ffb74d; }

.card-header {
    background: rgba(255, 255, 255, 0.05);
    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: 10px;
}

.card-img {
    text-align: center;
    padding: 15px;
    background: rgba(0,0,0,0.2);
}

.card-img img {
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 100%;
}

.card-body { padding: 15px; flex: 1; }
.card-body p { margin: 0; color: #ccc; line-height: 1.6; font-size: 0.95rem; }

/* =========================================
   4. 能力表格 (Table)
   ========================================= */
.text-melee { color: #ef5350; }
.text-range { color: #81c784; }
.text-magic { color: #4fc3f7; }
.text-guard { color: #ffb74d; }

.wiki-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.wiki-table th { background: rgba(0, 0, 0, 0.5); padding: 12px; color: #aaa; border-bottom: 1px solid rgba(255,255,255,0.1); }
.wiki-table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: center; color: #ddd; }

.lv-cell { color: #aaa; font-weight: bold; }
.rank-cell { color: #fff; }

/* =========================================
   5. RWD 手機版優化
   ========================================= */
@media (max-width: 768px) {
    /* 聲望類型卡片單欄 */
    .type-grid { grid-template-columns: 1fr; }
    
    /* 表格轉卡片 */
    .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.03);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding-bottom: 10px;
    }
    
    /* 等級與稱號合併顯示 */
    .prestige-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;
        font-size: 1.1rem;
        color: var(--primary-gold, #fbb750);
    }
    
    .prestige-table td.rank-cell {
        text-align: center;
        font-weight: bold;
        padding-bottom: 10px;
        border-bottom: 1px dashed rgba(255,255,255,0.1);
    }
    
    /* 內容列 */
    .prestige-table td[data-label] {
        display: flex;
        justify-content: space-between;
        padding: 8px 15px;
        text-align: right;
        border-bottom: 1px dashed rgba(255,255,255,0.05);
    }
    .prestige-table td[data-label]:last-child { border-bottom: none; }
    .prestige-table td[data-label]::before { content: attr(data-label); color: #aaa; }
}