body {
    font-family: 'Roboto', 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: #fff;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #1a1a1a;
    position: relative;
    padding-bottom: 40px; /* 略大于进度条高度 */
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a, #1a1a1a);
    z-index: -1;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1 {
    text-align: center;
    color: #fff;
    margin-bottom: 30px;
    font-weight: 700;
    font-size: 24px;
}

.question {
    background-color: rgba(42, 42, 42, 0.8);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
}

.question.visible {
    opacity: 1;
    transform: translateY(0);
}

.question p {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #fff;
}

.options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.option {
    flex: 1 1 calc(20% - 10px);
    padding: 10px 15px;
    border: 2px solid #4a4a4a;
    background-color: rgba(58, 58, 58, 0.8);
    color: #fff;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s;
    font-weight: normal;
    text-align: center;
}

.option:hover {
    border-color: #fff;
    background-color: rgba(74, 74, 74, 0.8);
}

.option.selected {
    background-color: rgba(255, 255, 255, 0.8);
    color: #1a1a1a;
    border-color: #fff;
}

#result-container {
    margin-top: 20px;
    background-color: #2a2a2a;
    padding: 20px;
    min-height: 200px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: #fff;
    display: none;
}

#result-container:not(.hidden) {
    display: block;
}

.language-switch {
    position: absolute;
    top: 10px; 
    right: 10px;
    background-color: #2a2a2a;
    border-radius: 25px;
    padding: 5px;
    display: flex;
}

.language-switch button {
    background-color: transparent;
    border: none;
    color: #fff;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 20px;
    font-size: 14px;
}

.language-switch button.active {
    background-color: #4a4a4a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#loading, #result-container, #result {
    display: none;
}

.hidden {
    display: none !important;
}

#loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100px;
    margin: 15px 0;
}

.loader {
    width: 30px !important;
    height: 30px !important;
    border: 3px solid #2a2a2a; /* 边框颜色 */
    border-top-color: #4a4a4a; /* 顶部边框颜色不同，创造旋转效果 */
    border-radius: 50% !important; /* 设置为 50% 使其成为圆形 */
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite; /* 应用旋转动画 */
    margin-bottom: 15px;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-text {
    font-size: 16px;
    color: #4a4a4a;
    font-weight: 500;
    text-align: center;
}

#result-container h2 {
    color: white;
    font-weight: bold;
    font-size: 28px;
    text-align: center;
    font-family: 'IBM Plex Serif', serif;
}

#result-container h3 {
    color: white;
    font-size: 18px;
    text-align: center;
}

#restart-button {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background-color: #3a3a3a;
    color: white;
    border: 2px solid white;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

#restart-button:hover {
    background-color: white;
    color: #1a1a1a;
}

/* 移动端适配 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 20px;
        margin-top: 40px;
    }

    .question {
        padding: 15px;
    }

    .question p {
        font-size: 14px;
    }

    .options {
        flex-direction: column;
    }

    .option {
        flex: 1 1 100%;
        padding: 8px 12px;
        font-size: 14px;
    }

    .language-switch {
        top: 5px;
        right: 5px;
    }

    .language-switch button {
        padding: 3px 8px;
        font-size: 12px;
    }

    #result-container h2 {
        font-size: 24px;
    }

    #result-container h3 {
        font-size: 16px;
    }

    #loading {
        height: 80px;
    }

    .loader {
        width: 24px;
        height: 24px;
        border-width: 2px;
        margin-bottom: 10px;
    }

    #loading-text {
        font-size: 14px;
    }
}

#progress-bar-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px; /* 增加到30px */
    background-color: #2a2a2a;
    z-index: 1000;
}

#progress-bar {
    width: 0;
    height: 100%;
    background-color: #4a4a4a;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

#progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    animation: wave 2s linear infinite;
}

@keyframes wave {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
