* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa, #e1effe); /* 修改背景为渐变 */
}

.container {
    max-width: 800px;
    margin: 40px auto; /* 增加外边距 */
    padding: 30px; /* 内边距增大 */
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.description {
    font-size: 16px;
    color: #7f8c8d;
}

#progress-container {
    margin: 20px 0;
    background-color: #ecf0f1;
    border-radius: 10px;
    height: 15px;
    overflow: visible; /* 改为 visible，允许文本溢出显示 */
    position: relative;
    margin-bottom: 30px; /* 增加底部间距，为文本留出空间 */
}

#progress-bar {
    height: 100%;
    background-color: #3498db;
    width: 0%;
    transition: width 0.3s ease;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 10px; /* 添加圆角 */
}

#progress-text {
    text-align: center;
    margin-top: 10px; /* 增加与进度条的间距 */
    font-size: 14px;
    color: #7f8c8d;
    position: absolute; /* 绝对定位 */
    width: 100%; /* 确保文本容器占满宽度 */
    left: 0;
    bottom: -25px; /* 向下移动文本 */
}

main {
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    min-height: 400px;
}

.question {
    margin-bottom: 25px;
}

.question h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.options {
    list-style-type: none;
}

.option {
    margin: 10px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.option:hover {
    background-color: #f5f7fa;
    border-color: #3498db;
    transform: scale(1.02);
}

.option.selected {
    background-color: #e1f0fa;
    border-color: #3498db;
}

.module-title {
    font-size: 22px;
    margin: 30px 0 20px;
    color: #2c3e50;
    text-align: center;
}

button {
    display: block;
    width: 200px;
    margin: 30px auto 0;
    padding: 12px 0;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 25px;  /* 改为更圆润 */
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

button:hover {
    background-color: #2980b9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.button-group button {
    width: 120px;
    margin: 0;
}

#results-screen {
    text-align: center;
}

#score-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 30px 0;
}

.score-item {
    margin: 10px 20px;
    font-size: 18px;
}

.score-label {
    font-weight: bold;
    color: #7f8c8d;
}

.score-value {
    font-size: 24px;
    color: #2c3e50;
}

#result-type {
    margin: 30px 0;
    padding: 20px;
    background-color: #e1f0fa;
    border-radius: 10px;
}

#type-name {
    font-weight: bold;
    color: #3498db;
}

#traits-container, #recommendations {
    text-align: left;
    margin: 30px 0;
}

#traits-list, #recommendations ol {
    margin-left: 20px;
    margin-top: 10px;
}

#traits-list li, #recommendations li {
    margin-bottom: 8px;
}

footer {
    text-align: center;
    margin-top: 30px;
    font-size: 14px;
    color: #7f8c8d;
}

.hidden {
    display: none !important;
}

.active {
    display: block;
}

#start-screen {
    text-align: center;
}

#start-screen p {
    margin: 15px 0;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .container {
        margin: 20px 15px;
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    main {
        padding: 20px;
        min-height: 300px;
    }

    .question h3 {
        font-size: 18px;
    }

    .option {
        padding: 12px;
        font-size: 15px;
        /* 增加触摸区域 */
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    button {
        width: 100%;
        /* 增加触摸区域 */
        min-height: 44px;
        font-size: 16px;
    }

    .button-group {
        gap: 10px;
    }
    
    .button-group button {
        width: 45%;
        min-height: 44px;
    }

    #score-summary {
        flex-direction: column;
    }

    .score-item {
        width: 100%;
        margin: 5px 0;
    }

    /* 优化触摸交互 */
    .option:hover {
        transform: none;
    }

    /* 添加触摸反馈 */
    .option:active {
        background-color: #e1f0fa;
        border-color: #3498db;
    }
}

/* 优化移动端方向 */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .container {
        margin: 10px;
    }

    #progress-container {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 100;
        padding: 5px 0;
    }
}
