* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    min-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    padding: 20px;
    animation: fadeIn 0.5s ease-in;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
    line-height: 1.3;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
    line-height: 1.5;
    word-wrap: break-word;
}

.intro-text {
    font-size: 0.95em;
    line-height: 1.7;
    margin-bottom: 12px;
    color: #555;
}

.option-list {
    margin: 15px 0 20px 20px;
    color: #555;
}

.option-list li {
    margin-bottom: 6px;
    font-size: 0.95em;
    line-height: 1.6;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin-bottom: 15px;
    overflow: hidden;
    flex-shrink: 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.question-counter {
    text-align: center;
    font-size: 1em;
    color: #666;
    margin-bottom: 20px;
    font-weight: 500;
    flex-shrink: 0;
}

.question-container {
    margin-bottom: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    flex: 1;
}

.option-btn {
    padding: 16px 18px;
    font-size: 1em;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    color: #333;
    min-height: 48px;
    display: flex;
    align-items: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
}

.option-btn:active {
    transform: scale(0.98);
}

.option-btn.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.navigation-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    flex-shrink: 0;
}

.btn {
    padding: 16px 24px;
    font-size: 1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#start-btn {
    display: block;
    margin: 25px auto 0;
    width: 100%;
    max-width: 280px;
}

.results-container {
    margin: 20px 0;
}

.dimension-result {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
}

.dimension-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.dimension-score {
    font-size: 1.4em;
    color: #667eea;
    font-weight: bold;
    white-space: nowrap;
}

.score-bar-container {
    margin-top: 8px;
}

.score-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 1s ease;
    border-radius: 10px;
}

.recommendations {
    margin-top: 30px;
    padding: 18px;
    background: #fff9e6;
    border-radius: 10px;
    border-left: 4px solid #ffa500;
}

.recommendations h3 {
    color: #ff8c00;
    margin-bottom: 12px;
    font-size: 1.2em;
}

.recommendation-item {
    margin-bottom: 12px;
    padding-left: 16px;
    line-height: 1.7;
    color: #555;
    font-size: 0.95em;
}

.recommendation-item:last-child {
    margin-bottom: 0;
}

.recommendation-item strong {
    color: #ff8c00;
}

#restart-btn {
    display: block;
    margin: 25px auto 0;
    width: 100%;
    max-width: 280px;
}

/* 平板和小屏幕设备 */
@media (min-width: 481px) {
    body {
        padding: 15px;
    }

    .container {
        border-radius: 18px;
        min-height: calc(100vh - 30px);
    }

    .screen {
        padding: 30px;
    }

    h1 {
        font-size: 2.2em;
        margin-bottom: 25px;
    }

    h2 {
        font-size: 1.5em;
        margin-bottom: 25px;
    }

    .intro-text {
        font-size: 1.05em;
        margin-bottom: 15px;
    }

    .option-list {
        margin: 20px 0 25px 30px;
    }

    .option-list li {
        font-size: 1em;
    }

    .progress-bar {
        height: 8px;
        margin-bottom: 20px;
    }

    .question-counter {
        font-size: 1.1em;
        margin-bottom: 25px;
    }

    .options-container {
        gap: 12px;
        margin-top: 25px;
    }

    .option-btn {
        padding: 15px 20px;
        font-size: 1.05em;
    }

    .option-btn:hover {
        border-color: #667eea;
        background: #f0f0ff;
        transform: translateX(3px);
    }

    .option-btn.selected {
        transform: translateX(5px);
    }

    .navigation-buttons {
        flex-direction: row;
        gap: 15px;
        margin-top: 25px;
    }

    .btn {
        width: auto;
        flex: 1;
        padding: 15px 35px;
    }

    .btn-primary:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }

    .btn-secondary:hover:not(:disabled) {
        background: #e8e8e8;
        transform: translateY(-2px);
    }

    #start-btn {
        width: 220px;
        max-width: none;
    }

    .dimension-result {
        padding: 20px;
        margin-bottom: 22px;
    }

    .dimension-name {
        font-size: 1.3em;
        margin-bottom: 15px;
    }

    .dimension-score {
        font-size: 1.6em;
    }

    .score-bar {
        height: 22px;
    }

    .recommendations {
        padding: 22px;
        margin-top: 35px;
    }

    .recommendations h3 {
        font-size: 1.4em;
        margin-bottom: 15px;
    }

    .recommendation-item {
        font-size: 1.05em;
        margin-bottom: 15px;
    }

    #restart-btn {
        width: 220px;
        max-width: none;
    }
}

/* 桌面设备 */
@media (min-width: 769px) {
    body {
        padding: 20px;
    }

    .container {
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        min-height: auto;
    }

    .screen {
        padding: 40px;
    }

    h1 {
        font-size: 2.5em;
        margin-bottom: 30px;
    }

    h2 {
        font-size: 1.8em;
        margin-bottom: 30px;
    }

    .intro-text {
        font-size: 1.1em;
        margin-bottom: 15px;
    }

    .option-list {
        margin: 20px 0 30px 40px;
    }

    .option-list li {
        font-size: 1.05em;
    }

    .progress-bar {
        height: 8px;
        margin-bottom: 20px;
    }

    .question-counter {
        font-size: 1.2em;
        margin-bottom: 30px;
    }

    .question-container {
        margin-bottom: 40px;
    }

    .options-container {
        gap: 12px;
        margin-top: 30px;
    }

    .option-btn {
        padding: 15px 20px;
        font-size: 1.1em;
    }

    .option-btn:hover {
        border-color: #667eea;
        background: #f0f0ff;
        transform: translateX(5px);
    }

    .option-btn.selected {
        transform: translateX(10px);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }

    .navigation-buttons {
        flex-direction: row;
        gap: 20px;
        margin-top: 30px;
    }

    .btn {
        padding: 15px 40px;
        font-size: 1.1em;
    }

    #start-btn {
        width: 200px;
    }

    .results-container {
        margin: 30px 0;
    }

    .dimension-result {
        padding: 20px;
        margin-bottom: 25px;
    }

    .dimension-name {
        font-size: 1.4em;
        margin-bottom: 15px;
    }

    .dimension-score {
        font-size: 1.8em;
    }

    .score-bar {
        height: 25px;
    }

    .recommendations {
        padding: 25px;
        margin-top: 40px;
        border-left-width: 5px;
    }

    .recommendations h3 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .recommendation-item {
        font-size: 1.05em;
        margin-bottom: 15px;
    }

    #restart-btn {
        width: 200px;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .screen {
        padding: 15px;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

    .question-counter {
        margin-bottom: 15px;
    }

    .options-container {
        gap: 8px;
        margin-top: 15px;
    }

    .option-btn {
        padding: 12px 16px;
        min-height: 44px;
    }

    .navigation-buttons {
        margin-top: 15px;
        gap: 10px;
    }

    .btn {
        padding: 12px 20px;
        min-height: 44px;
    }
}
