:root {
    --card-width: 8.5rem;
    --card-padding: 0.75rem;
    --avatar-size: 5rem;
    --border-radius: 0.75rem;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -1;
    opacity: 0;
    transition: opacity 1s ease;
}

.bg-overlay.loaded {
    opacity: 1;
}
/* 添加一个伪元素作为遮罩层，解决背景过亮导致文字看不清的问题 */
.bg-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色，0.5的透明度可以按需调整 */
}


.glass-effect {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.glass {
    margin: 4vh auto;
    width: 90%;
    max-width: 90rem;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.glass.show {
    opacity: 1;
    transform: scale(1);
}

.intro-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    padding: clamp(1rem, 3vw, 2rem);
    text-align: center;
    z-index: 1000;
    min-width: min-content;
    width: auto;
    max-width: 90%;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.intro-popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.loading-spinner {
    width: clamp(1.5rem, 5vw, 2.5rem);
    height: clamp(1.5rem, 5vw, 2.5rem);
    border: clamp(2px, 0.5vw, 4px) solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin: clamp(0.75rem, 2vw, 1.25rem) auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.text-shadow {
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-width), 1fr));
    gap: clamp(0.5rem, 2vw, 1rem);
    width: 100%;
    justify-items: center;
}

.member-card {
    width: var(--card-width);
    height: 23rem !important; /* 使用 !important 强制覆盖冲突样式，进行诊断 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: var(--card-padding);
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: clamp(0.5rem, 1.5vw, 1rem);
    overflow: hidden; /* 隐藏任何可能溢出的内容 */
}

.member-card .img-container {
    width: var(--avatar-size);
    height: var(--avatar-size);
    margin-bottom: clamp(0.25rem, 1vw, 0.5rem);
}

.member-card strong,
.member-card span,
.member-card p {
    word-break: break-word;
}

.member-card img {
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: clamp(0.25rem, 1vw, 0.5rem);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.member-card a {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.member-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1200px) {
    :root {
        --card-width: 7.5rem;
        --avatar-size: 4.5rem;
    }
    body {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    :root {
        --card-width: 7rem;
        --card-padding: 0.6rem;
        --avatar-size: 4rem;
        --border-radius: 0.6rem;
    }
    body {
        font-size: 14px;
    }
    .member-card p {
        font-size: 0.7rem;
    }
    .glass {
        width: 95%;
        margin: 3vh auto;
        padding: clamp(0.75rem, 3vw, 1.5rem) !important;
    }
}

@media (max-width: 640px) {
    :root {
        --card-width: 6rem;
        --card-padding: 0.5rem;
        --avatar-size: 3.5rem;
        --border-radius: 0.5rem;
    }
    body {
        font-size: 13px;
    }
    h1 {
        font-size: clamp(1.25rem, 5vw, 1.875rem) !important;
    }
    .member-card strong {
        font-size: 0.8rem;
    }
    .member-card span {
        font-size: 0.7rem;
    }
    .member-card p {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    :root {
        --card-width: 5.5rem;
        --avatar-size: 3rem;
    }
    .grid {
        gap: 0.5rem;
    }
    .member-card {
        margin: 0.4rem;
    }
}

@media (min-width: 2000px) {
    :root {
        --card-width: 10rem;
        --avatar-size: 6rem;
    }
    body {
        font-size: 18px;
    }
}
