* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 防止页面移动的全局设置 */
html {
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: Arial, sans-serif;
    background-color: #FBF8F2;
    /* 防止页面移动 */
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

main {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    /* 防止页面移动 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    /* 确保容器稳定 */
    position: relative;
    z-index: 1;
    /* 允许滚动 */
    overflow-y: auto;
    height: 100%;
}

/* 顶部区域样式 */
.top-section {
    width: 100%;
    height: 420px;
    background-image: url('../images/topbanner.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}

.top-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

.content-wrapper {
    width: 100%;
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
    padding: 0 110px;
}

.content-wrapper h1 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 2.5rem;
    letter-spacing: 0.05em;
}

.description {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: 0.05em;
}

/* 计算器区域样式 */
.calculator-section {
    width: 100%;
    height: 420px;
    background-color: #A3825D;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    /* 防止动画影响容器 */
    overflow: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.elements-circle {
    position: absolute;
    width: 400px;
    height: 400px;
    z-index: 1;
    /* 防止动画影响布局 */
    overflow: hidden;
    contain: layout style paint;
}

.elements-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.calculator-form {
    position: relative;
    z-index: 2;
}

.form-wrapper {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1.8rem;
    border-radius: 5px;
    text-align: center;
    width: 560px;
    max-width: 90vw;
}

.form-wrapper h2 {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 1.8rem;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

.form-controls {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 1.8rem;
}

select {
    width: 110px;
    padding: 0.6rem;
    border: 1px solid #000;
    background-color: white;
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 1em;
}

button#startTest {
    background-color: black;
    color: white;
    border: none;
    padding: 0.6rem 2.5rem;
    font-size: 13px;
    cursor: pointer;
    letter-spacing: 0.05em;
    min-width: 140px;
}

/* 响应式样式 */
@media (max-width: 768px) {
    main {
        width: 100%;
    }

    .content-wrapper {
        padding: 0 20px;
    }

    .content-wrapper h1 {
        font-size: 16px;
        margin-bottom: 1.5rem;
        letter-spacing: 0.03em;
    }

    .description {
        font-size: 12px;
        gap: 1rem;
        line-height: 1.5;
    }

    .elements-circle {
        width: 300px;
        height: 300px;
    }

    .form-wrapper {
        padding: 1rem;
    }

    .form-wrapper h2 {
        font-size: 16px;
        margin-bottom: 1rem;
    }

    .form-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    select {
        width: calc(50% - 0.25rem);
        font-size: 12px;
        padding: 0.4rem;
    }

    button#startTest {
        font-size: 12px;
        padding: 0.4rem 1.5rem;
        min-width: 100px;
    }

    .top-section,
    .calculator-section {
        height: auto;
        min-height: 400px;
    }
}

/* 旋转动画关键帧 */
@keyframes smoothRotation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 五行圆圈容器 */
.elements-circle {
    position: absolute;
    width: 400px;
    height: 400px;
    z-index: 1;
    transition: animation-duration 0.5s linear;
}

/* 基础旋转 */
.elements-circle.rotating {
    animation: smoothRotation 3s linear infinite;
    /* 确保动画不影响布局 */
    transform-origin: center center;
    will-change: transform;
}

/* 动画时长修改类 */
.elements-circle.speed-1 {
    animation-duration: 3s;
}

.elements-circle.speed-2 {
    animation-duration: 1s;
}

.elements-circle.speed-3 {
    animation-duration: 0.3s;
}

/* 停止旋转类 */
.elements-circle.stop-rotating {
    animation: none;
    transition: transform 0.3s ease-out;
} 