:root {
    --main-bg-color: #EEE;
    --main-color: #F5F5F5;
    --box-color: #A1A1A1;
    --box-bg-color: #CCC;
    --text-color: #000;
    --link-hover-color: #FF2805;
    --transition-duration: 0.3s;
}

@media (prefers-color-scheme: dark) {
    :root {
        --main-bg-color: #191919;
        --main-color: #202020;
        --box-color: #3A3A3A;
        --box-bg-color: #292929;
        --text-color: #A3A3A3;
    }
}

/* Base Styles */
body {
    font-size: 1em;
    max-width: 960px;
    margin: auto;
    padding: 2px;
    background: var(--main-bg-color);
    color: var(--text-color);
}

p {
    margin: 0;
    padding: 0;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-duration);
}

a:link {
    color: var(--text-color);
    text-decoration: none;
}

a:visited {
    color: var(--text-color);
    text-decoration: none;
}

a:active {
    color: var(--text-color);
    text-decoration: none;
}

a:hover {
    color: var(--text-color);
    text-decoration: underline;
    position: relative;
    left: 1px;
    top: 1px;
}

iframe {
    max-width: 100%;
}

/* Layout */
.tp-box {
    border: 1px solid;
    background: var(--main-bg-color);
    margin: 0 auto;
}

/* Typography */
.tp-box h1 {
    color: var(--text-color);
    font-size: 2em;
    text-align: center;
    line-height: 200%;
    overflow: hidden;
    margin: 0 auto;
    letter-spacing: .2em;
}

.tp-box h2 {
    background-color: var(--box-bg-color);
    font-size: 20px;
    font-weight: 700;
    line-height: 200%;
    overflow: hidden;
    margin: 0 auto;
    text-align: center;
}

.tp-box h3 {
    background-color: var(--box-color);
    color: var(--text-color);
    font-size: 1em;
    font-weight: 700;
    line-height: 200%;
    overflow: hidden;
    margin: 0 auto;
    text-align: center;
}

/* Navigation */
.tp-box ul {
    overflow: hidden;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.tp-box ul li {
    line-height: 200%;
    font-size: 14px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: clip;
    float: left;
    width: 12.5%;
    text-align: center;
}

/* Ad Section */
.ad {
    background: #fff;
    overflow: hidden;
    clear: both;
    border-radius: 6px;
}

.ad a {
    margin: 2px;
    display: block;
    border-radius: 3px;
}

.ad img {
    max-width: 100%;
}

.ad li {
    float: left;
    width: 50%;
    list-style: none;
}

/* Text Ad */
.txtgg {
    width: 100%;
    overflow: hidden;
    display: block;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);
}

.txtgg a {
    width: calc((100% - 20px) / 4);
    float: left;
    border-radius: 2px;
    line-height: 35.35px;
    height: 35.35px;
    text-align: center;
    font-size: 14px;
    color: #fff;
    display: inline-block;
    background-color: rgb(255, 153, 159);
    margin: 2.5px;
    transition-duration: .3s;
}

.txtgg a:nth-child(1) {
    background-color: #dc3545;
}

.txtgg a:nth-child(2) {
    background-color: #007bff;
}

.txtgg a:nth-child(3) {
    background-color: #28a745;
}

.txtgg a:nth-child(4) {
    background-color: #ffc107;
}

.txtgg a:nth-child(5) {
    background-color: #28a745;
}

.txtgg a:nth-child(6) {
    background-color: #ffc107;
}

.txtgg a:nth-child(7) {
    background-color: #dc3545;
}

.txtgg a:nth-child(8) {
    background-color: #007bff;
}

.txtgg a:hover {
    background: #FF2805;
    color: #FFF;
}

/* 热门应用APP图标版块 */
.hot-apps {
    width: 100%;
    overflow: hidden;
    display: block;
}

.app-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 5px 0;
    background-color: var(--main-color);
}

.app-item {
    width: 10%;
    padding: 8px;
    box-sizing: border-box;
    text-align: center;
}

.app-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
}

.app-item img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    margin-bottom: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.app-item span {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Footer */
footer {
    background-color: var(--box-color);
    color: var(--text-color);
    font-size: 1em;
    font-weight: 700;
    line-height: 200%;
    overflow: hidden;
    margin: 0 auto;
    text-align: center;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    body {
        min-width: 100%;
        width: 100%;
        padding: 0;
    }

    img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
    }

    .tp-box {
        width: 100%;
        margin: 0;
        border: none;
    }

    .tp-box ul li {
        width: 25%;
    }

    .ad li {
        width: 50%;
    }

    .txtgg a {
        width: calc((100% - 20px) / 4);
    }

    .app-item {
        width: 20%;
    }
}

@media screen and (max-width: 480px) {
    .tp-box ul li {
        width: 25%;
    }

    .txtgg a {
        width: calc((100% - 15px) / 3);
    }

    .app-item {
        width: 20%;
        padding: 5px;
    }
    
    .app-item img {
        width: 40px;
        height: 40px;
    }
}

@media(max-width: 999px) {
    .ad li {
        width:50%;
    }
}

@media screen and (max-width: 1000px) {
    .txtgg a {
        width: calc((100% - 20px) / 4);
        float: left;
        border-radius: 2px;
        line-height: 35.35px;
        height: 35.35px;
        text-align: center;
        font-size: 14px;
        color: #fff;
        display: inline-block;
        background-color: rgb(255, 153, 159);
        margin: 2.5px;
        transition-duration: .3s;
    }
}

@media screen and (min-width: 1000px) {
    .txtgg a {
        width: calc((100% - 40px) / 8);
    }
}