:root {
    --cg-bg: #efefef;
    --cg-card: #ffffff;
    --cg-line: #e0e0e0;
    --cg-dark: #17181d;
    --cg-text: #222;
    --cg-subtle: #666;
    --cg-accent: #ff7a00;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--cg-bg);
    color: var(--cg-text);
    font-family: "Segoe UI", Tahoma, Verdana, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.cg-header {
    background: #fff;
    border-bottom: 1px solid var(--cg-line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.cg-header-inner {
    width: min(1180px, 94vw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 56px;
}

.cg-logo {
    background: var(--cg-accent);
    color: #fff;
    font-weight: 800;
    font-size: 1.75rem;
    letter-spacing: 1px;
    padding: 4px 14px;
    line-height: 1;
    border-radius: 3px;
}

.cg-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    text-transform: lowercase;
}

.cg-nav > a,
.cg-nav-dropdown > a {
    color: #3a3a3a;
}

.cg-nav > a:hover,
.cg-nav-dropdown > a:hover {
    color: var(--cg-accent);
}

.cg-nav-dropdown {
    position: relative;
}

.cg-dropdown-menu {
    position: absolute;
    top: 130%;
    left: 0;
    background: #fff;
    border: 1px solid var(--cg-line);
    min-width: 220px;
    display: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.cg-dropdown-menu a {
    display: block;
    padding: 10px 12px;
    font-size: 0.84rem;
}

.cg-dropdown-menu a:hover {
    background: #f7f7f7;
}

.cg-nav-dropdown:hover .cg-dropdown-menu,
.cg-nav-dropdown:focus-within .cg-dropdown-menu {
    display: block;
}

.main-layout {
    width: min(1180px, 94vw);
    margin: 16px auto 0;
}

.cg-top-strip,
.cg-bottom-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 18px;
}

.cg-top-strip {
    position: static;
    top: auto;
    z-index: auto;
    background: transparent;
    padding: 0;
}

.cg-strip-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e7ed;
    box-shadow: 0 2px 8px rgba(18, 31, 43, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.cg-strip-card:hover {
    transform: translateY(-2px);
    border-color: #cfd9e3;
    box-shadow: 0 8px 18px rgba(18, 31, 43, 0.12);
}

.cg-strip-card:focus-visible {
    outline: 2px solid rgba(255, 122, 0, 0.45);
    outline-offset: 2px;
}

.cg-strip-card img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}

.cg-strip-card p {
    margin: 6px 0 0;
    font-size: 0.74rem;
    line-height: 1.2;
    color: #404040;
}

.cg-page-grid {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) 250px;
    gap: 18px;
    align-items: start;
}

.cg-left-rail,
.cg-right-rail {
    position: static;
    top: auto;
    align-self: start;
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.cg-side-box,
.cg-widget {
    background: var(--cg-card);
    border: 1px solid var(--cg-line);
    margin-bottom: 12px;
    padding: 12px;
}

.cg-side-box h3,
.cg-widget h3 {
    margin: 0 0 10px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: lowercase;
}

.cg-side-box a {
    display: block;
    border-top: 1px solid #efefef;
    padding: 8px 0;
    font-size: 0.8rem;
    color: #555;
}

.cg-ad-thumb {
    display: block;
    margin-bottom: 10px;
}

.cg-ad-thumb img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

.cg-main-feature {
    min-height: 360px;
    background-size: cover;
    background-position: center;
    position: relative;
    margin-bottom: 12px;
}

.cg-main-feature a {
    display: block;
    min-height: 360px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cg-main-feature a:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
}

.cg-main-feature a:focus-visible {
    outline: 2px solid rgba(255, 122, 0, 0.5);
    outline-offset: 2px;
}

.cg-main-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff;
    padding: 14px;
}

.cg-main-overlay span {
    display: inline-block;
    background: var(--cg-accent);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    margin-bottom: 8px;
}

.cg-main-overlay h2 {
    margin: 0 0 6px;
    font-size: 1.4rem;
    line-height: 1.2;
}

.cg-main-overlay p {
    margin: 0;
    font-size: 0.82rem;
}

.cg-feed-item {
    background: var(--cg-card);
    border: 1px solid var(--cg-line);
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(18, 31, 43, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.cg-feed-item:hover {
    transform: translateY(-2px);
    border-color: #cfd9e3;
    box-shadow: 0 10px 20px rgba(18, 31, 43, 0.12);
}

.cg-feed-link {
    display: grid;
    grid-template-columns: 165px minmax(0, 1fr);
    gap: 10px;
    padding: 8px;
}

.cg-feed-link:focus-visible {
    outline: 2px solid rgba(255, 122, 0, 0.45);
    outline-offset: 2px;
}

.cg-feed-link img {
    width: 100%;
    height: 95px;
    object-fit: cover;
    display: block;
}

.cg-feed-link small {
    font-size: 0.68rem;
    color: #777;
}

.cg-feed-link h3 {
    margin: 4px 0;
    font-size: 0.95rem;
    line-height: 1.2;
}

.cg-feed-link p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
}

.cg-view-more-wrap {
    text-align: center;
    padding: 10px 0 4px;
}

.cg-view-more {
    display: inline-block;
    background: #dfdfdf;
    color: #555;
    font-size: 0.82rem;
    padding: 8px 22px;
}

.cg-feed-icons {
    display: flex;
    gap: 8px;
}

.cg-feed-icons a {
    display: inline-block;
    padding: 7px 10px;
    font-size: 0.72rem;
    background: #ff8e2b;
    color: #fff;
    font-weight: 700;
}

.cg-feed-icons a:last-child {
    background: #7ab83f;
}

.cg-social-icons {
    display: flex;
    gap: 10px;
}

.cg-social-icons a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    background: #2494e8;
}

.cg-social-icons a:last-child {
    background: #e23a3a;
}

.cg-mini-card {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.72rem;
    border: 1px solid #e2e7ed;
    background: #fff;
    box-shadow: 0 2px 7px rgba(18, 31, 43, 0.06);
    padding: 8px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.cg-mini-card:hover {
    transform: translateY(-2px);
    border-color: #cfd9e3;
    box-shadow: 0 8px 18px rgba(18, 31, 43, 0.12);
}

.cg-mini-card:focus-visible {
    outline: 2px solid rgba(255, 122, 0, 0.45);
    outline-offset: 2px;
}

.cg-mini-card span {
    grid-column: 1 / -1;
    color: var(--cg-accent);
    font-weight: 700;
}

.cg-mini-card img {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.cg-mini-card p {
    margin: 0;
    color: #555;
    line-height: 1.3;
}

.cg-random-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    border: 1px solid #e2e7ed;
    background: #fff;
    box-shadow: 0 2px 7px rgba(18, 31, 43, 0.06);
    padding: 6px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.cg-random-row:hover {
    transform: translateY(-2px);
    border-color: #cfd9e3;
    box-shadow: 0 8px 18px rgba(18, 31, 43, 0.12);
}

.cg-random-row:focus-visible {
    outline: 2px solid rgba(255, 122, 0, 0.45);
    outline-offset: 2px;
}

.cg-random-row img {
    width: 52px;
    height: 52px;
    object-fit: cover;
}

.cg-random-row p {
    margin: 0;
    font-size: 0.74rem;
    color: #565656;
}

.cg-footer {
    margin-top: 24px;
    background: var(--cg-dark);
    color: #ddd;
}

.cg-footer-inner {
    width: min(1180px, 94vw);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 20px 0;
}

.cg-footer-links,
.cg-footer-tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cg-footer-links a,
.cg-footer-tags a {
    font-size: 0.72rem;
    color: #ddd;
    border: 1px solid #2c2d33;
    padding: 4px 8px;
}

.cg-footer-tags a {
    background: #1e1f25;
}

@media (max-width: 1100px) {
    .cg-page-grid {
        grid-template-columns: 1fr;
    }

    .cg-top-strip,
    .cg-bottom-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cg-left-rail,
    .cg-right-rail {
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .cg-home-page .cg-center-feed,
    .cg-download-page .cg-center-feed {
        order: 1;
    }

    .cg-home-page .cg-left-rail,
    .cg-download-page .cg-left-rail {
        order: 2;
    }

    .cg-home-page .cg-right-rail,
    .cg-download-page .cg-right-rail {
        order: 3;
    }

    .cg-home-page .cg-left-rail .cg-ad-thumb:nth-of-type(n + 5),
    .cg-download-page .cg-left-rail .cg-ad-thumb:nth-of-type(n + 5) {
        display: none;
    }

    .cg-top-strip {
        position: static;
        top: auto;
        z-index: auto;
        background: transparent;
        padding: 0;
    }
}

@media (max-width: 700px) {
    .cg-header-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
    }

    .cg-nav {
        gap: 12px;
    }

    .cg-top-strip,
    .cg-bottom-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cg-feed-link {
        grid-template-columns: 1fr;
    }

    .cg-feed-link img {
        height: 180px;
    }

    .cg-left-rail,
    .cg-right-rail {
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .cg-left-rail .cg-side-box,
    .cg-right-rail .cg-widget {
        grid-column: 1 / -1;
    }

    .cg-footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

.cg-ad-overlay-title {
    display: none;
}
.cg-logo img {
    height: 34px;
    width: auto;
    display: block;
}
.cg-left-rail .cg-ad-thumb {
    position: relative;
    overflow: hidden;
}

.cg-left-rail .cg-ad-overlay-title {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: auto;
    background: linear-gradient(rgba(0,0,0,0.82), rgba(0,0,0,0.45), transparent);
    color: #fff;
    padding: 8px 10px 20px;
    font-size: 0.73rem;
    line-height: 1.25;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}