/* ====== Font Faces ====== */
@font-face {
    font-family: 'Roboto';
    src: url('../font/Roboto-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../font/Roboto-Medium.ttf') format('truetype');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../font/Roboto-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}

/* ====== Reset & Base ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    overflow-x: hidden;
}

body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: url('../lucky/survey/bg@2x.png');
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
    background-color: #1a0533;
    /* 背景图1500×6642px, 视口宽度w时显示高度=6642*(w/1500)=w*4.428 */
    /* 使用content-box确保min-height精确等于背景图显示高度 */
    box-sizing: content-box;
    min-height: calc(100vw * 6642 / 1500);
    padding-bottom: 0;
}

/* ====== Header ====== */
.header {
    width: 100%;
    max-width: 375px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
}

.logo-changhong {
    height: 18px;
    width: auto;
}

.logo-ifa {
    height: 18px;
    width: auto;
}

/* ====== Product Showcase ====== */
.product-showcase {
    width: 100%;
    max-width: 375px;
    position: relative;
}

.top-gift {
    display: block;
    width: 352px;
    height: 95px;
    margin-left: 7px;
    object-fit: contain;
}

/* ====== Survey Card ====== */
/* 卡片尺寸: 686×1980 @2x, 底图750px宽, 比例686/750≈91.47% */
.survey-card {
    width: 91.47%;
    max-width: 343px;
    background: #fff;
    border-radius: 16px;
    padding: 28px 20px 32px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ====== Question Group ====== */
.question-group {
    margin-bottom: 0;
}

.question-group:last-child {
    margin-bottom: 0;
}

/* 序号与文字第一行同排：使用 flex-start 对齐顶部 */
/* 问题与选项间距: 33px(@2x) = 16.5px */
.question-title {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16.5px;
}

/* 序号 - 圆形带数字，颜色 #C42F10，与文字第一行对齐 */
/* 字号32px(@2x)=16px */
.question-number {
    font-size: 16px;
    line-height: 1.4;
    flex-shrink: 0;
    color: #C42F10;
}

/* 题目字体 Roboto Medium(500) 颜色 #050A18, 字号32px(@2x)=16px */
.question-text {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    color: #050A18;
}

/* ====== Divider ====== */
/* 分割线处于上下题之间中点, 距上一题最后选项22px, 距下一题问题22px */
/* 总间距88px(@2x)=44px, 分割线居中各22px */
.divider {
    width: 100%;
    height: 1px;
    background: #383D4C;
    /* margin-top 22px: 配合 other-input-wrap margin-bottom(2px) 使输入框距分割线 24px(@2x 48px)
       margin-bottom 23.5px: 使输入框距下一题问题 48.5px(@2x 97px) */
    margin: 22px 0 23.5px 0;
}

/* ====== Options List ====== */
/* 选项和选项之间距离: 33px(@2x) = 16.5px */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 16.5px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* 选项字体 Roboto Regular(400) 颜色 #383D4C, 字号28px(@2x)=14px */
.option-text {
    font-size: 14px;
    font-weight: 400;
    color: #383D4C;
    line-height: 1.4;
}

/* ====== Radio (Single Choice) ====== */
.radio-circle {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: 2px solid #ccc;
    position: relative;
    transition: border-color 0.2s;
}

/* 修复#5: 选中颜色改为 #050A18 */
.option-item.selected .radio-circle {
    border-color: #050A18;
}

.option-item.selected .radio-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #050A18;
}

/* ====== Checkbox (Multiple Choice) ====== */
.checkbox-box {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 4px;
    border: 2px solid #ccc;
    position: relative;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 修复#5: 选中颜色改为 #050A18 */
.option-item.selected .checkbox-box {
    background: #050A18;
    border-color: #050A18;
}

/* 修复#3: 对勾居中 - 使用 absolute + top/left 50% + transform 居中 */
.option-item.selected .checkbox-box::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

/* ====== Submit Button ====== */
.submit-btn {
    width: 343px;
    max-width: calc(100% - 32px);
    height: 50px;
    border: none;
    border-radius: 26px;
    background: #C42F10;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    margin-top: 24px;
    margin-bottom: 0;
    transition: opacity 0.2s;
}

.submit-btn:active {
    opacity: 0.85;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ====== Toast ====== */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 12px 20px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    font-size: 13px;
}

#toast.show {
    visibility: visible;
    animation: fadein 0.3s, fadeout 0.3s 2.7s;
}

@keyframes fadein {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeout {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ====== Responsive ====== */
@media (max-width: 375px) {
    .header {
        padding: 16px 16px 0;
    }
    .survey-card {
        padding: 24px 16px 28px;
    }
}

@media (min-width: 750px) {
    .header {
        max-width: 375px;
    }
    .survey-card {
        max-width: 343px;
    }
}

/* ====== Other Option Input ====== */
/* 设计稿 @2x: left 126px, 宽 552px, 高 115px → CSS: margin-left 63px, 宽 276px, 高 57px */
.other-input-wrap {
    display: none;
    margin-left: 32px;
    /* 上边缘距 Other 选项行 10px(@2x 20px): gap(16.5px) + margin-top(3.5px) = 20px */
    margin-top: 3.5px;
    /* 下边缘距分割线 24px(@2x 48px): margin-bottom(2px) + divider margin-top(22px) = 24px */
    /* 下边缘距下一题问题 48.5px(@2x 97px): 24px + 1px(分割线) + 23.5px(divider margin-bottom) = 48.5px */
    margin-bottom: 2px;
}

.other-input-wrap.show {
    display: block;
}

.other-input {
    width: 276px;
    height: 57px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    color: #050A18;
    outline: none;
    resize: none;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.other-input:focus {
    border-color: #050A18;
}

.other-input::placeholder {
    color: #999;
}
