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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    position: relative;
}

/* 移动端容器优化 */
@media (max-width: 768px) {
    .container {
        margin: 8px;
        border-radius: 16px;
        box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    }
}

@media (max-width: 480px) {
    .container {
        margin: 5px;
        border-radius: 12px;
        box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    }
}

header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
    position: relative;
}

@media (max-width: 768px) {
    header {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 18px 12px;
    }
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.2;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.6rem;
        margin-bottom: 6px;
    }
}

header p {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.4;
}

@media (max-width: 480px) {
    header p {
        font-size: 0.9rem;
        line-height: 1.3;
    }
}

.test-container {
    padding: 25px 20px;
    min-height: 350px;
}

@media (max-width: 768px) {
    .test-container {
        padding: 20px 15px;
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .test-container {
        padding: 18px 12px;
        min-height: 280px;
    }
}

.test-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

@media (max-width: 480px) {
    .test-info {
        padding: 16px;
        border-radius: 12px;
    }
}

.test-info h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.2rem;
    font-weight: 600;
}

@media (max-width: 480px) {
    .test-info h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
}

.test-info p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

@media (max-width: 480px) {
    .test-info p {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 6px;
    }
}

.test-info ul {
    margin: 12px 0;
    padding-left: 20px;
    color: #333;
}

@media (max-width: 480px) {
    .test-info ul {
        margin: 10px 0;
        padding-left: 18px;
    }
}

.test-info li {
    margin-bottom: 6px;
    line-height: 1.4;
    font-size: 0.95rem;
}

@media (max-width: 480px) {
    .test-info li {
        margin-bottom: 5px;
        font-size: 0.9rem;
        line-height: 1.3;
    }
}

.start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.start-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

@media (max-width: 480px) {
    .start-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
        margin-top: 15px;
        min-height: 42px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .start-btn {
        padding: 16px 30px;
        min-height: 48px;
    }
    
    .start-btn:active {
        transform: scale(0.98);
        box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
    }
}

#testForm {
    margin-top: 20px;
}

.question-item {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

@media (max-width: 480px) {
    .question-item {
        margin-bottom: 20px;
        padding: 16px;
        border-radius: 12px;
    }
}

.question-item.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.question-number {
    color: #667eea;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

@media (max-width: 480px) {
    .question-number {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
}

.question-text {
    font-size: 1.15rem;
    color: #333;
    margin-bottom: 18px;
    line-height: 1.5;
    font-weight: 500;
}

@media (max-width: 768px) {
    .question-text {
        font-size: 1.05rem;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .question-text {
        font-size: 1rem;
        margin-bottom: 14px;
        line-height: 1.4;
    }
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 480px) {
    .options-container {
        gap: 8px;
    }
}

.option-btn {
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    color: #333;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-weight: 500;
    min-height: 44px;
    display: flex;
    align-items: center;
}

@media (max-width: 480px) {
    .option-btn {
        padding: 12px 14px;
        font-size: 0.95rem;
        min-height: 42px;
    }
}

.option-btn:hover {
    border-color: #667eea;
    background: #f0f7ff;
}

.option-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .option-btn {
        padding: 16px 18px;
        min-height: 48px;
    }
    
    .option-btn:active {
        transform: scale(0.99);
    }
    
    .option-btn.selected:active {
        transform: scale(0.98);
    }
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 768px) {
    .navigation {
        margin-top: 20px;
        padding-top: 15px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .navigation {
        margin-top: 18px;
        padding-top: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .navigation > *:not(#progress) {
        width: 100%;
    }
    
    #progress {
        order: -1;
        text-align: center;
    }
}

#prevBtn, #nextBtn, #submitBtn, #restartBtn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

@media (max-width: 480px) {
    #prevBtn, #nextBtn, #submitBtn, #restartBtn {
        padding: 14px 20px;
        font-size: 1rem;
        min-height: 48px;
    }
}

#prevBtn {
    background: #6c757d;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

#prevBtn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    box-shadow: 0 4px 12px rgba(173, 181, 189, 0.2);
    opacity: 0.7;
}

#prevBtn:hover:not(:disabled), 
#nextBtn:hover, 
#submitBtn:hover, 
#restartBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

#prevBtn:active:not(:disabled), 
#nextBtn:active, 
#submitBtn:active, 
#restartBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    #prevBtn:hover:not(:disabled), 
    #nextBtn:hover, 
    #submitBtn:hover, 
    #restartBtn:hover {
        transform: scale(0.98);
    }
    
    #prevBtn:active:not(:disabled), 
    #nextBtn:active, 
    #submitBtn:active, 
    #restartBtn:active {
        transform: scale(0.96);
    }
}

#progress {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

@media (max-width: 480px) {
    #progress {
        font-size: 0.95rem;
    }
}

.result-container {
    padding: 25px 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .result-container {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .result-container {
        padding: 18px 12px;
    }
}

.result-container h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

@media (max-width: 480px) {
    .result-container h2 {
        font-size: 1.3rem;
        margin-bottom: 16px;
    }
}

.result-content {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    text-align: left;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

@media (max-width: 768px) {
    .result-content {
        padding: 20px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .result-content {
        padding: 16px;
        border-radius: 10px;
        line-height: 1.5;
    }
}

.result-type {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .result-type {
        font-size: 1.6rem;
        margin-bottom: 18px;
    }
}

@media (max-width: 480px) {
    .result-type {
        font-size: 1.4rem;
        margin-bottom: 16px;
    }
}

.result-section {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .result-section {
        margin-bottom: 18px;
        padding: 12px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .result-section {
        margin-bottom: 16px;
        padding: 10px;
        border-radius: 8px;
    }
}

.result-section h3 {
    color: #4facfe;
    margin-bottom: 12px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

@media (max-width: 480px) {
    .result-section h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
        gap: 6px;
    }
}

.detailed-description {
    color: #333;
    line-height: 1.6;
    white-space: pre-line;
    font-size: 0.95rem;
}

@media (max-width: 480px) {
    .detailed-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

.dimension-scores {
    margin: 15px 0;
}

.dimension-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    padding: 8px 12px;
    background: #f0f7ff;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    font-size: 0.95rem;
}

@media (max-width: 480px) {
    .dimension-item {
        margin-bottom: 5px;
        padding: 6px 10px;
        font-size: 0.9rem;
    }
}

.dimension-name {
    font-weight: 600;
    color: #333;
}

.dimension-score {
    font-weight: bold;
    color: #667eea;
}

.result-section ul {
    padding-left: 20px;
    color: #333;
    margin: 8px 0;
}

@media (max-width: 480px) {
    .result-section ul {
        padding-left: 18px;
        margin: 6px 0;
    }
}

.result-section li {
    margin-bottom: 6px;
    line-height: 1.4;
    font-size: 0.95rem;
}

@media (max-width: 480px) {
    .result-section li {
        margin-bottom: 5px;
        font-size: 0.9rem;
        line-height: 1.3;
    }
}

/* 滚动优化 */
html {
    scroll-behavior: smooth;
}

/* 禁止文本选择（可选） */
.question-text, .option-btn, .dimension-name, .dimension-score {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 防止iOS Safari缩放 */
input, textarea, select, button {
    font-size: 16px;
}