:root{
    --apk-bg:#ffffff;
    --apk-text:#334155;
    --apk-border:#e2e8f0;
    --apk-meta:#64748b;
    --apk-head-bg:#f8fafc;
    --apk-mod-bg:#f0fdf4;
    --apk-mod-text:#15803d;
    --apk-mod-border:#16a34a;
    --apk-table-head:#64748b;
    --apk-card-shadow:rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark){
    :root{
        --apk-bg:#1e293b;
        --apk-text:#f1f5f9;
        --apk-border:#334155;
        --apk-meta:#94a3b8;
        --apk-head-bg:#0f172a;
        --apk-mod-bg:#064e3b;
        --apk-mod-text:#d1fae5;
        --apk-mod-border:#059669;
        --apk-table-head:#cbd5e1;
        --apk-card-shadow:rgba(0,0,0,.5);
    }
}
body.dark-mode{
    --apk-bg:#1e293b;
    --apk-text:#f1f5f9;
    --apk-border:#334155;
    --apk-meta:#94a3b8;
    --apk-head-bg:#0f172a;
    --apk-mod-bg:#064e3b;
    --apk-mod-text:#d1fae5;
    --apk-mod-border:#059669;
    --apk-table-head:#cbd5e1;
}

.apk-box{
    border:1px solid var(--apk-border);
    border-radius:16px;
    background:var(--apk-bg);
    overflow:hidden;
    margin:20px auto;
    box-shadow:0 4px 20px var(--apk-card-shadow);
    max-width:100%;
    color:var(--apk-text);
}

.apk-head{
    display:flex;
    padding:25px;
    gap:20px;
    border-bottom:1px solid var(--apk-border);
    align-items:center;
    background:var(--apk-head-bg);
}
.apk-head img{
    width:90px;
    height:90px;
    border-radius:20px;
    object-fit:cover;
    box-shadow:0 4px 10px rgba(0,0,0,.1);
    background:#fff;
    flex-shrink:0;
}
.apk-head h2{
    margin:0 0 10px 0;
    font-size:22px;
    line-height:1.2;
    color:var(--apk-text);
}
.apk-head small{
    color:var(--apk-meta);
}

.ver-badge{
    font-size:13px;
    color:#16a34a;
    font-weight:700;
    background:#dcfce7;
    padding:5px 12px;
    border-radius:50px;
    display:inline-block;
}

.mod-box{
    background:var(--apk-mod-bg);
    padding:20px;
    margin:20px;
    border:1px dashed var(--apk-mod-border);
    border-radius:12px;
}
.mod-title{
    color:var(--apk-mod-text);
    font-weight:800;
    display:block;
    margin-bottom:10px;
    font-size:15px;
}
.mod-box ul{
    margin:0;
    padding:0;
    list-style:none;
}
.mod-box li{
    margin-bottom:5px;
    font-size:14px;
    font-weight:500;
    color:var(--apk-mod-text);
}

/* APK info table */
.apk-table-wrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}
.apk-table{
    width:100%;
    border-collapse:collapse;
    margin:0;
    background:var(--apk-bg);
    table-layout:fixed;
}
.apk-table tr{
    border-bottom:1px solid var(--apk-border);
}
.apk-table td{
    padding:15px 25px;
    font-size:15px;
    color:var(--apk-text);
    vertical-align:top;
}
.apk-table td:first-child{
    color:var(--apk-table-head);
    font-weight:600;
    width:40%;
}
.apk-table td:last-child{
    font-weight:700;
    text-align:right;
    word-break:break-word;
    overflow-wrap:anywhere;
}
.apk-table a{
    color:var(--ac,#2563eb);
    text-decoration:none;
}

.apk-actions{
    padding:25px;
    text-align:center;
}
.apk-btn{
    display:block;
    width:100%;
    padding:16px;
    background:var(--ac,#2563eb);
    color:#fff !important;
    text-align:center;
    border-radius:12px;
    font-weight:800;
    text-decoration:none !important;
    border:none;
    cursor:pointer;
    font-size:16px;
    transition:transform .2s, opacity .2s;
    box-shadow:0 4px 15px rgba(0,0,0,.1);
    margin-bottom:15px;
}
.apk-btn:active{
    transform:scale(.98);
}
.apk-btn-alt{
    background:#f97316;
}
.apk-btn-tg{
    background:#0ea5e9;
    width:auto;
    display:inline-block;
    padding:10px 30px;
}
.apk-btn-download{
    background:#16a34a;
    max-width:350px;
    margin:0 auto;
}

.adb-alert{
    display:none;
    background:#ef4444;
    color:#fff;
    padding:15px;
    border-radius:12px;
    margin-bottom:15px;
    text-align:center;
    font-weight:700;
}
.prog-wrap{
    display:none;
    height:10px;
    background:#e2e8f0;
    border-radius:50px;
    overflow:hidden;
    margin:20px 0;
    width:100%;
}
.prog-bar{
    height:100%;
    background:var(--ac,#2563eb);
    width:0%;
    transition:width 1s linear;
}
.apk-prog-wide{
    width:80%;
    margin:0 auto 20px;
}

.pc-box{
    display:flex;
    gap:15px;
    padding:20px;
    flex-wrap:wrap;
}
.pc-col{
    flex:1;
    min-width:250px;
    padding:20px;
    border-radius:12px;
    font-size:14px;
}
.pc-pro{
    background:var(--apk-mod-bg);
    border:1px solid var(--apk-mod-border);
    color:var(--apk-text);
}
.pc-con{
    background:rgba(239,68,68,.1);
    border:1px solid rgba(239,68,68,.4);
    color:var(--apk-text);
}

/* pros cons checklist restored */
.apk-list-clean{
    margin:10px 0 0;
    padding:0;
    list-style:none;
}
.apk-list-clean li{
    position:relative;
    padding-left:26px;
    margin-bottom:8px;
    font-size:14px;
    line-height:1.5;
}
.apk-list-clean li:last-child{
    margin-bottom:0;
}
.pc-pro .apk-list-clean li::before{
    content:"✔";
    position:absolute;
    left:0;
    top:0;
    font-weight:800;
    color:var(--apk-mod-text);
}
.pc-con .apk-list-clean li::before{
    content:"✖";
    position:absolute;
    left:0;
    top:0;
    font-weight:800;
    color:#ef4444;
}

/* screenshots spacing restored */
.ss-box{
    display:flex;
    overflow-x:auto;
    padding:0 20px 20px;
    scrollbar-width:thin;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;
    gap:0;
}
.ss-box > *{
    flex:0 0 auto;
}
.ss-box > * + *{
    margin-left:15px;
}
.ss-box img{
    display:block;
    width:auto;
    max-width:min(100%,420px);
    height:220px;
    object-fit:cover;
    scroll-snap-align:start;
    border-radius:10px;
    border:1px solid var(--apk-border);
    background:var(--apk-head-bg);
}

/* related */
.rel-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(130px,1fr));
    gap:15px;
    padding:0 20px 25px;
}
.rel-item{
    display:block;
    text-align:center;
    text-decoration:none !important;
    background:var(--apk-bg);
    border:1px solid var(--apk-border);
    border-radius:12px;
    padding:15px;
    transition:transform .2s, box-shadow .2s;
}
.rel-item:hover{
    transform:translateY(-3px);
    box-shadow:0 5px 15px rgba(0,0,0,.08);
    border-color:var(--ac,#2563eb);
}
.rel-item img{
    width:60px;
    height:60px;
    border-radius:14px;
    object-fit:cover;
    margin-bottom:10px;
    box-shadow:0 2px 5px rgba(0,0,0,.05);
    background:#fff;
}
.rel-title{
    font-size:13px;
    font-weight:700;
    color:var(--apk-text);
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
    line-height:1.3;
    margin-bottom:8px;
}
.rel-dl-btn{
    display:inline-block;
    background:rgba(0,0,0,.05);
    color:var(--ac,#2563eb);
    font-size:11px;
    font-weight:700;
    padding:4px 12px;
    border-radius:50px;
}

.guide-wrap{
    margin:20px;
    border:1px solid var(--apk-border);
    border-radius:12px;
    overflow:hidden;
}
.guide-head{
    width:100%;
    background:rgba(0,0,0,.03);
    padding:15px 20px;
    cursor:pointer;
    font-weight:700;
    display:flex;
    justify-content:space-between;
    align-items:center;
    color:var(--apk-text);
    border:none;
    text-align:left;
}
.guide-body{
    display:none;
    padding:20px;
    border-top:1px solid var(--apk-border);
    font-size:14px;
    line-height:1.6;
    color:var(--apk-meta);
    background:var(--apk-bg);
}
.guide-body p{
    margin:0 0 10px;
}

.apk-related{
    border-top:1px solid var(--apk-border);
}
.apk-related-title{
    padding:15px 20px 0;
    margin:0;
    font-size:16px;
    color:var(--apk-text);
}
.apk-status-text{
    color:#f59e0b;
    font-weight:700;
    font-size:18px;
    margin-bottom:15px;
}
.apk-report-btn{
    background:none;
    border:none;
    color:#ef4444;
    text-decoration:underline;
    cursor:pointer;
    font-size:14px;
}
.is-disabled{
    pointer-events:none;
    opacity:.55;
}

@media(max-width:768px){
    .apk-head{
        flex-direction:column;
        text-align:center;
    }
    .apk-table td{
        padding:12px 15px;
        font-size:13px;
    }
    .apk-table td:first-child{
        width:42%;
    }
    .apk-table td:last-child{
        text-align:left;
    }
    .apk-prog-wide{
        width:100%;
    }
    .ss-box img{
        max-width:min(100%,320px);
        height:180px;
    }
}

@media(max-width:640px){
    .apk-head{
        padding:18px 16px;
        gap:14px;
    }
    .apk-head img{
        width:72px;
        height:72px;
        border-radius:18px;
    }
    .apk-head h2{
        font-size:19px;
    }
    .mod-box,
    .guide-wrap{
        margin:16px;
    }
    .pc-box{
        padding:16px;
    }
    .pc-col{
        min-width:100%;
        padding:16px;
    }
    .apk-actions{
        padding:18px 16px;
    }

    .apk-table{
        table-layout:fixed;
    }
    .apk-table td{
        padding:12px 16px;
        font-size:13px;
    }
    .apk-table td:first-child{
        width:44%;
        font-size:12px;
    }
    .apk-table td:last-child{
        font-size:14px;
        line-height:1.5;
    }

    .ss-box{
        padding:0 16px 16px;
    }
    .ss-box > * + *{
        margin-left:12px;
    }
    .ss-box img{
        max-width:min(100%,280px);
        height:170px;
    }
    .rel-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
        padding:0 16px 20px;
    }
}

@media(max-width:380px){
    .apk-head h2{
        font-size:18px;
    }
    .apk-btn{
        font-size:15px;
        padding:14px;
    }
    .apk-btn-tg{
        width:100%;
        padding:12px 16px;
    }
    .apk-table td{
        padding:11px 12px;
        font-size:12px;
    }
    .apk-table td:first-child{
        width:46%;
        font-size:11px;
    }
    .apk-table td:last-child{
        font-size:13px;
    }
}
