/* 全局基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    font-size: 14px;
    background: #f0f8ff;
    overflow-x: hidden;
    height: 100vh;
    -webkit-overflow-scrolling: touch;
}

/* 布局容器 */
#main-content {
    height: calc(100vh - 120px);
    overflow-y: hidden; /* 整个题目所在容器不滑动 */
    padding: 15px;
    padding-top: 75px;
}

/* 导航头 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    height: 60px;
}

#scaleTitle {
    flex: 1;
    text-align: center;
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 9px; /* 标题底部增加 9px margin */
}

.back-btn {
    font-size: 24px;
    color: #409eff;
    background: none;
    border: none;
    padding: 0;
    display: flex; /* 使返回图标上下居中 */
    align-items: center;
}

/* 题目样式 */
.question-group {
    background: transparent;
    border: none !important;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: none !important;
    position: relative; /* 为错误提示定位 */
}

.question-title {
    font-weight: 500;
    color: #303133;
    position: relative;
    padding-bottom: 8px;
    margin-bottom: 8px;
    text-align: left;
}

/* 选项布局 */
.ant-radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: space-between;
    padding: 5px 0;
}

/* 新增必填提示样式 */
.question-group .required-error {
    color: #ff4d4f; /* 提示字体标红色 */
    font-size: 12px;
    margin: 8px 0;
    display: none;
    animation: shake 0.5s;
}

/* 提交区域 */
.submit-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f0f8ff;
    padding: 15px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.submit-btn {
    background: #6cb2ff !important;
    width: 100%;
    border-radius: 25px; /* 按钮图标为椭圆形 */
    padding: 12px;
    font-size: 16px;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.type-btn {
    background: #6cb2ff;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 错误提示 */
.error-tip {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 8px;
    animation: shake 0.5s;
}

@keyframes shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

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

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

/* 类型选择界面 */
.type-select-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
    padding-top: 40px; /* 增加顶部内边距，使测评项目向下移动 */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 300px;
}

/* 焦虑测评选项布局 */
.anxiety-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.anxiety-options .option-label:nth-child(1),
.anxiety-options .option-label:nth-child(2) {
    flex-basis: 48%; /* 大致宽度，可根据实际调整 */
}

.anxiety-options .option-label:nth-child(3),
.anxiety-options .option-label:nth-child(4) {
    flex-basis: 48%; /* 大致宽度，可根据实际调整 */
}

/* 抑郁测评选项布局 */
.depression-options {
    display: flex;
    justify-content: space-between;
    gap: 16px; /* 增大选项之间的间距 */
    padding: 0 20px; /* 增加整体容器的左右间距 */
}

.depression-options .option-label {
    display: flex;
    align-items: center;
    gap: 8px; /* 保持文案与radio控件之间的距离 */
}

.depression-options .option-1 {
    margin-right: auto; /* 左对齐 */
}

.depression-options .option-4 {
    margin-left: auto; /* 右对齐 */
}

.depression-options .option-2,
.depression-options .option-3 {
    flex: 1;
    justify-content: center;
    margin: 0 8px; /* 增加中间选项的左右间距 */
}

/* 自定义错误提示样式 */
.required-error {
    color: red;
    display: none;
}

/* 题目滚动容器 */
#questionList {
    max-height: calc(100vh - 120px - 60px); /* 调整高度，确保与提交区域无缝衔接 */
    overflow-y: auto;
    margin-bottom: 60px; /* 与提交区域高度一致，确保无缝衔接 */
    /* 隐藏滚动条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#questionList::-webkit-scrollbar {
    display: none; /* Chrome, Safari, and Opera */
}

/* 选项标签样式 */
.option-label {
    display: flex;
    align-items: center;
    gap: 8px; /* 增加文案与radio控件之间的距离 */
}

/* 抑郁测评选项标签样式 */
.depression-options .option-label {
    display: flex;
    align-items: center;
    gap: 4px; /* 增加文案与radio控件之间的距离 */
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 80%;
}

/* 手机号输入框样式 */
#phoneInput {
    width: 100%;
    margin: 15px 0;
    padding: 10px;
    font-size: 16px;
    border-radius: 4px;
}

#confirmPhoneBtn {
    margin-top: 10px;
    width: 100%;
}

.qr-code {
    width: 200px;
    height: 200px;
    margin-bottom: 20px;
}

.success-message {
    font-size: 18px;
    color: #333;
}

/* 全局错误提示 */
.global-error {
    background: #ffe6e6;
    border: 1px solid #ff4444;
    border-radius: 4px;
    padding: 12px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ff4444;
}

.error-icon {
    width: 20px;
    height: 20px;
}

/* 成功弹窗和手机号输入弹窗 */
.success-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.modal-image {
    width: 200px;
    height: 200px;
    margin-bottom: 15px;
}

.modal-text {
    font-size: 16px;
    color: #333;
    margin: 0;
}

/* 弹窗按钮样式 */
.modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding: 0 20px;
    position: relative;
    z-index: 1001;
    gap: 20px; /* 添加按钮之间的间距 */
}

.modal-btn {
    padding: 8px 20px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    z-index: 1002;
    white-space: nowrap;
    min-width: 100px;
    display: flex; /* 添加flex布局 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
}

/* 弹窗内的返回按钮样式 */
.modal-btn.back-btn {
    background-color: #f0f0f0;
    color: #333;
    flex: 1; /* 让按钮宽度自适应 */
}

/* 弹窗内的重新测评按钮样式 */
.modal-btn.retry-btn {
    background-color: #6cb2ff;
    color: white;
    flex: 1; /* 让按钮宽度自适应 */
}

/* 左上角的返回按钮样式保持不变 */
.header .back-btn {
    font-size: 24px;
    color: #409eff;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
}

/* Logo容器样式 */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px; /* 与按钮保持间距 */
    position: relative;
}

.logo-top {
    width: 200px; /* 根据实际图片大小调整 */
    height: auto;
    margin-bottom: 0px; /* 减小负边距，增加间距 */
    z-index: 2;
}

.logo-bottom {
    width: 200px; /* 根据实际图片大小调整 */
    height: auto;
    z-index: 1;
}
