/* =========================================
   Lands of Jail Hero Database UI
   Developed by Weber Chang
========================================= */

/* =========================================
   01. Global Reset
   未來新增：全站通用設定放這裡
========================================= */

*{
    box-sizing:border-box;
    margin:0;
    padding:0;
}

html{
    scroll-behavior:smooth;
}

body{
    font-family:"Microsoft JhengHei",Arial,sans-serif;
    background:radial-gradient(circle at top,#27211b 0,#111 42%,#070707 100%);
    color:#f6f1e8;
    min-height:100vh;
    overflow-x:hidden;
}

/* =========================================
   02. Topbar
   未來新增：Logo、網站標題、語言切換入口放這裡
========================================= */

.topbar{
    padding:42px 7vw 34px;
    border-bottom:1px solid rgba(255,174,66,.25);
    background:linear-gradient(135deg,rgba(255,136,0,.18),rgba(0,0,0,.10));
    backdrop-filter:blur(12px);
}

.eyebrow{
    color:#ffb347;
    font-weight:700;
    letter-spacing:2px;
    text-transform:uppercase;
    margin-bottom:8px;
}

.topbar h1{
    font-size:44px;
    letter-spacing:2px;
    color:#ffd28a;
    text-shadow:0 0 18px rgba(255,136,0,.35);
}

.subtitle{
    margin-top:10px;
    color:#cfc7bb;
    line-height:1.6;
}

/* =========================================
   03. Main Layout
   未來新增：主容器、頁面寬度、區塊間距放這裡
========================================= */

.container{
    width:min(1280px,92vw);
    margin:0 auto;
    padding:32px 0 56px;
}

/* =========================================
   04. Toolbar / Filters
   未來新增：搜尋、稀有度、兵種、類型、語言篩選放這裡
========================================= */

.toolbar{
    display:grid;
    grid-template-columns:1fr 180px 180px 180px;
    gap:18px;
    margin-bottom:20px;
}

.search-wrap,
.filter-wrap{
    background:rgba(255,255,255,.06);
    border:1px solid rgba(255,255,255,.12);
    border-radius:18px;
    padding:14px 16px;
    backdrop-filter:blur(10px);
}

label{
    display:block;
    font-size:13px;
    color:#ffca7a;
    margin-bottom:8px;
}

input,
select{
    width:100%;
    border:0;
    outline:0;
    border-radius:12px;
    background:#171717;
    color:#fff;
    padding:13px 14px;
    font-size:16px;
    border:1px solid rgba(255,255,255,.12);
    transition:.2s;
}

input:focus,
select:focus{
    border-color:#ff9f1a;
    box-shadow:0 0 0 3px rgba(255,159,26,.16);
}

.filter-toggle{
    display:none;
}

/* =========================================
   04A. View Tabs
   未來新增：全部 / 收藏 / 最近查看 Tab 放這裡
========================================= */

.view-tabs{
    display:flex;
    gap:10px;
    margin:0 0 18px;
    flex-wrap:wrap;
}

.view-tab{
    border:1px solid rgba(255,255,255,.12);
    background:#171717;
    color:#bbb;
    padding:10px 16px;
    border-radius:999px;
    font-weight:800;
    cursor:pointer;
    transition:.2s;
}

.view-tab:hover{
    color:#fff;
    border-color:rgba(255,180,70,.35);
}

.view-tab.active{
    background:linear-gradient(90deg,#ff9900,#ffc15a);
    color:#111;
}

/* =========================================
   04B. Language Switch | 語言切換
========================================= */

.lang-switch-wrap{
    display:flex;
    gap:10px;
    margin:0 0 14px;
}

.lang-btn{
    border:1px solid rgba(255,255,255,.12);
    background:#171717;
    color:#bbb;
    padding:9px 16px;
    border-radius:999px;
    font-weight:800;
    cursor:pointer;
    transition:.2s;
}

.lang-btn.active{
    background:linear-gradient(90deg,#ff9900,#ffc15a);
    color:#111;
}

/* =========================================
   05. Summary
   未來新增：英雄數量、搜尋結果提示放這裡
========================================= */

.summary{
    margin:8px 0 22px;
    color:#d8d0c4;
}

.summary span:first-child{
    color:#ffb347;
    font-size:24px;
    font-weight:800;
    margin-right:6px;
}

/* =========================================
   06. Hero Grid
   未來新增：卡片排列、卡片間距放這裡
========================================= */

.hero-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(190px,1fr));
    gap:22px;
}

/* =========================================
   07. Hero Card
   未來新增：收藏星號、卡片標籤、卡片特效放這裡
========================================= */

.hero-card{
    background:linear-gradient(180deg,#202020,#151515);
    border:1px solid rgba(255,255,255,.1);
    border-radius:22px;
    overflow:hidden;
    box-shadow:0 14px 32px rgba(0,0,0,.28);
    transition:transform .22s,border-color .22s,box-shadow .22s;
    cursor:pointer;
    position:relative;
}

.hero-card:hover{
    transform:translateY(-5px);
    border-color:rgba(255,160,40,.45);
    box-shadow:0 18px 42px rgba(255,130,0,.16);
}

/* =========================================
   08. Hero Image
   未來新增：圖片載入中、缺圖樣式放這裡
========================================= */

.image-box{
    aspect-ratio:1/1;
    background:linear-gradient(135deg,#282828,#111);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:12px;
}

.image-box img{
    width:100%;
    height:100%;
    object-fit:contain;
    filter:drop-shadow(0 10px 14px rgba(0,0,0,.42));
}

.image-box.missing::after{
    content:"圖片未找到";
    color:#777;
    font-size:14px;
}

/* =========================================
   09. Card Body
   未來新增：卡片副標、職業簡寫、快速資訊放這裡
========================================= */

.card-body{
    padding:15px 15px 17px;
}

.card-body h2{
    font-size:18px;
    line-height:1.35;
    margin-bottom:6px;
    min-height:48px;
}

.card-body p{
    color:#aaa;
    font-size:14px;
    min-height:18px;
}

/* =========================================
   10. Rarity Badge
   未來新增：稀有度顏色、SSR特效放這裡
========================================= */

.rarity{
    display:inline-block;
    padding:5px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
    background:#333;
    color:#fff;
    margin-bottom:10px;
}

.rarity.R{
    background:#5f6f82;
}

.rarity.SR{
    background:#8567c9;
}

.rarity.SSR_S-1,
.rarity.SSR_S-2,
.rarity.SSR_S-3,
.rarity.SSR_S-4,
.rarity.SSR_S-5,
.rarity.SSR_S-6{
    background:linear-gradient(90deg,#ff8a00,#ffca45);
    color:#211000;
}

/* =========================================
   11. Empty Text
   未來新增：無資料、無圖片、查無英雄提示放這裡
========================================= */

.empty-text{
    color:#888;
    font-size:14px;
    padding:12px;
}

/* =========================================
   12. Footer
   未來新增：版本資訊、更新日期、作者資訊、瀏覽人數放這裡
========================================= */

footer{
    text-align:center;
    color:#777;
    border-top:1px solid rgba(255,255,255,.08);
    padding:24px;
}

.site-version{
    margin-top:8px;
    color:#999;
    font-size:12px;
}

.site-stats{
    text-align:center;
    margin-top:20px;
    font-size:14px;
    color:#ccc;
}

.site-stats span{
    color:#ffb347;
    font-weight:700;
}

/* =========================================
   13. Hero Modal
   未來新增：Modal 尺寸、背景、關閉按鈕放這裡
========================================= */

.modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.75);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:9999;
    padding:24px;
    backdrop-filter:blur(6px);
}

.modal-overlay.active{
    display:flex;
}

.modal-card{
    width:min(1100px,96vw);
    max-height:92vh;
    overflow-y:auto;
    background:linear-gradient(180deg,#1b1b1b,#0f0f0f);
    border:1px solid rgba(255,180,70,.35);
    border-radius:24px;
    padding:28px;
    color:#fff;
    box-shadow:0 20px 80px rgba(0,0,0,.65);
    position:relative;
}

.modal-close{
    position:absolute;
    top:18px;
    right:18px;
    width:42px;
    height:42px;
    border:none;
    border-radius:50%;
    background:#2a2a2a;
    color:#fff;
    font-size:28px;
    cursor:pointer;
    transition:.2s;
}

.modal-close:hover{
    background:#ff8a00;
    color:#111;
}

.hero-header-info{
    flex:1;
}

.hero-en-name{
    font-size:22px;
    color:#d0c8bb;
    margin-top:6px;
}

.hero-meta{
    margin-top:10px;
    color:#a8a8a8;
    line-height:1.5;
}

.hero-action-row{
    display:flex;
    gap:10px;
    margin-top:14px;
}

.hero-action-btn{
    border:none;
    border-radius:999px;

    padding:10px 16px;

    background:
        linear-gradient(
            90deg,
            #ff9900,
            #ffc15a
        );

    color:#111;

    font-weight:800;

    cursor:pointer;
}

.favorite-btn{
    background:#2b2b2b;
    color:#fff;
}

/* =========================================
   14. Modal Header
   功能：分享按鈕、收藏按鈕、英雄標題區
========================================= */

.modal-header{
    display:flex;
    gap:24px;
    align-items:center;
    margin-bottom:26px;
}

.modal-hero-img{
    width:180px;
    height:180px;
    object-fit:cover;
    border-radius:22px;
    border:2px solid rgba(255,180,70,.6);
    background:#111;
}

.modal-rarity{
    display:inline-block;
    padding:6px 14px;
    border-radius:999px;
    background:linear-gradient(90deg,#ff9900,#ffc15a);
    color:#111;
    font-weight:bold;
    margin-bottom:10px;
}

.modal-header h2{
    font-size:34px;
    margin:4px 0;
}

.modal-title-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.share-btn{
    border:none;
    cursor:pointer;
    background:#ffb02e;
    color:#111;
    padding:8px 14px;
    border-radius:10px;
    font-weight:700;
    font-size:13px;
    transition:.2s;
    white-space:nowrap;
}

.share-btn:hover{
    transform:translateY(-2px);
    filter:brightness(1.05);
}

.modal-header p{
    color:#bbb;
    margin:4px 0;
    line-height:1.6;
}

.modal-action-row{
    display:flex;
    gap:8px;
    align-items:center;
}

.favorite-btn{
    border:none;
    cursor:pointer;
    background:#2a2a2a;
    color:#ffca7a;
    padding:8px 14px;
    border-radius:10px;
    font-weight:700;
    font-size:13px;
    transition:.2s;
    white-space:nowrap;
}

.favorite-btn.active{
    background:linear-gradient(90deg,#ff9900,#ffc15a);
    color:#111;
}

/* =========================================
   15. Modal Sections
   未來新增：區塊標題、折疊區塊共用樣式放這裡
========================================= */

.modal-section{
    margin-top:24px;
}

.modal-section h3{
    color:#ffb347;
    margin-bottom:12px;
    border-left:4px solid #ff9900;
    padding-left:10px;
}

.modal-nav-row{
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-top:28px;
    padding-top:20px;
    border-top:1px solid rgba(255,255,255,.1);
}

.modal-nav-row button{
    flex:1;
    border:none;
    cursor:pointer;
    background:#222;
    color:#ffca7a;
    padding:12px 16px;
    border-radius:12px;
    font-weight:800;
    transition:.2s;
}

.modal-nav-row button:hover{
    background:#ffb02e;
    color:#111;
}

/* =========================================
   16. Stats
   未來新增：能力數值顏色、比較數值放這裡
========================================= */

.stat-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
    gap:12px;
}

.stat-item{
    background:#181818;
    border:1px solid #333;
    border-radius:14px;
    padding:14px;
}

.stat-label{
    color:#999;
    font-size:13px;
}

.stat-value{
    font-size:20px;
    font-weight:bold;
    margin-top:6px;
}

/* =========================================
   17. Skills
   未來新增：技能卡片、技能圖片、技能描述放這裡
========================================= */

.skill-list{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:14px;
}

.skill-item{
    display:flex;
    gap:14px;
    background:#181818;
    border:1px solid #333;
    border-radius:16px;
    padding:14px;
    transition:.2s;
}

.skill-item:hover{
    border-color:rgba(255,180,70,.35);
    transform:translateY(-2px);
}

.skill-item img{
    width:72px;
    height:72px;
    object-fit:cover;
    border-radius:14px;
    background:#0d0d0d;
    flex-shrink:0;
}

.skill-info h4{
    margin:0 0 6px 0;
    color:#fff;
}

.skill-info p{
    margin:0;
    color:#bbb;
    line-height:1.5;
    font-size:14px;
}

.skill-media{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:8px;
    flex-shrink:0;
}

/* =========================================
   18. Skill Level System
   未來新增：Lv切換、數值高亮、技能變數顏色放這裡
========================================= */

.skill-levels{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin:8px 0 10px;
    
    justify-content:center;
}

.level-btn{
    border:none;
    border-radius:999px;
    padding:5px 10px;
    background:#2a2a2a;
    color:#bbb;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
    transition:.2s;
}

.level-btn:hover{
    background:#3a3a3a;
    color:#fff;
}

.level-btn.active{
    background:linear-gradient(90deg,#ff9900,#ffc15a);
    color:#111;
}

.skill-desc{
    white-space:pre-line;
}

.skill-var{
    display:inline-block;
    color:#ffb347;
    font-weight:900;
    padding:0 4px;
    text-shadow:0 0 10px rgba(255,153,0,.45);
}

.skill-var::after{
    content:"";
}

.skill-media .skill-levels{
    display:grid;
    grid-template-columns:repeat(2,auto);
    gap:6px;
    margin:0;
    justify-content:center;
}

.skill-media .level-btn{
    padding:4px 8px;
    font-size:11px;
}

/* =========================================
19. Mobile Layout 手機專區 | 手機 (<768px)
========================================= */

@media(max-width:768px){

    /* =====================================
       A. Toolbar 搜尋與篩選
       新增：
       - 搜尋框
       - 篩選器
       - 收藏切換
       ===================================== */

    .filter-toggle{
        display:block;
        width:100%;
        border:none;
        border-radius:16px;
        padding:12px 16px;
        margin-bottom:14px;
        background:linear-gradient(90deg,#ff9900,#ffc15a);
        color:#111;
        font-weight:900;
        font-size:15px;
    }

    .toolbar{
        display:grid;
        grid-template-columns:repeat(3,1fr);
        gap:10px;
    }

    .toolbar.collapsed{
        display:none;
    }

    .toolbar .search-wrap{
        grid-column:1 / -1;
    }

    .toolbar .filter-wrap{
        padding:10px;
    }

    .toolbar label{
        font-size:12px;
    }

    .toolbar select{
        padding:10px 8px;
        font-size:14px;
    }


    /* =====================================
       B. Hero Grid 英雄列表
       新增：
       - 卡片尺寸
       - 手機欄數
       - 圖片大小
       ===================================== */

    .hero-grid{
        grid-template-columns:repeat(3,1fr);
        gap:10px;
    }

    .hero-card{
        border-radius:14px;
    }

    .image-box{
        padding:6px;
    }

    .card-body{
        padding:8px;
    }

    .card-body h2{
        font-size:13px;
    }

    .card-body p{
        font-size:11px;
    }

    .rarity{
        font-size:10px;
    }


    /* =====================================
       C. Modal 外框
       新增：
       - Modal尺寸
       - 關閉按鈕
       ===================================== */

    .modal-overlay{
        padding:10px;
        align-items:flex-start;
    }

    .modal-card{
        width:100%;
        max-height:96vh;
        padding:16px;
        border-radius:18px;
    }

    .modal-close{
        top:10px;
        right:10px;
        width:34px;
        height:34px;
        font-size:22px;
    }


    /* =====================================
       D. Hero Header 名片區
    ===================================== */

    .mobile-hero-card{
        display:grid;
        grid-template-columns:104px 1fr;
        align-items:center;
        gap:14px;
        margin-bottom:18px;
    }

    .hero-header-info{
        min-width:0;
    }

    .modal-hero-img{
        width:104px;
        height:104px;
        border-radius:16px;
    }

    .modal-rarity{
        padding:4px 12px;
        font-size:13px;
        margin-bottom:6px;
    }

    .modal-title-row{
        display:block;
    }

    .modal-header h2{
        font-size:23px;
        line-height:1.2;
        margin:0 0 6px;
        word-break:keep-all;
        overflow-wrap:anywhere;
    }

    .modal-action-row{
        display:flex;
        flex-direction:row;
        gap:8px;
        flex-wrap:nowrap;
        margin:8px 0;
    }

    .share-btn,
    .favorite-btn{
        padding:6px 10px;
        font-size:12px;
        border-radius:999px;
    }

    .modal-header p{
        font-size:13px;
        line-height:1.35;
        margin:3px 0;
    }


    /* =====================================
       E. 能力數值
       新增：
       - 數值卡片
       - 百分比顯示
       ===================================== */

    .stat-grid{
        grid-template-columns:repeat(2,1fr);
        gap:10px;
    }

    .stat-item{
        padding:12px;
    }

    .stat-label{
        font-size:12px;
    }

    .stat-value{
        font-size:22px;
    }


    /* =====================================
       F. 技能區
       新增：
       - 技能卡
       - 等級按鈕
       - 技能描述
       ===================================== */

    .skill-list{
        grid-template-columns:1fr;
        gap:12px;
    }

    .skill-item{
        gap:12px;
        padding:12px;
    }

    .skill-item img{
        width:58px;
        height:58px;
    }

    .skill-info h4{
        font-size:17px;
    }

    .skill-info p,
    .skill-desc{
        font-size:14px;
    }

    .skill-levels{
        flex-wrap:nowrap;
        overflow-x:auto;
        gap:6px;
    }

    .skill-levels::-webkit-scrollbar{
        display:none;
    }
    
    .skill-media .skill-levels{
        grid-template-columns:repeat(2,auto);
        gap:5px;
    }

    .skill-media .level-btn{
        padding:4px 7px;
        font-size:11px;
    }


    /* =====================================
       G. Modal 導覽
       新增：
       - 上一位
       - 下一位
       ===================================== */

    .modal-nav-row{
        gap:8px;
    }

    .modal-nav-row button{
        padding:10px 12px;
        font-size:13px;
    }


    /* =====================================
       H. 收藏 / 最近查看 Tabs
       新增：
       - 全部英雄
       - 收藏英雄
       - 最近查看
       ===================================== */

    .view-tabs{
        gap:8px;
    }

    .view-tab{
        flex:1;
        padding:9px 10px;
        font-size:13px;
    }
    
    /* =====================================
       I. 語言切換
       ===================================== */
    
    .lang-switch-wrap{
        gap:8px;
    }

    .lang-btn{
        flex:1;
        padding:9px 10px;
        font-size:13px;
    }

}


/* =========================================
   20. Tablet Layout 平板專區 | 平板 (769~1024px)
========================================= */

@media(min-width:769px) and (max-width:1024px){

    .hero-grid{
        grid-template-columns:repeat(4,1fr);
        gap:16px;
    }

}

/* =========================================
   21. Mobile Components | 手機組件
   未來新增：手機折疊、返回頂部、浮動按鈕放這裡
========================================= */

.back-to-top{
    display:block;
    position:fixed;
    right:14px;
    bottom:18px;
    z-index:9999;
    width:36px;
    height:36px;
    border-radius:999px;
    border:1px solid rgba(255,179,71,.45);
    background:linear-gradient(135deg,#ff9900,#ffc15a);
    color:#111;
    font-size:18px;
    font-weight:900;
    box-shadow:0 8px 24px rgba(0,0,0,.45);
    cursor:pointer;
}

@media(max-width:768px){

    .modal-section h3{
        cursor:pointer;
        position:relative;
        padding-right:28px;
        user-select:none;
    }

    .modal-section h3::after{
        content:"▼";
        position:absolute;
        right:0;
        top:50%;
        transform:translateY(-50%);
        font-size:13px;
        color:#ffb347;
        transition:.2s;
    }

    .modal-section.collapsed h3::after{
        transform:translateY(-50%) rotate(-90deg);
    }

    .modal-section.collapsed > :not(h3){
        display:none;
    }

    .back-to-top{
        display:block;
        position:fixed;
        right:14px;
        bottom:18px;
        z-index:9999;
        width:36px;
        height:36px;
        border-radius:999px;
        border:1px solid rgba(255,179,71,.45);
        background:linear-gradient(135deg,#ff9900,#ffc15a);
        color:#111;
        font-size:18px;
        font-weight:900;
        box-shadow:0 8px 24px rgba(0,0,0,.45);
        cursor:pointer;
    }

    .back-to-top:active{
        transform:scale(.94);
    }
}

/* =========================================
   22. Guide Table | 攻略表格
========================================= */

.guide-table-wrap{
    overflow-x:auto;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.12);
    border-radius:18px;
    padding:12px;
}

.guide-table{
    width:100%;
    min-width:720px;
    border-collapse:collapse;
    color:#f6f1e8;
}

.guide-table th{
    background:#5a2a88;
    color:#fff;
    padding:12px;
    border:1px solid rgba(255,255,255,.18);
    text-align:center;
}

.guide-table td{
    padding:12px;
    border:1px solid rgba(255,255,255,.12);
    text-align:center;
    background:#161616;
}

.guide-table tbody tr:nth-child(even) td{
    background:#1f1f1f;
}

.guide-table td:last-child{
    color:#ffb347;
    font-weight:900;
}

/* =========================================
   23. Guide Menu | 攻略首頁卡片
========================================= */

.guide-menu-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
    gap:18px;
    margin-top:24px;
}

.guide-menu-card{
    display:block;
    text-decoration:none;
    color:#f6f1e8;
    background:linear-gradient(180deg,#202020,#151515);
    border:1px solid rgba(255,255,255,.12);
    border-radius:22px;
    padding:22px;
    box-shadow:0 14px 32px rgba(0,0,0,.28);
    transition:.22s;
}

.guide-menu-card:hover{
    transform:translateY(-4px);
    border-color:rgba(255,160,40,.45);
    box-shadow:0 18px 42px rgba(255,130,0,.16);
}

.guide-menu-card h2{
    color:#ffb347;
    font-size:22px;
    margin-bottom:8px;
}

.guide-menu-card p{
    color:#bbb;
    font-size:15px;
}