/* =========================================
   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; border-bottom: 1px dashed rgba(255, 255, 255, 0.1); padding-bottom: 10px; }

.link-group { display: flex; gap: 15px; flex-wrap: wrap; }
.link-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 15px; border: 1px solid rgba(255,255,255,0.2); border-radius: 20px; color: #ddd; text-decoration: none; transition: 0.2s; font-size: 0.9rem; background: rgba(255,255,255,0.05); }
.link-btn:hover { border-color: var(--primary-gold, #fbb750); color: var(--primary-gold, #fbb750); background: rgba(0,0,0,0.3); }
.mt-20 { margin-top: 20px; }

/* =========================================
   2. 樓層升級機率 (Grid Cards)
   ========================================= */
.floor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.floor-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s;
}
.floor-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.3); }

.f-title { font-size: 1.1rem; font-weight: bold; color: #fff; margin-bottom: 5px; }
.f-rate { font-size: 1.5rem; font-weight: bold; font-family: monospace; margin-bottom: 5px; }
.f-desc { font-size: 0.85rem; color: #888; }

/* =========================================
   3. 機率表樣式
   ========================================= */
.wiki-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.wiki-table th { background: rgba(0, 0, 0, 0.5); white-space: nowrap; padding: 12px 10px; color: #aaa; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.wiki-table td { padding: 12px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); text-align: center; }
.scroll-name { text-align: left !important; font-weight: bold; color: #fff; }
.scroll-name i { margin-right: 8px; color: var(--primary-gold, #fbb750); }
.rate-val { color: #81c784; font-weight: bold; font-family: monospace; }

/* =========================================
   4. 屬性加成網格 (Grid System)
   ========================================= */
.acc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* 小卡片 */
    gap: 10px;
    margin-bottom: 30px;
}

.acc-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s;
}
.acc-card:hover { transform: translateY(-3px); border-color: var(--primary-gold, #fbb750); }

.acc-lv {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    font-weight: bold;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.acc-stats { padding: 10px; }
.stat-row { font-size: 0.9rem; display: flex; flex-direction: column; gap: 3px; }
.stat-row span { color: #aaa; font-size: 0.8rem; }
.stat-row strong { font-size: 1.1rem; }

/* 顏色工具 */
.text-green { color: #81c784; }
.text-red { color: #ff5252; }
.text-blue { color: #64b5f6; }
.text-gold { color: #ffd700; }
.highlight { color: #ffd700; font-weight: bold; }

/* =========================================
   5. 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.03); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; overflow: hidden; }
    
    .rate-table td.scroll-name { background: rgba(0, 0, 0, 0.4); text-align: center !important; font-size: 1.1rem; color: var(--primary-gold, #fbb750); border-bottom: 1px solid rgba(255,255,255,0.1); }
    
    .rate-table td.rate-val { display: flex; justify-content: space-between; padding: 10px 15px; text-align: right; }
    .rate-table td.rate-val::before { content: attr(data-label); color: #aaa; }

    /* 屬性卡片維持 Grid 但調整欄位 */
    .acc-grid { grid-template-columns: repeat(3, 1fr); }
    
    /* 連結按鈕滿版 */
    .link-group { flex-direction: column; gap: 10px; }
    .link-btn { width: 100%; justify-content: center; }
}