 * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif;
        }

        html {
            height: 100%;
            overflow: hidden;   /* 禁止页面级滚动条，只允许内部容器按需滚动 */
        }
        
        body {
            background: linear-gradient(135deg, #6ab1f7 0%, #a2d6f9 100%);
            height: 100%;       /* 配合 html height:100%，让 body padding 参与总高度计算 */
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
            overflow: hidden;   /* 禁止页面级滚动条，避免 95vh+padding 超出视口 */
        }
        
        .container {
            max-width: 900px;
            width: 100%;
            background-color: white;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            height: 100%;       /* 用父级(body)内容区的 100%，避免 95vh 叠加 body padding 造成溢出 */
            max-height: 800px;
            min-height: 0;      /* flex 子项：允许高度收缩，防止内容撑破容器 */
        }
        
        header {
            background: linear-gradient(to right, #4a90e2, #63b3ed);
            color: white;
            padding: 20px;
            text-align: center;
            position: relative;
            flex-shrink: 0;
        }

        /* Header background colors by model */
        header.model-sample {
            background: linear-gradient(to right, #28a745, #5cb85c);
        }
        header.model-practice {
            background: linear-gradient(to right, #4a90e2, #63b3ed);
        }
        header.model-exam {
            background: linear-gradient(to right, #6f42c1, #9b59b6);
        }
        
        .logo {
            font-size: 28px;
            font-weight: bold;
            margin-bottom: 5px;
        }
        
        .timer-container {
            background: rgba(255, 255, 255, 0.2);
            padding: 10px 15px;
            border-radius: 20px;
            display: flex;
            align-items: center;
            font-weight: bold;
            transition: all 0.3s ease;
        }

        /* 右上角控制区：定时器 + 全屏按钮 */
        .header-right {
            position: absolute;
            top: 20px;
            right: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .fullscreen-btn {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }
        .fullscreen-btn:hover {
            background: rgba(255, 255, 255, 0.35);
            transform: scale(1.08);
        }

        /* CSS 伪全屏（兼容 iframe）：fixed 定位铺满视口 */
        .container.pseudo-fullscreen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            max-width: none;
            max-height: none;
            border-radius: 0;
            z-index: 999999;
        }
        
        .timer-warning {
            background: rgba(255, 165, 0, 0.3);
            color: #ff8c00;
            font-weight: bold;
        }
        
        .timer-icon {
            margin-right: 8px;
            font-size: 18px;
        }
        
        /* 开始界面样式 */
        .start-container {
            padding: 30px;
            flex: 1;
            min-height: 0;      /* flex 子项：允许高度收缩，配合内部 overflow-y 滚动 */
            overflow-y: auto;
        }
        
        .start-title {
            font-size: 32px;
            color: #2d3748;
            margin-bottom: 30px;
            text-align: center;
        }
        
        .form-container {
            max-width: 600px;
            margin: 0 auto;
        }
        
        .form-group {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .form-label {
            width: 250px;
            font-weight: bold;
            color: #4a5568;
            text-align: right;
            padding-right: 15px;
        }
        
        .form-input, .form-select {
            flex: 1;
            padding: 12px 15px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 16px;
            transition: border-color 0.3s;
        }
        
        .form-input:focus, .form-select:focus {
            outline: none;
            border-color: #4a90e2;
        }
        
        .gender-group {
            display: flex;
            gap: 15px;
            flex: 1;
        }
        
        .gender-option {
            flex: 1;
            text-align: center;
        }
        
        .gender-radio {
            display: none;
        }
        
        .gender-label {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 12px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            gap: 8px;
        }
        
        .gender-radio:checked + .gender-label {
            border-color: #4a90e2;
            background-color: #ebf8ff;
        }
        
        .gender-icon {
            font-size: 20px;
        }
        
        .country-option {
            display: flex;
            align-items: center;
        }
        
        .country-flag {
            margin-right: 10px;
            font-size: 18px;
        }
        
        .checkbox-group {
            display: flex;
            align-items: center;
            margin-top: 20px;
        }
        
        .checkbox-label {
            margin-left: 10px;
            color: #4a5568;
            font-weight: normal;
        }
        
        .start-button {
            background: linear-gradient(to right, #4a90e2, #63b3ed);
            color: white;
            border: none;
            border-radius: 50px;
            padding: 15px 40px;
            font-size: 18px;
            font-weight: bold;
            cursor: pointer;
            margin-top: 30px;
            transition: all 0.3s;
            display: block;
            margin-left: auto;
            margin-right: auto;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .start-button:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 12px rgba(74, 144, 226, 0.3);
        }
        
        .start-icon {
            font-size: 24px;
        }
        
        /* 考试界面样式 */
        .test-container {
            display: none;
            flex-direction: column;
            flex: 1;
            min-height: 0;      /* flex 子项：允许高度收缩 */
            height: 100%;
        }
        
        .test-content {
            flex: 1;
            min-height: 0;      /* flex 子项：允许高度收缩，配合 overflow-y 内部滚动 */
            overflow-y: auto;
            padding: 0 30px 30px;
        }
        
        .test-header {
            padding: 20px 30px 0;
            background: white;
            position: sticky;
            top: 0;
            z-index: 10;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        
        /* 进度条样式 */
        .progress-container {
            margin-bottom: 20px;
            position: relative;
        }
        
        .progress-bar {
            display: flex;
            height: 6px;
            background-color: #e2e8f0;
            border-radius: 3px;
            overflow: hidden;
            position: relative;
        }
        
        .progress-segment {
            flex: 1;
            height: 100%;
            background-color: #e2e8f0;
            position: relative;
            transition: background-color 0.3s;
        }
        
        .progress-segment.completed {
            background-color: #4a90e2;
        }
        
        .progress-segment.current {
            background-color: #87CEEB;
        }
        
        .progress-segment:not(:last-child)::after {
            content: '';
            position: absolute;
            right: 0;
            top: 0;
            height: 100%;
            width: 1px;
            background-color: white;
            z-index: 1;
        }
        
        .progress-number {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background-color: white;
            color: #718096;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: bold;
            transition: all 0.3s;
            z-index: 2;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            border: 2px solid #e2e8f0;
        }
        
        .progress-number.completed {
            background-color: #4a90e2;
            color: white;
            border-color: #4a90e2;
        }
        
        .progress-number.current {
            background-color: #87CEEB;
            color: white;
            border-color: #87CEEB;
        }
        
        .navigation {
            display: flex;
            justify-content: space-between;
            margin-top: 20px;
        }
        
        .btn {
            padding: 12px 25px;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .btn-prev {
            background-color: #e2e8f0;
            color: #4a5568;
        }
        
        .btn-prev:hover:not(:disabled) {
            background-color: #cbd5e0;
        }
        
        .btn-next {
            background: linear-gradient(to right, #4a90e2, #63b3ed);
            color: white;
        }
        
        .btn-next:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
        }
        
        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .btn-icon {
            margin: 0 5px;
            font-size: 18px;
        }
        
        .question-container {
            margin-bottom: 30px;
            min-height: 200px;
            transition: opacity 0.3s ease;
        }
        
        .question-text {
            font-size: 22px;
            color: #2d3748;
            margin-bottom: 20px;
            line-height: 1.4;
            text-align: center;
        }
        
        .audio-container {
            text-align: center;
            margin: 20px 0;
        }
        
        .audio-player {
            width: 100%;
            max-width: 400px;
            margin: 0 auto;
            background: #f7fafc;
            border-radius: 12px;
            padding: 15px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        }
        
        #playButton {
            background: #4a90e2;
            color: white;
            border: none;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 15px;
            transition: all 0.2s ease;
        }
        
        #playButton:hover {
            background: #3a7bc8;
            transform: scale(1.05);
        }
        
        .audio-progress {
            width: 100%;
            height: 6px;
            background: #e2e8f0;
            border-radius: 3px;
            margin: 10px 0;
            overflow: hidden;
        }
        
        #audioProgressBar {
            height: 100%;
            background: #4a90e2;
            border-radius: 3px;
            width: 0%;
            transition: width 0.1s linear;
        }
        
        .audio-time {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: #718096;
        }
        
        .options-container {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
            margin-top: 20px;
        }
        
        .option {
            padding: 15px;
            background-color: #f7fafc;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            min-height: 150px;
        }
        
        .option:hover {
            background-color: #a2d6f9;
            transform: translateY(-2px);
        }
        
        .option.selected {
            background-color: #ebf8ff;
            border-color: #63b3ed;
            box-shadow: 0 4px 6px rgba(99, 179, 237, 0.2);
        }

        /* 作答反馈：对 = 绿框绿底；错 = 红框红底 */
        .option.correct {
            background-color: #e6ffed;
            border-color: #2ECC71;
            box-shadow: 0 4px 6px rgba(46, 204, 113, 0.2);
        }
        .option.wrong {
            background-color: #ffe6e6;
            border-color: #FF6B6B;
            box-shadow: 0 4px 6px rgba(255, 107, 107, 0.2);
        }
        /* 已答过的题：禁用点击 + 去掉hover效果 */
        .option.disabled {
            cursor: not-allowed;
            pointer-events: none;
        }
        .option.disabled:hover {
            background-color: #f7fafc;
            transform: none;
        }
        .option.correct.disabled:hover { background-color: #e6ffed; }
        .option.wrong.disabled:hover   { background-color: #ffe6e6; }

        /* 判断题 True / False 按钮样式 */
        .tf-container {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
            margin-top: 30px;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }
        .tf-btn {
            padding: 30px 20px;
            border: 3px solid #e2e8f0;
            border-radius: 16px;
            background: #f7fafc;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            font-size: 28px;
            font-weight: bold;
            color: #4a5568;
            min-height: 160px;
        }
        .tf-btn:hover { transform: translateY(-3px); background: #a2d6f9 ; }
        .tf-btn.tf-true { color: #2ECC71; border-color: #82e0aa; }
        .tf-btn.tf-false { color: #FF6B6B; border-color: #ffb3b3; }
        .tf-btn.selected { background-color: #ebf8ff; border-color: #63b3ed; color: #4a90e2; }
        .tf-btn.correct  { background: #e6ffed; border-color: #2ECC71; color: #27ae60; box-shadow: 0 4px 6px rgba(46,204,113,.2); }
        .tf-btn.wrong    { background: #ffe6e6; border-color: #FF6B6B; color: #e74c3c; box-shadow: 0 4px 6px rgba(255,107,107,.2); }
        /* 已答过的题：禁用点击 + 去掉hover效果 */
        .tf-btn.disabled {
            cursor: not-allowed;
            pointer-events: none;
        }
        .tf-btn.disabled:hover {
            transform: none;
            background: #f7fafc;
        }
        .tf-btn.tf-true.correct.disabled:hover  { background: #e6ffed; }
        .tf-btn.tf-false.wrong.disabled:hover   { background: #ffe6e6; }
        .tf-btn.tf-false.correct.disabled:hover { background: #e6ffed; }
        .tf-btn.tf-true.wrong.disabled:hover    { background: #ffe6e6; }
        .tf-btn .tf-icon { font-size: 48px; }
        
        .option-image {
            width: 200px;
            height: 200px;
            object-fit: contain;
            margin-bottom: 10px;
            border-radius: 8px;
        }
        
        .option-label {
            font-weight: bold;
            color: #4a90e2;
            margin-top: 5px;
            font-size: 18px;
        }
        
        .loading {
            text-align: center;
            padding: 40px;
            color: #4a5568;
        }
        
        .spinner {
            display: inline-block;
            width: 40px;
            height: 40px;
            border: 4px solid rgba(74, 144, 226, 0.3);
            border-radius: 50%;
            border-top-color: #4a90e2;
            animation: spin 1s ease-in-out infinite;
            margin-bottom: 15px;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        .mascot {
            position: absolute;
            top: 10px;
            left: 20px;
            width: 60px;
            height: 60px;
            background: url('/assets/img/logo3.png') no-repeat center;
            background-size: contain;
        }
        
        .result-container {
            text-align: center;
            padding: 40px 20px;
            display: none;
            flex: 1;
            min-height: 0;      /* flex 子项：允许高度收缩，配合内部 overflow-y 滚动 */
            overflow-y: auto;
        }
        
        .result-title {
            font-size: 28px;
            color: #2d3748;
            margin-bottom: 20px;
        }
        
        .score-display {
            font-size: 48px;
            font-weight: bold;
            color: #4a90e2;
            margin: 20px 0;
        }
        
        .restart-btn {
            background: linear-gradient(to right, #4a90e2, #63b3ed);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 12px 25px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            margin-top: 20px;
            margin-left: auto;
            margin-right: auto;
            display: block;
            transition: all 0.2s ease;
        }
        
        .restart-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
        }

        /* 结果界面操作区：小图标 + 文字链接，左对齐 */
        .result-actions {
            margin-top: 24px;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 10px;
            text-align: center;
        }

        .result-actions .action-link {
            margin-bottom: 10px;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            font-size: 15px;
            font-weight: 500;
            text-decoration: none;
            color: #4a90e2;
            background: none;
            border-radius: 0;
            padding: 0;
            min-width: auto;
            box-shadow: none;
            transition: color 0.15s ease, transform 0.15s ease;
            cursor: pointer;
        }

        .result-actions .action-link:hover {
            color: #2c6fbb;
            transform: translateX(2px);
            box-shadow: none;
            text-decoration: underline;
        }

        .result-actions .action-icon {
            font-size: 18px;
            line-height: 1;
            flex-shrink: 0;
        }
        
        /* 自定义下拉框样式 */
        .custom-select {
            position: relative;
            flex: 1;
        }
        
        .custom-select select {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            width: 100%;
            padding: 12px 15px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 16px;
            background-color: white;
            cursor: pointer;
        }
        
        .custom-select::after {
            content: "▼";
            font-size: 12px;
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            pointer-events: none;
            color: #718096;
        }
        
        /* 国旗样式 */
        .flag-option {
            display: flex;
            align-items: center;
            padding: 8px 12px;
        }
        
        .flag-img {
            width: 24px;
            height: 18px;
            margin-right: 10px;
            border: 1px solid #e2e8f0;
        }
        
        /* 新增样式：数字输入框 */
        .number-input {
            width: 100px;
            text-align: center;
        }

        /* 时间输入框（窄）与 "不限时间" checkbox 同一行显示 */
        .form-group-inline {
            align-items: flex-start;
        }
        .form-group-inline .inline-row {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 20px;
        }
        .input-narrow {
            flex: 0 0 140px;
            width: 140px;
            max-width: 140px;
            text-align: center;
        }
        .checkbox-inline {
            display: flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
        }
        .checkbox-label-inline {
            color: #4a5568;
            font-weight: normal;
            margin: 0;
            cursor: pointer;
        }

        /* Auto Next 整行右对齐，和上方控件标签列的右边对齐 */
        .checkbox-group-right {
            justify-content: flex-end;
            margin-bottom: 8px;
        }
        .checkbox-label-right {
            width: 100%;
            max-width: calc(100% - 250px);  /* 减去左侧 form-label 预留宽度 */
            display: inline-flex;
            align-items: center;
            justify-content: flex-start;
            gap: 10px;
            color: #4a5568;
            font-weight: normal;
            text-align: right;
            cursor: pointer;
        }
        .checkbox-label-right span {
            white-space: nowrap;
        }
        
        /* 自定义国旗选择器样式 */
        .custom-flag-select {
            position: relative;
            flex: 1;
        }
        
        .flag-select-button {
            display: flex;
            align-items: center;
            width: 100%;
            padding: 12px 15px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            background-color: white;
            cursor: pointer;
            transition: border-color 0.3s;
        }
        
        .flag-select-button:hover {
            border-color: #cbd5e0;
        }
        
        .flag-select-button:focus {
            outline: none;
            border-color: #4a90e2;
        }
        
        .selected-flag {
            width: 24px;
            height: 18px;
            margin-right: 10px;
            border: 1px solid #e2e8f0;
        }
        
        .flag-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 2px solid #e2e8f0;
            border-top: none;
            border-radius: 0 0 8px 8px;
            max-height: 200px;
            overflow-y: auto;
            z-index: 1000;
            display: none;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        
        .flag-option {
            display: flex;
            align-items: center;
            padding: 10px 15px;
            cursor: pointer;
            transition: background-color 0.2s;
        }
        
        .flag-option:hover {
            background-color: #f7fafc;
        }
        
        .flag-option.selected {
            background-color: #ebf8ff;
        }
        
        .flag-option-img {
            width: 24px;
            height: 18px;
            margin-right: 10px;
            border: 1px solid #e2e8f0;
        }
        
        /* 隐藏原生select但保留功能 */
        .hidden-select {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }

        /* ========= 加载状态 & spinner ========= */
        .loading {
            text-align: center;
            padding: 40px 16px;
            color: #4a5568;
            font-size: 15px;
        }
        .loading .spinner {
            width: 38px;
            height: 38px;
            border: 4px solid #e2e8f0;
            border-top-color: #4a90e2;
            border-radius: 50%;
            margin: 0 auto 14px;
            animation: ket-spin 0.9s linear infinite;
        }
        @keyframes ket-spin {
            to { transform: rotate(360deg); }
        }

        /* ========= 判断题：音频+图片横排布局 ========= */
        .tf-media-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 24px;
            margin: 16px 0;
            flex-wrap: wrap;
        }
        .tf-media-row .audio-container {
            flex: 0 1 380px;
            margin: 0;
        }
        .tf-media-row .tf-image img {
            max-width: 200px;
            max-height: 250px;
            border-radius: 12px;
            object-fit: contain;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
        }/* ========== Kid-friendly floating toast (no alert) ========== */
.ket-toast-host {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    max-width: 90%;
    width: 380px;
}
.ket-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 18px;
    background: #ffffff;
    border: 3px solid #ffd43b;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    color: #343a40;
    font-size: 16px;
    font-weight: 600;
    max-width: 100%;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: opacity .3s ease, transform .3s ease;
}
.ket-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.ket-toast-icon {
    font-size: 26px;
    line-height: 1;
    flex: 0 0 auto;
}
.ket-toast-msg {
    flex: 1 1 auto;
    word-break: break-word;
    line-height: 1.4;
}
.ket-toast-close {
    flex: 0 0 auto;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    color: #868e96;
    padding: 0 4px;
    line-height: 1;
}
.ket-toast-close:hover { color: #495057; }
.ket-toast-warn    { border-color: #ff922b; background: #fff4e6; }
.ket-toast-error   { border-color: #ff6b6b; background: #fff5f5; }
.ket-toast-success { border-color: #51cf66; background: #ebfbee; }
.ket-toast-info    { border-color: #74c0fc; background: #e7f5ff; }
/* ========== Input-focus pulse for form validation ========== */
.pulse-focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 146, 43, 0.35) !important;
    border-color: #ff922b !important;
    animation: ket-focus-pulse 0.9s ease-in-out 2;
}
@keyframes ket-focus-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.02); }
}

/* ========== 未答确认浮动层 ========== */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.confirm-modal {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px 28px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.confirm-modal p {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    margin: 0 0 24px;
}
.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.confirm-btn {
    min-width: 100px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s;
}
.confirm-btn:hover { transform: scale(1.04); }
.confirm-yes {
    background: #4a90e2;
    color: #fff;
    border-color: #4a90e2;
}
.confirm-yes:hover { background: #357abd; border-color: #357abd; }
.confirm-no {
    background: #fff;
    color: #666;
    border-color: #ccc;
}
.confirm-no:hover { border-color: #999; color: #333; }
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ========== 手机端适配（≤ 768px，iPad 不动） ========== */
@media (max-width: 768px) {

    /* body / container：取消固定 max-height、减少 padding */
    body {
        padding: 8px;
        height: auto;
        min-height: 100%;
        overflow: auto;
    }
    html {
        overflow: auto;
    }
    .container {
        max-height: none;
        min-height: calc(100vh - 16px);
        border-radius: 14px;
    }

    /* ========= Header：CSS Grid 两行布局，避免 mascot / logo / 时钟重叠 =========
       Row 1: mascot + logo 文字并排居中
       Row 2: timer + 全屏按钮 居中
    */
    header {
        padding: 12px 16px;
        display: grid;
        grid-template-columns: auto auto;
        justify-content: center;
        align-items: center;
        row-gap: 6px;
        column-gap: 6px;
    }
    .mascot {
        position: static;
        width: 32px;
        height: 32px;
        margin: 0;
        grid-column: 1;
        grid-row: 1;
    }
    .logo {
        font-size: 20px;
        margin-bottom: 0;
        grid-column: 2;
        grid-row: 1;
    }
    .header-right {
        grid-column: 1 / span 2;
        grid-row: 2;
        position: static;
        top: auto;
        right: auto;
        justify-content: center;
        gap: 8px;
    }
    .timer-container { padding: 6px 12px; font-size: 14px; }
    .timer-icon { margin-right: 4px; font-size: 15px; }
    .fullscreen-btn { width: 34px; height: 34px; font-size: 15px; }

    /* ========= 开始界面 ========= */
    .start-container { padding: 20px 16px; }
    .start-title { font-size: 22px; margin-bottom: 20px; }
    .form-group {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .form-label {
        width: auto;
        text-align: left;
        padding-right: 0;
    }
    .checkbox-label-right {
        max-width: 100%;
    }
    .start-button { padding: 12px 30px; font-size: 16px; }

    /* 时间 + No time limit 同一行保持横向 */
    .form-group-inline .inline-row {
        flex-wrap: wrap;
        gap: 10px;
    }
    .input-narrow { flex: 0 0 110px; width: 110px; max-width: 110px; }

    /* ========= 考试界面 ========= */
    .test-header { padding: 12px 16px 0; }
    .test-content { padding: 0 16px 20px; }
    .navigation .btn { padding: 10px 16px; font-size: 14px; }
    .btn-icon { margin: 0 3px; font-size: 15px; }
    .question-text { font-size: 18px; }

    /* ========= 三选一选项：纵向排列，防止横向滚动 ========= */
    .options-container {
        grid-template-columns: 1fr;     /* 从 3 列改成 1 列 */
        gap: 12px;
        margin-top: 16px;
    }
    .option {
        min-height: auto;
        padding: 12px;
        flex-direction: column;          /* 保持图片上、标签下 */
        gap: 8px;
        text-align: center;
        align-items: center;
    }
    .option-image {
        width: 160px;
        height: 160px;
        max-width: 45vw;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .option-label {
        font-size: 15px;
        margin-top: 0;
    }

    /* 三选一文字题（question_type=3）也跟上：纵向排列、缩短高度 */
    .text-option {
        min-height: 0;
        flex-direction: column;
        text-align: center;
    }
    .text-option .option-text {
        font-size: 15px;
        margin-top: 6px;
    }

    /* 判断题：也改成一列，避免两个大按钮挤横排 */
    .tf-container {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 12px;
        margin-top: 20px;
    }
    .tf-btn {
        padding: 20px 16px;
        min-height: 100px;
        font-size: 22px;
    }
    .tf-btn .tf-icon { font-size: 36px; }

    /* 音频 + 图片横排也允许纵向堆叠 */
    .tf-media-row { flex-direction: column; gap: 12px; }
    .tf-media-row .audio-container { flex: 0 1 auto; width: 100%; }
    .tf-media-row .tf-image img { max-width: 160px; max-height: 200px; }

    /* ========= 结果界面 ========= */
    .result-container { padding: 24px 16px; }
    .result-title { font-size: 22px; }
    .score-display { font-size: 36px; }

    /* 自定义 toast 宽度适配 */
    .ket-toast-host { width: 92vw; max-width: 92vw; }
}
