@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

:root {
    --apk-accent: #1bbc9b;
    --apk-accent-dark: #41495d;
    --apk-header: #1d222d;
    --apk-bg: #e6e9ef;
    --apk-surface: #ffffff;
    --apk-text: #4c4c4c;
    --apk-title: #444444;
    --apk-muted: #a7a7a7;
    --apk-border: #eaeaea;
    --apk-star: #f9bd00;
    --apk-star-off: #d4dae2;
    --apk-ribbon-new: #d22222;
    --apk-ribbon-update: #19b934;
    --apk-font: 'Open Sans', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: var(--apk-font);
    font-size: 13px;
    color: var(--apk-text);
    background: var(--apk-bg);
    padding-top: 60px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--apk-accent); text-decoration: none; }
a:hover { color: var(--apk-accent-dark); }
img { max-width: 100%; height: auto; }
.apk-clear { clear: both; }

/* ─── Header ─── */
.apk-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: var(--apk-header);
    z-index: 999;
}
.apk-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    height: 60px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.apk-burger {
    display: none;
    border: none; background: none;
    color: #fff; font-size: 24px; cursor: pointer;
    width: 40px; height: 40px;
}
.apk-logo { display: inline-flex; align-items: center; }
.apk-logo img { max-height: 40px; width: auto; display: block; }
.apk-logo-text { font-size: 20px; font-weight: 700; color: #fff; }

.apk-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.apk-nav a {
    display: inline-flex; align-items: center;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 35px;
    padding: 0 15px;
    border-radius: 3px;
}
.apk-nav a:hover { background: var(--apk-accent); color: #fff; }

.apk-header-search { flex: 0 0 auto; width: 280px; }
.apk-header-search form { display: flex; }
.apk-header-search input {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 2px 0 0 2px;
    background: #2a3040;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}
.apk-header-search input::placeholder { color: #8b90a0; }
.apk-header-search button {
    border: 0;
    background: var(--apk-accent);
    color: #fff;
    width: 48px; height: 40px;
    border-radius: 0 2px 2px 0;
    cursor: pointer;
    font-size: 16px;
}

/* ─── Mobile drawer ─── */
.apk-drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 0;
    overflow: hidden;
    background: var(--apk-header);
    z-index: 1100;
    transition: width .25s ease;
    padding-top: 56px;
}
.apk-drawer a {
    display: block;
    padding: 13px 18px;
    color: #fff;
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, .05);
    border-bottom: 1px solid #000;
}
.apk-drawer a:hover { background: rgba(255, 255, 255, .08); }
.apk-drawer .apk-close {
    position: absolute; top: 12px; right: 16px;
    font-size: 26px; border: none; background: none; color: #fff; cursor: pointer;
}

/* ─── Layout ─── */
.apk-container { max-width: 1100px; margin: 0 auto; padding: 20px 12px 30px; }

/* ─── Hero ─── */
.apk-hero {
    background: linear-gradient(135deg, #1d222d 0%, #2b3346 100%);
    color: #fff;
    border-radius: 3px;
    padding: 26px 24px;
    margin-bottom: 24px;
    text-align: center;
}
.apk-hero h1 { margin: 0 0 8px; font-size: 30px; font-weight: 300; }
.apk-hero p { margin: 0 auto 16px; font-size: 15px; opacity: .9; max-width: 700px; }
.apk-hero form { display: flex; max-width: 560px; margin: 0 auto; }
.apk-hero input {
    flex: 1; height: 44px; border: 0; padding: 0 18px;
    border-radius: 2px 0 0 2px; font-size: 16px; outline: none; font-family: inherit;
}
.apk-hero button {
    border: 0; background: var(--apk-accent); color: #fff;
    width: 64px; height: 44px; border-radius: 0 2px 2px 0; cursor: pointer; font-size: 18px;
}

/* ─── Section ─── */
.apk-section { margin-bottom: 30px; }
.apk-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin: 0 4px 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--apk-border);
}
.apk-section-head h1, .apk-section-head h2 { margin: 0; font-size: 22px; font-weight: 400; color: var(--apk-text); }
.apk-section-head a { font-size: 14px; font-weight: 600; }

/* ─── App grid ─── */
.apk-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}
.apk-card {
    position: relative;
    display: block;
    background: var(--apk-surface);
    border-radius: 2px;
    border-bottom: 2px solid var(--apk-accent);
    box-shadow: 2px 2px 2px 0 #e3e3e3;
    padding: 14px;
    text-align: center;
    transition: box-shadow .2s ease, transform .2s ease;
    overflow: hidden;
}
.apk-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(29, 34, 45, .15); }
.apk-thumb { position: relative; overflow: hidden; border-radius: 4px; }
.apk-thumb img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #eee;
    border-radius: 4px;
}
.apk-ribbon {
    position: absolute;
    top: 12px; left: -34px;
    width: 120px;
    padding: 4px 0;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    color: #fff;
    background: var(--apk-ribbon-update);
    transform: rotate(-45deg);
    z-index: 5;
}
.apk-ribbon.apk-ribbon-new { background: var(--apk-ribbon-new); }
.apk-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 10px 0 2px;
    font-size: 14px;
    font-weight: 600;
    color: var(--apk-title);
    line-height: 1.35;
    min-height: 38px;
}
.apk-version { display: block; color: var(--apk-muted); font-size: 12px; margin-bottom: 6px; }

/* ─── Star rating ─── */
.apk-rating { position: relative; display: inline-block; font-size: 14px; line-height: 1; letter-spacing: 2px; white-space: nowrap; }
.apk-rating .apk-stars-off { color: var(--apk-star-off); }
.apk-rating .apk-stars-on { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; color: var(--apk-star); }

/* ─── Panel ─── */
.apk-panel { background: var(--apk-surface); border-radius: 2px; padding: 20px 25px; margin-bottom: 20px; box-shadow: 2px 2px 2px 0 #e3e3e3; }

/* ─── Breadcrumb ─── */
.apk-breadcrumb { font-size: 13px; color: #9f9f9f; margin-bottom: 14px; }
.apk-breadcrumb a { color: #9f9f9f; }
.apk-breadcrumb a:hover { color: var(--apk-accent); }
.apk-breadcrumb span + span::before { content: '›'; margin: 0 8px; color: #c6c6c6; }

/* ─── App detail ─── */
.apk-detail-head { display: flex; gap: 20px; align-items: flex-start; }
.apk-detail-head .apk-detail-icon {
    width: 150px; height: 150px; flex-shrink: 0;
    border-radius: 6px; object-fit: cover;
    box-shadow: 2px 2px 2px 0 #e3e3e3;
}
.apk-detail-head h1 { margin: 0 0 6px; font-size: 27px; color: var(--apk-title); font-weight: 700; }
.apk-detail-head .apk-dev { color: #8e8e8e; font-size: 13px; margin: 0 0 8px; }
.apk-detail-head .apk-rate-line { display: flex; align-items: center; gap: 8px; }
.apk-detail-head .apk-rate-line b { color: var(--apk-accent); font-size: 19px; }

.apk-meta-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.apk-meta-table th, .apk-meta-table td { text-align: left; padding: 10px 12px; font-size: 14px; border: 1px solid #f2f2f2; }
.apk-meta-table th { background: #f6f6f6; color: var(--apk-text); font-weight: 600; width: 38%; }

/* ─── App detail head (reference layout) ─── */
.apk-app-box { padding: 22px 25px; }
.apk-app-headline { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.apk-app-title { margin: 0; font-size: 26px; line-height: 1.25; color: var(--apk-title); font-weight: 700; word-break: break-word; }
.apk-version-badge { display: inline-block; padding: 3px 10px; border-radius: 3px; background: var(--apk-accent); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
.apk-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.apk-cats a { font-size: 12px; padding: 3px 11px; border-radius: 3px; background: #f1f3f4; color: var(--apk-muted); }
.apk-cats a:hover { background: var(--apk-accent); color: #fff; }
.apk-short-desc { font-size: 14px; color: var(--apk-muted); margin: 6px 0 18px; line-height: 1.6; }

.apk-app-grid { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: stretch; margin-bottom: 18px; }
.apk-icon-wrap { position: relative; width: 150px; height: 150px; overflow: hidden; border-radius: 8px; box-shadow: 2px 2px 2px 0 #e3e3e3; }
.apk-icon-wrap .apk-detail-icon { width: 150px; height: 150px; object-fit: cover; display: block; border-radius: 8px; }

.apk-data-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); border: 1px solid #eef0f2; border-radius: 6px; overflow: hidden; }
.apk-data-cell { display: flex; flex-direction: column; justify-content: center; padding: 14px 12px; text-align: center; border-right: 1px solid #eef0f2; }
.apk-data-cell:last-child { border-right: 0; }
.apk-data-cell b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--apk-muted); font-weight: 600; margin-bottom: 7px; }
.apk-data-cell span { font-size: 14px; color: var(--apk-title); font-weight: 600; word-break: break-word; }

.apk-app-actions { display: flex; align-items: center; gap: 20px; }
.apk-app-actions .apk-dl-btn { flex: 1; }
.apk-rate-box { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.apk-rate-box .apk-rating { font-size: 18px; letter-spacing: 3px; }
.apk-rate-avg { font-size: 15px; color: var(--apk-muted); }
.apk-rate-avg b { color: var(--apk-accent); font-size: 19px; }
.apk-rate-votes { font-size: 12px; color: var(--apk-muted); }

.apk-box-title { font-size: 18px; color: var(--apk-title); font-weight: 700; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--apk-accent); }

.apk-dl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.apk-dl-row-single { grid-template-columns: 1fr; }
.apk-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-radius: 3px;
    background: var(--apk-accent);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
    min-height: 52px;
}
.apk-btn:hover { background: var(--apk-accent-dark); color: #fff; }
.apk-btn-tg { background: #08c; }
.apk-btn-tg:hover { background: #0072ad; color: #fff; }

.apk-shots { display: flex; gap: 8px; overflow-x: auto; margin: 18px 0; padding-bottom: 6px; }
.apk-shots img { height: 200px; border-radius: 6px; flex-shrink: 0; }

.apk-content { font-size: 14px; color: var(--apk-text); line-height: 25px; }
.apk-content h2, .apk-content h3 { color: var(--apk-title); margin: 20px 0 10px; }
.apk-content img { border-radius: 6px; }
.apk-content ul { margin: 0 0 20px 18px; }

/* ─── Download page ─── */
.apk-download { text-align: center; padding: 30px 20px; }
.apk-download img.apk-dl-icon { width: 110px; height: 110px; border-radius: 8px; box-shadow: 2px 2px 2px 0 #e3e3e3; }
.apk-download h1 { font-size: 25px; color: var(--apk-title); margin: 14px 0 6px; }
.apk-download .apk-meta { color: var(--apk-muted); margin-bottom: 22px; font-size: 14px; }

/* ─── Reviews ─── */
.apk-rating-summary { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--apk-border); margin-bottom: 8px; }
.apk-rating-score { text-align: center; min-width: 110px; }
.apk-rating-score .apk-score-num { font-size: 46px; font-weight: 700; color: var(--apk-title); line-height: 1; }
.apk-rating-score .apk-score-count { font-size: 12px; color: var(--apk-muted); margin-top: 6px; }
.apk-big-stars { color: var(--apk-star); letter-spacing: 2px; font-size: 18px; }
.apk-big-stars .apk-off { color: var(--apk-star-off); }
.apk-bars { flex: 1; min-width: 220px; }
.apk-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--apk-muted); margin: 4px 0; }
.apk-bar-row .apk-bar-label { width: 12px; text-align: right; }
.apk-bar { flex: 1; height: 8px; background: #eef1f5; border-radius: 6px; overflow: hidden; }
.apk-bar > span { display: block; height: 100%; background: var(--apk-accent); border-radius: 6px; }

.apk-comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--apk-border); }
.apk-comment:last-child { border-bottom: none; }
.apk-comment-avatar img { width: 46px; height: 46px; border-radius: 5px; background: #eef1f5; }
.apk-comment-body { flex: 1; min-width: 0; }
.apk-comment-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.apk-comment-author { font-weight: 700; color: var(--apk-title); font-size: 14px; }
.apk-comment-date { font-size: 12px; color: var(--apk-muted); }
.apk-comment-text { font-size: 14px; color: var(--apk-text); margin-top: 4px; line-height: 21px; }
.apk-comment-text p { margin: 0 0 6px; }
.apk-no-comments { color: var(--apk-muted); font-size: 14px; padding: 10px 0; }

/* ─── Review form (cosmetic) ─── */
.apk-review-form { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--apk-border); }
.apk-review-form h3 { margin: 0 0 14px; font-size: 16px; color: var(--apk-title); font-weight: 700; }
.apk-form-row { margin-bottom: 14px; }
.apk-form-row label { display: block; font-size: 13px; font-weight: 600; color: var(--apk-text); margin-bottom: 6px; }
.apk-form-row select,
.apk-form-row input[type="text"],
.apk-form-row textarea {
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-radius: 3px;
    background: #f2f2f2;
    font-family: inherit;
    font-size: 14px;
    color: var(--apk-text);
    outline: none;
}
.apk-form-row textarea { resize: vertical; min-height: 96px; }
.apk-form-grid { display: grid; grid-template-columns: 200px 1fr; gap: 14px; }
.apk-review-form .apk-btn { width: auto; padding: 11px 26px; min-height: 0; }

/* ─── Categories ─── */
.apk-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }
.apk-cat-grid a { display: block; padding: 11px 8px; color: var(--apk-text); font-size: 15px; border-bottom: 1px solid var(--apk-border); }
.apk-cat-grid a:hover { color: var(--apk-accent); }

/* ─── Notice / 404 ─── */
.apk-notice { color: var(--apk-muted); font-size: 14px; padding: 14px 0; }
.apk-404 { text-align: center; padding: 60px 20px; }
.apk-404 .apk-code { font-size: 140px; line-height: 1; font-weight: 700; color: var(--apk-accent); }

/* ─── Footer ─── */
.apk-footer { background: var(--apk-header); color: #fff; border-top: 2px solid var(--apk-accent); margin-top: 20px; }
.apk-footer-inner { max-width: 1100px; margin: 0 auto; padding: 26px 12px; }
.apk-footer-links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; }
.apk-footer-links a { color: rgba(255, 255, 255, .85); font-size: 14px; }
.apk-footer-links a:hover { color: #fff; }
.apk-footer-copy { font-size: 13px; color: rgba(255, 255, 255, .35); border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 14px; }
.apk-footer-copy b { color: #fff; }

/* ─── Back to top ─── */
.apk-top {
    position: fixed; bottom: 20px; right: 16px;
    width: 40px; height: 40px;
    border: 0; border-radius: 50%;
    background: var(--apk-accent); color: #fff;
    font-size: 20px; cursor: pointer;
    display: none; align-items: center; justify-content: center;
    z-index: 900;
}
.apk-top:hover { background: var(--apk-accent-dark); }
.apk-top.apk-show { display: inline-flex; }

/* ─── Responsive ─── */
@media (max-width: 1100px) { .apk-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 950px) { .apk-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) {
    .apk-nav { display: none; }
    .apk-burger { display: inline-flex; }
    .apk-grid { grid-template-columns: repeat(3, 1fr); }
    .apk-cat-grid { grid-template-columns: repeat(2, 1fr); }
    .apk-app-grid { grid-template-columns: 1fr; gap: 16px; justify-items: center; }
    .apk-data-row { width: 100%; }
    .apk-app-actions { flex-direction: column; align-items: stretch; gap: 12px; }
    .apk-rate-box { justify-content: center; }
}
@media (max-width: 600px) {
    .apk-grid { grid-template-columns: repeat(2, 1fr); }
    .apk-detail-head { flex-direction: column; align-items: center; text-align: center; }
    .apk-detail-head .apk-detail-icon { width: 110px; height: 110px; }
    .apk-dl-row { grid-template-columns: 1fr; }
    .apk-form-grid { grid-template-columns: 1fr; }
    .apk-cat-grid { grid-template-columns: 1fr; }
    .apk-shots img { height: 150px; }
    .apk-header-search { max-width: none; }
}
