body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #FFFFFF;
}

#header {
    position: relative;
    height: 60px;
    background-color: #383838;
    border-bottom: 2px solid #C0C0C0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}

#header #logo {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    cursor: pointer;
}

#header #title {
    display: flex;
    align-items: center;
}

#header #title h1 {
    margin: 0;
    font-size: 28px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 5px #000000;
    cursor: pointer;
}

#header #time {
    font-size: 14px;
    color: #FFFFFF;
    margin-right: 10px;
    cursor: pointer;
}

#header #title-time {
    display: flex;
    align-items: center;
    cursor: pointer;
}

#header #title-time h2 {
    font-size: 20px;
    color: #FFFFFF;
    margin: 0 10px;
    text-shadow: 2px 2px 5px #000000;
    cursor: pointer;
}

#header #about {
    font-size: 14px;
    color: #FFFFFF;
    cursor: pointer;
    text-shadow: 2px 2px 5px #000000;
}

#content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 600px;
}

#content h1 {
    font-size: 60px;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: 2px 2px 5px #000000;
    animation: rainbow 2s ease-in-out infinite;
}

.grid {
    display: grid;
    grid-template-columns: repeat(117, 10px);
    grid-template-rows: repeat(190, 10px);
    gap: 0;
    margin: 0 auto;
    width: 1170px;
    height: 1900px;
    background-color: #000000;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.grid div {
    background-color: transparent;
    border: 0.5px solid #333333;
    box-sizing: border-box;
    width: 10px;
    height: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

.grid div:hover {
    background-color: #FFD700;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal {
    background-color: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    max-width: 600px;
    width: 80%;
    text-align: center;
}

.modal-content {
    display: none;
    text-align: left;
    padding: 20px;
    background-color: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-content h2 {
    font-size: 28px;
    font-weight: bold;
    color: #383838;
    margin-bottom: 10px;
}

.modal-content p {
    font-size: 16px;
    line-height: 1.6;
    color: #555555;
    margin-bottom: 15px;
}

.modal-content img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.about-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #383838;
    border-radius: 5px;
    padding: 15px;
    z-index: 999;
}

.about-link {
    cursor: pointer;
    color: #007bff;
    font-size: 18px;
    margin-right: 20px;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.about-link:last-child {
    margin-right: 0;
}

.about-link:hover {
    color: #0056b3;
}

.friend-links {
    display: flex;
    justify-content: space-around;
    background-color: #383838;
    padding: 14px 0;
    color: #FFFFFF;
    flex-wrap: wrap;
}

.friend-links-cn,
.friend-links-foreign {
    flex-basis: 100%;
}

.friend-links-cn h3,
.friend-links-foreign h3 {
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #FFFFFF;
    color: #FFD700;
}

.friend-links-foreign ul {
    list-style-type: none;
    padding: 0;
    margin: 10px 0;
    column-count: 1;
    column-gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.friend-links-cn ul {
    list-style-type: none;
    padding: 0;
    margin: 10px 0;
    column-count: 2;
    column-gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.friend-links-cn ul li a,
.friend-links-foreign ul li a {
    color: #FFFFFF;
    text-decoration: none;
    transition: color 0.3s;
}

.friend-links-cn ul li a:hover,
.friend-links-foreign ul li a:hover {
    color: #FFA500;
}

/* 响应式调整 */
@media screen and (max-width: 767px) {
    #header {
        padding: 10px;
        height: auto;
        flex-direction: column;
        align-items: center;
    }

    #header #logo {
        margin-right: 0;
    }

    #header #title h1 {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    #header #title-time h2 {
        font-size: 16px;
    }

    #content h1 {
        font-size: 40px;
    }

    .grid {
        max-width: 100%;
        width: auto;
        margin: 10px;
        /* 移除了原来缩小的网格单元格尺寸，保持与PC端一致 */
        grid-template-columns: repeat(117, 10px);
        grid-template-rows: repeat(190, 10px);
        width: 1170px;
        height: 1900px;
        /* 添加横向滚动以便在小屏幕上浏览整个网格 */
        overflow-x: auto;
    }

    /* 单元格尺寸保持与PC端一致，确保可点击性 */
    .grid div {
        /* 移除了原来缩小的单元格尺寸，保持与PC端一致 */
        width: 10px;
        height: 10px;
        border: 0.5px solid #333333;
    }

    .modal {
        max-width: 100%;
        width: 90%;
    }
    
    .friend-links-cn,
    .friend-links-foreign {
        flex-basis: 100%;
    }
    
    .friend-links-cn ul,
    .friend-links-foreign ul {
        column-count: 1;
    }
}

@keyframes rainbow {
    0% {
        color: #ffd700;
        text-shadow: 2px 2px 5px #000000;
    }
    25% {
        color: #c0c0c0;
        text-shadow: 2px 2px 5px #ffffff;
    }
    50% {
        color: #ffffff;
        text-shadow: 2px 2px 5px #000000;
    }
    75% {
        color: #808080;
        text-shadow: 2px 2px 5px #ffffff;
    }
    100% {
        color: #c0c0c0;
        text-shadow: 2px 2px 5px #ffffff;
    }
}

#footer {
    height: auto;
    background-color: #1A1A1A;
    border-top: 2px solid #444444;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #CCCCCC;
    text-shadow: 2px 2px 5px #000000;
    padding: 10px 20px;
}

#footer p {
    margin: 5px 0;
}

.police-info {
    display: flex;
    align-items: center;
}

.police-info img {
    margin-right: 10px;
}

#footer a {
    color: #FFD700;
    text-decoration: none;
    text-shadow: 2px 2px 5px #000000;
    margin-left: 15px;
}