body {
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

header, footer {
    background-color: #333;
    color: white;
    text-align: center;
    position: fixed;
    width: 100%;
    z-index: 1;
}

header {
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px;
    height: 60px;
}

footer {
    height: 30px;
    padding: 1rem;
    bottom: 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 0; /* 确保 footer 在 overlay 下面 */
}

main {
    background-color: #ffffff;
    flex: 1;
    overflow-y: auto; /* Allow vertical scrolling */
    display: block;
    padding: 20px 20px; /* Adjust top padding to account for fixed header */
    position: absolute;
    width: 100%;
    top: 60px;
    bottom: 60px;
    left: 0px;
    right: 0px;
}

/* Sidebar styles */
.sidebar {
    width: 240px;
    height: 100%;
    position: fixed;
    top: 0;
    left: -240px; /* Initially hidden */
    background-color: #111;
    overflow-x: hidden;
    transition: 0.3s;
    padding-top: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    vertical-align: center;
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
}

.sidebar ul li {
    padding: 8px;
    text-align: center;
}

.sidebar ul li a {
    color: white;
    text-decoration: none;
    display: block;
}

.sidebar ul li a:hover {
    background-color: #575757;
}

/* Button styles */
#sidebarToggle {
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    color: #ffffff;
    padding: 10px;
    position: absolute;
    left: 20px;
}
#languageToggle {
    font-size: 16px;
    cursor: pointer;
    background: none;
    border: none;
    color: #ffffff;
    position: absolute;
    right: 35px;
}

/* Overlay styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(0);
    transition: backdrop-filter 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
    z-index: 1; /* 确保 overlay 在 footer 上面 */
}

.footer-link {
    color: white;
}

.content-section {
    margin-bottom: 40px;
}

.content-section h2 {
    margin: 0 0 20px 0;
    color: #333;
}

.button-container {
    display: flex;
    flex-wrap: wrap; /* 允许按钮换行 */
    gap: 10px;
    max-width: 100%;
}

.square-button {
    padding: 0;
    width: 160px;
    height: 80px;
    background-color: #333;
    color: white;
    border-radius: 10px;
    border-width: 0px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease-in-out;
}

.square-button:hover {
    background-color: #555;
}

.button-container a {
    display: inline-block;
    text-decoration: none;
}

/* Sidebar header styles */
.website-logo {
    width: 50px;
    height: 50px;
}
.sidebar-title {
    padding: 10px;
    text-align: center;
    color: white;
    background-color: #111; /* Match sidebar background */
    font-weight: bold;
    border-bottom: 1px solid #575757; /* Optional: add a border for separation */
    width: 100%;
}

.visitor-counter {
    position: fixed;
    bottom: 5%;
    color: white;
    overflow: hidden;
}