﻿/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background: #f0f2f5;
    position: relative;
}

/* ===== 页面切换 ===== */
.screen {
    display: none;
    min-height: 100vh;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* ===== 启动页 ===== */
#start-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

.logo {
    margin-bottom: 16px;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo h1 {
    font-size: 32px;
    color: #fff;
    font-weight: 700;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 40px;
}

.start-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 20px 24px;
    backdrop-filter: blur(10px);
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}

.info-num {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.info-label {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin-top: 4px;
}

.info-divider {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,0.3);
}

.start-desc {
    font-size: 15px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 40px;
    line-height: 2;
}

.btn-primary {
    display: block;
    width: 100%;
    max-width: 300px;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    background: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.btn-primary:active {
    transform: scale(0.97);
}

.start-tip {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: 24px;
}

/* ===== 测评页 ===== */
#quiz-screen {
    background: #f0f2f5;
    padding: 0;
}

.quiz-header {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 16px 20px 12px;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.quiz-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #6c757d;
}

#module-name {
    color: #667eea;
    font-weight: 600;
}

.quiz-body {
    flex: 1;
    padding: 32px 20px 120px;
}

.question-text {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 28px;
    line-height: 1.5;
}

.question-hint {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 20px;
    margin-top: -20px;
}

/* 选项样式 */
.option-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    padding: 18px 16px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    color: #2d2d44;
    line-height: 1.5;
}

.option-item:active {
    transform: scale(0.98);
}

.option-item.selected {
    border-color: #667eea;
    background: #f0f0ff;
    color: #667eea;
}

.option-item .option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    margin-right: 12px;
    margin-top: 1px;
    transition: all 0.2s;
}

.option-item.selected .option-letter {
    background: #667eea;
    color: #fff;
}

/* 下拉选择 */
.select-field {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    background: #fff;
    color: #2d2d44;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    cursor: pointer;
}

.select-field:focus {
    outline: none;
    border-color: #667eea;
}

/* 文本输入 */
.text-field {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    background: #fff;
    color: #2d2d44;
    resize: none;
}

.text-field:focus {
    outline: none;
    border-color: #667eea;
}

/* 确认按钮 */
.btn-confirm {
    display: block;
    width: 100%;
    padding: 16px;
    margin-top: 24px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    background: #667eea;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm:active {
    transform: scale(0.98);
}

.btn-confirm:disabled {
    background: #c5c5d0;
    cursor: not-allowed;
}

.quiz-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    padding: 16px 20px;
    background: transparent;
    display: flex;
    gap: 12px;
}

.btn-back {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    color: #6c757d;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 50px;
    cursor: pointer;
}

.btn-back:active {
    background: #f0f2f5;
}

/* ===== 加载页 ===== */
#loading-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
}

.loading-content {
    width: 100%;
    max-width: 320px;
}

.loading-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 32px;
}

.loading-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-size: 28px;
}

#loading-screen h2 {
    color: #fff;
    font-size: 22px;
    margin-bottom: 12px;
}

.loading-desc {
    color: rgba(255,255,255,0.8);
    font-size: 15px;
    margin-bottom: 40px;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.step-item {
    color: rgba(255,255,255,0.4);
    font-size: 15px;
    transition: all 0.3s;
}

.step-item.done {
    color: rgba(255,255,255,0.95);
}

/* ===== 通用动画 ===== */
.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.slide-in {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
