@font-face {
    font-family: 'SF Pro';
    src: url('../fonts/SF-Pro-Text-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SF Pro';
    src: url('../fonts/SF-Pro-Text-Semibold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SF Pro';
    src: url('../fonts/SF-Pro-Text-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap; /* 字体加载时先用兜底字体，加载完成后替换，避免闪屏 */
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased; /* 移动端 Safari 抗锯齿 */
    -moz-osx-font-smoothing: grayscale; /* Firefox 抗锯齿 */
    text-rendering: optimizeLegibility; /* 优化字体可读性 */
    font-family: 'SF Pro', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

html {
    position: relative;
    height: 100%;
    width: 100%;
    font-size: 16px !important;
    font-weight: 400;
    line-height: 1.5; /* 统一行高 */
}

input {
    background-color: transparent;
    border: 0;
}

button {
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    outline: none;
    background-color: transparent;
}

button:active {
    opacity: 0.6;
}

.hidden {
    display: none;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-row {
    display: flex;
    flex-direction: row;
}

.justify-start {
    display: flex;
    justify-content: flex-start;
}

.justify-center {
    display: flex;
    justify-content: center;
}

.justify-end {
    display: flex;
    justify-content: flex-end;
}

.justify-evenly {
    display: flex;
    justify-content: space-evenly;
}

.justify-around {
    display: flex;
    justify-content: space-around;
}

.justify-between {
    display: flex;
    justify-content: space-between;
}

.align-start {
    display: flex;
    align-items: flex-start;
}

.align-center {
    display: flex;
    align-items: center;
}

.align-end {
    display: flex;
    align-items: flex-end;
}

nav, header, main, footer {
    width: 100%;
}

footer {
    width: 100%;
    padding: 20px 0;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
}

body.no-scroll {
    overflow: hidden !important; /* 禁止滚动 */
    height: 100vh; /* 固定 body 高度，避免移动端仍可滚动 */
    height: 100dvh;
}

.container {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0 20px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

/* 有底部按钮的问卷页：整页锁在可视高度内，按钮始终在浏览器底栏之上 */
.container:has(> footer) {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.container:has(> footer) > main.main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.container:has(> footer) > footer {
    flex-shrink: 0;
    width: 100%;
    max-width: 353px;
    padding: 16px 0 20px;
    background: #ffffff;
}

/** 头部 **/
.header {
    max-width: 353px;
    height: 60px;
    line-height: 60px;
    position: relative;
}
.header .back-box {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 24px;
    cursor: pointer;
    border: none;
    outline: none;
    display: flex;
    align-items: stretch;
}
.header .back-box .back {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.header .logo {
    font-weight: bold;
    font-size: 24px;
    color: #000000;
    text-align: center;
}

/** 主体 **/
.main {
    width: 100%;
    max-width: 353px;
    flex-grow: 1; /* 自动占满中间剩余高度，把底部往下压 */
}

/* 进度条：放在 main 外，SPA 切页常驻 */
.container > .progress-box {
    position: relative;
    width: 100%;
    max-width: 353px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-sizing: border-box;
    overflow: hidden;
    margin-top: 6px;
    background: #ffffff;
    z-index: 2;
    flex-shrink: 0;
}
.container > .progress-box .progress-line {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 9px;
    height: 4px;
    background: #c6d2df;
    border-radius: 999px;
    z-index: 1;
}
.container > .progress-box .progress-line-active {
    position: absolute;
    left: 10px;
    top: 9px;
    width: 0;
    height: 4px;
    background: #35a36b;
    border-radius: 999px;
    z-index: 2;
    transition: width 0.25s ease;
}
.container > .progress-box .step {
    width: 21px;
    height: 21px;
    z-index: 3;
}
.container > .progress-box .step img {
    width: 100%;
    height: 100%;
    display: block;
}

/* 标题 */
.main .title-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 30px;
}
.main .title-box .title {
    font-weight: bold;
    font-size: 24px;
    color: #000000;
    line-height: 34px;
}

.main .title-box .subtitle {
    font-weight: 600;
    font-size: 16px;
    color: rgba(90, 90, 90, 0.6);
    line-height: 22px;
    text-align: center;
    margin-top: 8px;
}

/* 选项 */
.main .contents {
    display: flex;
    flex-direction: column;
    margin-top: 15px;
    gap: 0.8rem;
}
.main .contents .label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 60px;
    padding: 0 15px;
    background: #F4F4F4;
    border-radius: 15px;
    border: 1px solid;
    border-image: linear-gradient(136deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.3)) 1 1;
}
.main .contents .label .content-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
}
.main .contents .label .content-box .icon {
    width: 24px;
}
.main .contents .label .content-box .text {
    font-weight: 500;
    font-size: 16px;
    color: #000000;
    line-height: 30px;
    margin-right: 20px;
}
.main .contents .label .content-box .ckicon {
    width: 24px;
    height: 24px;
    position: absolute;
    right: 0;
    background-image: url('../images/label_unselected.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.main .contents .label .content-box .ckicon-selected {
    background-image: url('../images/label_selected.webp') !important;
}

/** 底部按钮(下一步) **/
.button-box {
    width: 100%;
    max-width: 353px;
    margin: 0 auto;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
/* 默认按钮 */
.button {
    width: 100%;
    height: 60px;
    color: #FFF;
    cursor: pointer;
    border-radius: 16px;
    position: relative;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}
.button:hover,
.button:focus,
.button:active {
    outline: none;
    opacity: 1;
    filter: none;
}
/* 亮色按钮 */
.button-bright {
    background: linear-gradient(90deg, #3AA358, #69CA54);
}
/* 灰色按钮 */
.button-dusty {
    background-color: #D1D1D1;
    pointer-events: none; /* 阻止鼠标事件 */
    cursor: not-allowed; /* 显示禁止光标 */
}
/* 按钮文本 */
.button-text {
    font-weight: bold;
    font-size: 18px;
    color: #FFFFFF;
}

.button.is-loading {
    pointer-events: none;
}

.button.is-loading > * {
    opacity: 0;
}

.button.is-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    box-sizing: border-box;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-spin 0.75s linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

/*** toast样式 ***/
#toastWaka {
    position: fixed;
    display: none;
    left: 50%;
    bottom: 50%;
    z-index: 99999;
    /* margin: 0 auto; */
    -webkit-transform: translate(-50%);
    transform: translate(-50%);
    width: 70%;
    /* height: 40px; */
    line-height: 40px;
    border-radius: 5px;
    text-align: center;
    font-size: 14px;
    color: #fff;
    background-color: rgba(000,000,000,0.5) !important;
}

#toastWaka .text{
    color: #fff;
    display: inline-block;
    font-size: 14px;
    position: absolute;
    top:0;
    bottom:0;
    right:0;
    left:0;
}

/* 加载转圈 */
.popup-loading {
    display: none;
    /* 默认隐藏 */
    position: fixed;
    place-items: center;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    /* 半透明背景 */
    z-index: 10;
    /* 确保在最上层 */
    pointer-events: none; /* 阻止鼠标事件 */
    cursor: not-allowed; /* 显示禁止光标 */
}

.popup-loading-spinner {
    width: 40px;
    /* 设定圆圈的大小 */
    height: 40px;
    border: 4px solid #f3f3f3;
    /* 边框颜色 */
    border-top: 4px solid #3498db;
    /* 顶部颜色 */
    border-radius: 50%;
    /* 圆形 */
    animation: spin 1s linear infinite;
    /* 添加动画 */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    /* 从0度开始 */
    100% {
        transform: rotate(360deg);
    }

    /* 旋转360度 */
}

/* SPA 切屏：新页短距飞入，等 CSS 时旧页遮罩仍盖住 */
html.spa-fading {
    overflow-x: hidden;
    background-color: #ffffff;
}

html.spa-fading body,
html.spa-fading .container {
    background: #ffffff;
    background-color: #ffffff;
}

html.spa-fading .header,
html.spa-keep-header .header,
html.spa-keep-header .container > .progress-box {
    background: #ffffff;
    z-index: 2;
}

/* 新页 CSS 未生效前先藏住 body，避免未样式 DOM 闪一下 */
html.spa-css-pending body {
    visibility: hidden !important;
}

/* 问卷顶栏常驻时只藏主内容和底部按钮，logo 可以立刻显示 */
html.spa-keep-header.spa-css-pending body {
    visibility: visible !important;
}

html.spa-keep-header.spa-css-pending main.main,
html.spa-keep-header.spa-css-pending footer,
html.spa-keep-header.spa-css-pending .tip-card {
    visibility: hidden !important;
}

/* 离开时 main / footer / 提示卡片同一帧藏掉，避免提示卡片或按钮晚消失 */
html.spa-keep-header.spa-leaving .container > :not(header.header):not(.progress-box) {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: none !important;
}

.spa-slide-clip {
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: hidden;
    pointer-events: none;
    background: #ffffff;
    contain: strict;
    transform: translateZ(0);
}

.spa-slide-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #ffffff;
}

html.spa-fading,
html.spa-fading body,
html.spa-fading .container {
    overflow-x: hidden !important;
}

html.spa-fading main.main,
html.spa-fading footer,
html.spa-fading .tip-card {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    pointer-events: none;
}

@media (min-width: 576px) {
    .container, .page {
        max-width: 576px !important;
    }
}

@media (min-width: 768px) {
    .container, .page {
        max-width: 768px !important;
    }
}
