/* ============================
   TG Dialog - 弹窗组件样式
   规范参考 agent.md
   ============================ */

/* 弹窗基础层 */
.tg-dialog {
    position: fixed;
    /* [inset-fallback] iOS<14.5 不支持 inset 简写，勿删 */
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity .28s cubic-bezier(.1, 0, .23, 1),
        visibility .28s cubic-bezier(.1, 0, .23, 1);
}

/* 激活状态 */
.tg-dialog.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* 遮罩层 */
.tg-dialog__overlay {
    position: absolute;
    /* [inset-fallback] iOS<14.5 不支持 inset 简写，勿删 */
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    background: rgba(0, 0, 0, .68);
}

/* 内容容器 */
.tg-dialog__wrapper {
    position: relative;
    z-index: 1;
    width: 69%;
    transform: translateY(.2rem) scale(.96);
    transition: transform .28s cubic-bezier(.1, 0, .23, 1);
    background: var(--color-cream);
    border-radius: .1rem;
}

.tg-dialog.is-active .tg-dialog__wrapper {
    transform: none;
}

/* 内容区域 */
.tg-dialog__content {
    position: relative;
    overflow: hidden;
    border-radius: .1rem;
}

/* 标题栏图片 */
.tg-dialog__header {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    user-select: none;
    padding: .1rem;
}

/* 正文区域 */
.tg-dialog__body {
    padding: .3rem .47rem .58rem .47rem;
    background: var(--color-cream);
    color: var(--color-ink);
    font-size: .24rem;
    line-height: 1.5;
    text-align: center;
}

/* 底部按钮区 */
.tg-dialog__footer {
    display: flex;
    gap: .2rem;
    justify-content: center;
    padding: 0 .36rem .4rem;
    background: var(--color-cream);
}

/* [gap-fallback:iOS13] .tg-dialog__footer */
.tg-dialog__footer > * + * { margin-left: .2rem; }
@supports (inset-inline: 0) {
  .tg-dialog__footer { gap: .2rem; }
  .tg-dialog__footer > * + * { margin-left: 0; }
}

/* 通用按钮 */
.tg-dialog__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: .72rem;
    font-family: "HYYouYuan";
    /* padding: 0 .32rem; */
    border: 0;
    border-radius: .36rem;
    /* background: var(--color-yellow); */
    color: var(--color-ink);
    font-size: .34rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: opacity .2s;
}

.tg-dialog__btn:active {
    opacity: .75;
}

/* 关闭按钮 */
.tg-dialog__close {
    position: absolute;
    right: -.1rem;
    top: -.74rem;
    z-index: 5;
    width: .45rem;
    height: .45rem;
    border: 0;
    border-radius: 0;
    background: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tg-dialog__close img {
    width: 100%;
    height: 100%;
    display: block;
}

/* ---- Pop Rules 弹窗内容 ---- */
.pop-rules {
    text-align: left;
}

.pop-rules__line {
    margin: 0 0 .12rem;
    font-family: "en1zc";
    font-size: .36rem;
    line-height: 1.25;
    letter-spacing: -.01rem;
    color: #272727;
}

[lang="ja"] .pop-rules__line {
    font-family: "ja1";
}

.pop-rules__line--note {
    margin-top: .3rem;
}

.pop-rules__label {
    color: #d56c1f;
    font-weight: 700;
}

.pop-rules__label--note {
    color: #d56c1f;
    font-weight: 700;
}

.pop-rules__value {
    color: #272727;
}

[lang="ja"] .pop-rules__line {
    font-family: "ja1";
}

/* ---- Pop Invite 弹窗内容 ---- */
.pop-invite {
    text-align: center;
}

.pop-invite__desc {
    margin: 0 0 .24rem;
    font-family: "en1zc";
    font-size: .35rem;
    font-weight: normal;
    line-height: 1.25;
    letter-spacing: -.01rem;
    color: #272727;
}

.pop-invite__link {
    display: block;
    margin-bottom: .43rem;
    font-family: "HYYouYuan_105J";
    text-decoration: underline;
    font-size: .36rem;
    font-weight: 700;
    color: #272727;
    word-break: break-all;
}

.pop-invite__share {
    display: flex;
    align-items: center;
    justify-content: center;
    /* gap: .5rem; */
}

.pop-invite__share> :last-child {
    margin-right: 0;
}

.pop-invite__share-btn {
    width: .98rem;
    height: .98rem;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: .5rem;
}

.pop-invite__share-btn img {
    width: 100%;
    height: 100%;
    display: block;
}

.pop-invite__share-sep {
    margin-right: .49rem;
    width: 1px;
    height: .6rem;
    background: #ddd;
}

[lang="ja"] .pop-invite__desc {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

[lang="ja"] .pop-invite__link {
    font-family: "ja2", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* ---- Pop Signup 弹窗内容 ---- */
.pop-signup {
    text-align: center;
}

.pop-signup__label {
    margin: 0 0 .19rem;
    font-family: "en1zc";
    font-size: .35rem;
    line-height: 1;
    letter-spacing: -.01rem;
    color: #62605e;
}

.pop-signup__email {
    margin: 0 0 .3rem;
    font-family: "en1zc";
    font-size: .35rem;
    font-weight: normal;
    line-height: 1;
    letter-spacing: -.01rem;
    color: #272727;
    text-decoration: underline;
}

.pop-signup__congrats {
    margin: 0 0 .2rem;
    font-family: "en1zc";
    font-size: .36rem;
    font-weight: normal;
    line-height: 1.25;
    letter-spacing: -.01rem;
    color: #272727;
}

.pop-signup__desc {
    margin: 0;
    font-family: "en1zc";
    font-size: .36rem;
    font-weight: normal;
    line-height: 1.25;
    letter-spacing: -.01rem;
    color: #272727;
}

.pop-signup__thanks {
    margin: .3rem 0 0;
    font-family: "en1zc";
    font-size: .36rem;
    font-weight: normal;
    line-height: 1.25;
    letter-spacing: -.01rem;
    color: #272727;
}

[lang="ja"] .pop-signup__label,
[lang="ja"] .pop-signup__email,
[lang="ja"] .pop-signup__congrats,
[lang="ja"] .pop-signup__desc,
[lang="ja"] .pop-signup__thanks {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* ---- Pop Eligible 弹窗内容 ---- */
.pop-eligible {
    text-align: center;
}

.pop-eligible__desc {
    margin: 0 0 .4rem;
    font-family: "en1zc";
    font-size: .35rem;
    font-weight: normal;
    line-height: 1.25;
    letter-spacing: -.01rem;
    color: #272727;
}

.pop-eligible__platforms {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: .5rem;
}

/* [gap-fallback:iOS13] .pop-eligible__platforms */
.pop-eligible__platforms > * + * { margin-left: .5rem; }
@supports (inset-inline: 0) {
  .pop-eligible__platforms { gap: .5rem; }
  .pop-eligible__platforms > * + * { margin-left: 0; }
}

.pop-eligible__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
}

.pop-eligible__icon {
    width: .98rem;
    height: 1.44rem;
    display: block;
}

.pop-eligible__label {
    font-family: "en1zc";
    font-size: .3rem;
    font-weight: 700;
    color: #272727;
    line-height: 1;
}

[lang="ja"] .pop-eligible__desc {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* ---- Pop Ineligible 弹窗内容 ---- */
.pop-ineligible {
    text-align: center;
}

.pop-ineligible__desc {
    margin: 0 0 .4rem;
    font-family: "en1zc";
    font-size: .36rem;
    font-weight: normal;
    line-height: 1.25;
    letter-spacing: -.01rem;
    color: #272727;
}

.pop-ineligible__actions {
    display: flex;
    gap: .24rem;
    justify-content: center;
}

/* [gap-fallback:iOS13] .pop-ineligible__actions */
.pop-ineligible__actions > * + * { margin-left: .24rem; }
@supports (inset-inline: 0) {
  .pop-ineligible__actions { gap: .24rem; }
  .pop-ineligible__actions > * + * { margin-left: 0; }
}

.pop-ineligible__btn {
    flex: 1;
    min-width: 0;
    font-family: 'HYYouYuan';
    font-size: .34rem;
    letter-spacing: -1px;
    background: url("../../images/dialog/popIneligible-btn-bg.png") no-repeat center / 100% 100%;
}

[lang="ja"] .pop-ineligible__btn {
    font-family: "ja2";
}

[lang="ja"] .pop-ineligible__desc {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* ---- Pop Login No Signup 弹窗内容 ---- */
.pop-login-no-signup {
    text-align: center;
}

.pop-login-no-signup__label {
    margin: 0 0 .1rem;
    font-family: "en1zc";
    font-size: .35rem;
    line-height: 1;
    letter-spacing: -.01rem;
    color: #62605e;
}

.pop-login-no-signup__email {
    margin: 0 0 .3rem;
    font-family: "en1zc";
    font-size: .35rem;
    font-weight: normal;
    line-height: 1;
    letter-spacing: -.01rem;
    color: #272727;
    text-decoration: underline;
    word-break: break-all;
}

.pop-login-no-signup__desc {
    margin: 0;
    font-family: "en1zc";
    font-size: .35rem;
    font-weight: normal;
    line-height: 1.25;
    letter-spacing: -.01rem;
    color: #272727;
}

.pop-login-no-signup__desc+.pop-login-no-signup__desc {
    margin-top: .1rem;
}

[lang="ja"] .pop-login-no-signup__label,
[lang="ja"] .pop-login-no-signup__email,
[lang="ja"] .pop-login-no-signup__desc {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* ---- Pop Not Started 弹窗内容 ---- */
.pop-not-started {
    text-align: center;
}

.pop-not-started__label {
    margin: 0 0 .1rem;
    font-family: "en1zc";
    font-size: .35rem;
    line-height: 1;
    letter-spacing: -.01rem;
    color: #62605e;
}

.pop-not-started__email {
    margin: 0 0 .3rem;
    font-family: "en1zc";
    font-size: .35rem;
    font-weight: normal;
    line-height: 1;
    letter-spacing: -.01rem;
    color: #272727;
    text-decoration: underline;
    word-break: break-all;
}

.pop-not-started__desc {
    margin: 0;
    font-family: "en1zc";
    font-size: .36rem;
    font-weight: normal;
    line-height: 1.25;
    letter-spacing: -.01rem;
    color: #272727;
}

[lang="ja"] .pop-not-started__label,
[lang="ja"] .pop-not-started__email,
[lang="ja"] .pop-not-started__desc {
    font-family: "ja1", "源柔ゴシックP";
}

/* ---- Pop Reserve 弹窗内容 ---- */
.pop-reserve {
    text-align: center;
}

.pop-reserve__label {
    margin: 0 0 .2rem;
    font-family: "en1zc";
    font-size: .35rem;
    line-height: 1;
    letter-spacing: -.01rem;
    color: #62605e;
}

.pop-reserve__email {
    margin: 0 0 .3rem;
    font-family: "en1zc";
    font-size: .35rem;
    font-weight: normal;
    line-height: 1;
    letter-spacing: -.01rem;
    color: #272727;
    text-decoration: underline;
    word-break: break-all;
}

.pop-reserve__desc {
    margin: 0;
    font-family: "en1zc";
    font-size: .35rem;
    font-weight: normal;
    line-height: 1.25;
    letter-spacing: -.01rem;
    color: #272727;
    white-space: pre-line;
}

[lang="ja"] .pop-reserve__label,
[lang="ja"] .pop-reserve__email,
[lang="ja"] .pop-reserve__desc {
    font-family: "ja1";
}

/* Join the Test 按钮：沿用 pop-join-test 切图按钮样式（btn2.png），默认 hidden 由 JS 按链路控制 */
.pop-reserve__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: .5rem;
    width: 3.17rem;
    height: .71rem;
    padding: 0 .44rem;
    border: 0;
    background: url("../../images/dialog/btn2.png") no-repeat center / 100% 100%;
    color: #1a1a1a;
    font-family: "en2", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .28rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -.01rem;
    cursor: pointer;
    transition: opacity .2s;
}

/* 项目无全局 [hidden] 重置，需显式覆盖 inline-flex */
.pop-reserve__btn[hidden] {
    display: none;
}

.pop-reserve__btn:active {
    opacity: .75;
}

.pop-reserve__btn-text {
    display: inline-block;
    color: #1a1a1a;
    font-family: "HYYouYuan", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .32rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -.01rem;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

[lang="ja"] .pop-reserve__btn-text {
    font-family: "ja2";
}

/* ---- Pop Survey 问卷弹窗 ---- */
.pop-survey {
    text-align: left;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .58rem;
    height: 100%;
}

/* [gap-fallback:iOS13] .pop-survey（column 方向） */
.pop-survey > * + * { margin-top: .58rem; }
@supports (inset-inline: 0) {
    .pop-survey { gap: .58rem; }
    .pop-survey > * + * { margin-top: 0; }
}

/* 页面容器 - 默认隐藏 */
.pop-survey__page {
    display: none;
}

/* .pop-survey__subtitle {
    letter-spacing: -.01rem;
    font-size: .35rem;
    line-height: .4rem;
    color: #bfbaaf;
} */

.pop-survey__page.is-active {
    display: flex;
    flex-direction: column;
    position: relative;
    height: 35vh;
    overflow: visible;
    z-index: 3;
}

.pop-survey__page.is-active .pop-survey__checkbox-group {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pop-survey__page.is-active .pop-survey__field {
    flex-shrink: 0;
}

#popSurvey .pop-survey__page.is-active {
    height: 39vh;
}

/* 问题标题 */
.pop-survey__question {
    margin: 0 0 .3rem;
    font-family: "HYYouYuan";
    font-size: .36rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.01rem;
    color: #272727;
}

[lang="ja"] .pop-survey__question {
    font-family: "ja2", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* 字段区域 */
.pop-survey__field {
    margin-bottom: .3rem;
}

.pop-survey__field--inline {
    display: flex;
    align-items: center;
    gap: .2rem;
}

/* [gap-fallback:iOS13] .pop-survey__field--inline */
.pop-survey__field--inline > * + * { margin-left: .2rem; }
@supports (inset-inline: 0) {
  .pop-survey__field--inline { gap: .2rem; }
  .pop-survey__field--inline > * + * { margin-left: 0; }
}

/* 标签 */
.pop-survey__label {
    display: block;
    margin-bottom: .12rem;
    font-family: "en1zc", "HYYouYuan", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .34rem;
    font-weight: normal;
    line-height: 1.3;
    color: #272727;
    white-space: nowrap;
}

.pop-survey__field--inline .pop-survey__label {
    margin-bottom: 0;
}

[lang="ja"] .pop-survey__label {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* 输入框 */
.pop-survey__input {
    display: block;
    width: 100%;
    height: .72rem;
    padding: 0 .2rem;
    border: none;
    border-radius: .08rem;
    background: url("../../images/dialog/survey-email-input-bg.png") no-repeat center / 100% 100%;
    font-family: "FZLanTingYuanS-DB-GB", "HYYouYuan", Arial, sans-serif;
    font-size: .28rem;
    color: #272727;

}

[lang="ja"] .pop-survey__input {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* 提示文本 */
.pop-survey__hint {
    margin: .14rem 0 0;
    font-family: "en1zc", "HYYouYuan", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .35rem;
    letter-spacing: -0.01rem;
    line-height: .42rem;
    color: #d56c1f;
}

[lang="ja"] .pop-survey__hint {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* 下拉框（已弃用，保留用于兼容） */
.pop-survey__select {
    min-width: 2rem;
    height: .6rem;
    padding: 0 .3rem 0 .15rem;
    border: 2px solid #333;
    border-radius: .06rem;
    background: #222;
    color: #fff;
    font-family: "FZLanTingYuanS-DB-GB", "HYYouYuan", Arial, sans-serif;
    font-size: .26rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    background-image: url("../../images/dialog/survey-dropdown-arrow.png");
    background-repeat: no-repeat;
    background-position: right .15rem center;
    background-size: .12rem .1rem;
    padding-right: .35rem;
}

[lang="ja"] .pop-survey__select {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* ---- 自定义下拉组件 ---- */
.pop-survey__dropdown {
    position: relative;
    display: inline-block;
}

.pop-survey__dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .15rem;
    width: 2.14rem;
    height: .53rem;
    padding: 0 .15rem 0 .2rem;
    border: 0;
    border-radius: .06rem;
    background: url("../../images/dialog/survey-dropdown-trigger-bg.png") no-repeat center / 100% 100%;
    color: #272727;
    font-family: "en1zc", "HYYouYuan", Arial, sans-serif;
    font-size: .26rem;
    cursor: pointer;
    outline: none;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 101;
}

/* [gap-fallback:iOS13] .pop-survey__dropdown-trigger */
.pop-survey__dropdown-trigger > * + * { margin-left: .15rem; }
@supports (inset-inline: 0) {
  .pop-survey__dropdown-trigger { gap: .15rem; }
  .pop-survey__dropdown-trigger > * + * { margin-left: 0; }
}

[lang="ja"] .pop-survey__dropdown-trigger {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

.pop-survey__dropdown-value {
    pointer-events: none;
    font-size: .35rem;
}

.pop-survey__dropdown-arrow {
    display: block;
    width: .14rem;
    height: .12rem;
    /* width: 100%;
    height: 100%; */
    background-image: url("../../images/dialog/survey-dropdown-arrow.png");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    transition: transform .2s;
    flex-shrink: 0;
}

.pop-survey__dropdown.is-open .pop-survey__dropdown-arrow {
    transform: rotate(180deg);
}

.pop-survey__dropdown-menu {
    position: absolute;
    top: calc(100% - .3rem);
    left: 0;
    right: 0;
    z-index: 100;
    margin: 0;
    padding: .33rem 0 0 0;
    list-style: none;
    border: 0;
    border-radius: .06rem;
    width: 2.14rem;
    min-height: 1.46rem;
    background: url("../../images/dialog/survey-dropdown-menu-bg.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom;
    color: #fff;
    font-family: "FZLanTingYuanS-DB-GB", "HYYouYuan", Arial, sans-serif;
    font-size: .26rem;
    display: none;
    overflow: hidden;
}

[lang="ja"] .pop-survey__dropdown-menu {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

.pop-survey__dropdown.is-open .pop-survey__dropdown-menu {
    display: block;
}

.pop-survey__dropdown-item {
    display: flex;
    align-items: center;
    /* height: .54rem; */
    padding: 0.15rem .3rem;
    cursor: pointer;
    transition: background .15s;
    font-size: .35rem;
    font-family: "en1zc";
    line-height: .4rem;
    background: url("../../images/dialog/survey-dropdown-line.png") no-repeat center bottom / 1.92rem;
}

.pop-survey__dropdown-item:last-child {
    background: none;
}

.pop-survey__dropdown-item:hover,
.pop-survey__dropdown-item.is-selected {
    background-color: rgba(255, 255, 255, .12);
}

/* 问题副标题（如"复数选择可"） */
.pop-survey__subtitle {
    display: block;
    font-family: "en1zc";
    font-size: .35rem;
    line-height: .4rem;
    letter-spacing: -.01rem;
    color: #bfbaaf;
}

[lang="ja"] .pop-survey__subtitle {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* ---- Checkbox 多选组件 ---- */
.pop-survey__checkbox-group {
    display: flex;
    flex-direction: column;
    max-height: 28vh;
    overflow-y: auto;
}

.pop-survey__checkbox-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: .17rem;
    padding: .14rem 0;
    cursor: pointer;
    background: url("../../images/dialog/survey-checkbox-line.png") no-repeat center bottom / 100% auto;
    -webkit-tap-highlight-color: transparent;
}

/* [gap-fallback:iOS13] .pop-survey__checkbox-item */
.pop-survey__checkbox-item > * + * { margin-left: .17rem; }
@supports (inset-inline: 0) {
  .pop-survey__checkbox-item { gap: .17rem; }
  .pop-survey__checkbox-item > * + * { margin-left: 0; }
}

.pop-survey__checkbox-item:last-child,
.pop-survey__textarea ~ .pop-survey__checkbox-item,
/* iOS 13 不支持 :has()，textarea 前的项改用模板显式 class 标记 */
.pop-survey__checkbox-item--before-textarea,
.pop-survey__checkbox-item:has(+ .pop-survey__textarea) {
    background-image: none;
}

/* 隐藏原生 checkbox：限制在当前 label 内，避免移动端 focus/scrollIntoView 造成滚动容器跳位 */
.pop-survey__checkbox-input {
    position: absolute;
    top: .14rem;
    left: 0;
    width: .42rem;
    height: .42rem;
    margin: 0;
    padding: 0;
    opacity: 0;
    border: 0;
    appearance: none;
    -webkit-appearance: none;
}

/* 自定义 checkbox 方框 */
.pop-survey__checkbox-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: .42rem;
    height: .42rem;
    flex-shrink: 0;
    background: url("../../images/dialog/survey-checkbox.png") no-repeat center / contain;
}

/* 选中状态的勾 */
.pop-survey__checkbox-arrow {
    display: none;
    width: .42rem;
    height: .3rem;
}

.pop-survey__checkbox-input:checked~.pop-survey__checkbox-box .pop-survey__checkbox-arrow {
    display: block;
}

/* 选项文本 */
.pop-survey__checkbox-label {
    font-family: "en1zc";
    font-size: .34rem;
    line-height: 1.3;
    color: #272727;
}

[lang="ja"] .pop-survey__checkbox-label {
    font-family: "ja1";
}

/* "其他"文本输入框 */
.pop-survey__textarea {
    display: block;
    width: 100%;
    padding: .15rem .2rem;
    border: 2px solid #ccc;
    border-radius: .08rem;
    background: url("../../images/dialog/survey-email-input-bg.png") no-repeat center / 100% 100%;
    font-family: "en1zc", "HYYouYuan", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .28rem;
    color: #272727;
    resize: none;
    outline: none;
    border: none;
}

.pop-survey__textarea:focus {
    border-color: #999;
}

[lang="ja"] .pop-survey__textarea {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* 可滚动的多选列表（选项较多时） */
.pop-survey__checkbox-group--scrollable {
    max-height: 28vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: .1rem;
}

.pop-survey__checkbox-group--scrollable::-webkit-scrollbar {
    width: 3px;
}

.pop-survey__checkbox-group--scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.pop-survey__checkbox-group--scrollable::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* "其他"行内输入框 */
.pop-survey__other-input {
    flex: 1;
    min-width: 0;
    height: .52rem;
    padding: 0 .15rem;
    border: none;
    border-bottom: 1px solid #999;
    background: transparent;
    font-family: "en1zc", "HYYouYuan", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .28rem;
    color: #272727;
    outline: none;
}

.pop-survey__other-input:focus {
    border-bottom-color: #272727;
}

.pop-survey__textarea:disabled,
.pop-survey__other-input:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pop-survey__textarea:disabled:focus {
    border-color: #ccc;
}

.pop-survey__other-input:disabled:focus {
    border-bottom-color: #999;
}

[lang="ja"] .pop-survey__other-input {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* ---- 抖动动画（校验失败提示） ---- */
@keyframes pop-survey-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-.05rem); }
    20%, 40%, 60%, 80% { transform: translateX(.05rem); }
}

.pop-survey__input.is-shake,
.pop-survey__checkbox-group.is-shake {
    animation: pop-survey-shake .5s ease-in-out;
}

/* ---- 平台选项横排（Page 1） ---- */
.pop-survey__checkbox-group--platform {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: .2rem .5rem;
    max-height: none;
    overflow: visible;
    margin-bottom: .2rem;
    flex-shrink: 0;
}

/* [gap-fallback:iOS13] .pop-survey__checkbox-group--platform（wrap 双轴，均分法） */
.pop-survey__checkbox-group--platform > * { margin: .1rem .25rem; }
@supports (inset-inline: 0) {
    .pop-survey__checkbox-group--platform { gap: .2rem .5rem; }
    .pop-survey__checkbox-group--platform > * { margin: 0; }
}

.pop-survey__checkbox-group--platform .pop-survey__checkbox-item {
    background: none;
    padding: .05rem 0;
}

/* 平台组不参与 flex:1 滚动 */
.pop-survey__page.is-active .pop-survey__checkbox-group--platform {
    flex: 0 0 auto;
    overflow: visible;
}

/* ---- 可滚动字段区（Page 1 邮箱等） ---- */
.pop-survey__fields-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: .54rem;
    padding-right: .3rem;
}

.pop-survey__scroll-item {
    margin-bottom: .3rem;
}

.pop-survey__scroll-item:last-child {
    margin-bottom: 0;
}

.pop-survey__fields-scroll::-webkit-scrollbar {
    width: 3px;
}

.pop-survey__fields-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.pop-survey__fields-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* ---- 设备信息区（Page 2） ---- */
.pop-survey__device-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: .3rem;
}

.pop-survey__device-scroll::-webkit-scrollbar {
    width: 3px;
}

.pop-survey__device-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.pop-survey__device-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.pop-survey__device-section {
    margin-bottom: .3rem;
}

.pop-survey__device-section:last-child {
    margin-bottom: 0;
}

.pop-survey__device-label {
    /* margin: 0 0 .16rem; */
    color: #d56c1f;
    font-family: "en1zc", "HYYouYuan", Arial, sans-serif;
    font-size: .37rem;
    font-weight: 700;
    letter-spacing: -.01rem;
    line-height: .6rem;
}

[lang="ja"] .pop-survey__device-label {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* 设备信息不参与 checkbox-group 的 flex:1 */
.pop-survey__page.is-active .pop-survey__device-scroll .pop-survey__checkbox-group {
    flex: 0 0 auto;
    overflow: visible;
    max-height: none;
}

/* ---- 单选行为组（设备信息） ---- */
.pop-survey__checkbox-group--radio {
    display: flex;
    flex-direction: column;
}

/* ---- 两列网格（iOS / Android 选项） ---- */
.pop-survey__checkbox-group--2col {
    display: flex;
    flex-direction: column;
}

/* PC 显卡 Other 行：允许换行显示输入框 */
.pop-survey__checkbox-item--other {
    flex-wrap: wrap;
    padding-bottom: 0;
}

.pop-survey__checkbox-item--other .pop-survey__other-input {
    flex: none;
    width: calc(100% - .59rem);
    margin-left: .59rem;
    height: auto;
    margin-top: .04rem;
    padding: .1rem 0;
    border: none;
    border-bottom: 1px solid #272727;
}

/* Survey Agreement */
.pop-survey__agreement {
    display: flex;
    align-items: flex-start;
    gap: .12rem;
    margin-top: .24rem;
    padding: 0 .08rem;
    cursor: pointer;
}

/* [gap-fallback:iOS13] .pop-survey__agreement */
.pop-survey__agreement > * + * { margin-left: .12rem; }
@supports (inset-inline: 0) {
  .pop-survey__agreement { gap: .12rem; }
  .pop-survey__agreement > * + * { margin-left: 0; }
}

.pop-survey__agreement-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pop-survey__agreement-box {
    flex-shrink: 0;
    width: .35rem;
    height: .35rem;
    display: grid;
    place-items: center;
    background: url('/m/assets/images/dialog/survey-checkbox.png') 50% 50% / contain no-repeat;
    margin-top: .06rem;
}

.pop-survey__agreement-box .pop-survey__checkbox-arrow {
    display: block;
    width: .42rem;
    height: .28rem;
    object-fit: contain;
    opacity: 0;
    transition: opacity .15s;
}

.pop-survey__agreement-input:checked ~ .pop-survey__agreement-box .pop-survey__checkbox-arrow {
    display: block;
    opacity: 1;
}

.pop-survey__agreement-input:focus-visible ~ .pop-survey__agreement-box {
    outline: 2px solid #d56c1f;
    outline-offset: .04rem;
}

.pop-survey__agreement-text {
    font-size: .28rem;
    line-height: 1.2;
    color: #d56c1f;
    font-family: "en1zc";
}

[lang="ja"] .pop-survey__agreement-text {
    font-family: "ja1";
}

.pop-survey__agreement-text a {
    color: #d56c1f;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: .03rem;
}

.pop-survey__agreement.is-shake {
    animation: pop-survey-shake .5s ease-in-out;
}

/* Survey Agreement Error */
.pop-survey__agreement-error {
    display: none;
    margin-top: .12rem;
    padding: 0 .08rem;
    font-size: .24rem;
    line-height: 1.4;
    color: #e5484d;
    font-family: "en1zc";
    text-align: left;
}

[lang="ja"] .pop-survey__agreement-error {
    font-family: "ja1";
}

.pop-survey__agreement-error.is-visible {
    display: block;
}

@keyframes pop-survey-cue-bounce {
    0%, 100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, .1rem);
    }
}

.pop-survey__scroll-cue {
    position: absolute;
    left: 50%;
    bottom: .14rem;
    z-index: 4;
    display: grid;
    place-items: center;
    width: .5rem;
    height: .32rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    animation: pop-survey-cue-bounce 1.4s ease-in-out infinite;
    -webkit-tap-highlight-color: transparent;
}

/* Page 1：滚动区下方还有语言选择行（.53rem 行高 + .3rem margin + 滚动区 .44rem margin），
   将箭头锚定在 fields-scroll 底部边缘处 */
.pop-survey__page[data-page="1"] .pop-survey__scroll-cue {
    bottom: 1.14rem;
}

/* Page 4：滚动区下方还有协议勾选行，避开协议区域 */
.pop-survey__page[data-page="4"] .pop-survey__scroll-cue {
    bottom: 1.2rem;
}

.pop-survey__scroll-cue[hidden] {
    display: none;
}

.pop-survey__scroll-cue img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 .03rem .03rem rgba(0, 0, 0, .22));
}

/* 底部导航 */
.pop-survey__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .24rem;
    /* position: sticky;
    bottom: 0;
    left: 0;
    right: 0; */
    /* margin-top: .4rem;
    padding: .2rem 0; */
    background: var(--color-cream);
    position: relative;
    z-index: 2;
}

/* [gap-fallback:iOS13] .pop-survey__nav */
.pop-survey__nav > * + * { margin-left: .24rem; }
@supports (inset-inline: 0) {
  .pop-survey__nav { gap: .24rem; }
  .pop-survey__nav > * + * { margin-left: 0; }
}

/* 翻页按钮 */
.pop-survey__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.21rem;
    height: .6rem;
    padding: 0 .3rem;
    border: 0;
    border-radius: .34rem;
    font-family: "HYYouYuan";
    font-size: .3rem;
    font-weight: 800;
    cursor: pointer;
    transition: opacity .2s;
}

[lang="ja"] .pop-survey__btn { 
    font-family: "ja2";
}

.pop-survey__btn:active {
    opacity: .75;
}

.pop-survey__btn--prev {
    background: #f5a623;
    color: #fff;
}

.pop-survey__btn--prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pop-survey__btn--next {
    background: #272727;
    color: #fff;
}

.pop-survey__btn--next.is-submit {
    background: #272727;
}

/* 页码指示器 */
.pop-survey__pager {
    font-family: "en1zc";
    font-size: .28rem;
    font-weight: 700;
    color: #272727;
    user-select: none;
}

[lang="ja"] .pop-survey__pager {
    font-family: "ja1";
}

/* 占位区域（待填充页面） */
.pop-survey__placeholder {
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ddd;
    border-radius: .08rem;
    color: #aaa;
    font-size: .26rem;
}

/* 滚动锁定 */
body.is-dialog-open {
    overflow: hidden;
}

/* ---- Pop Share 分享弹窗 ---- */
/* 分享弹窗无标题栏，覆盖默认 wrapper 样式 */
.tg-dialog--share .tg-dialog__wrapper {
    width: 8.99rem;
    max-width: calc(100vw - .8rem);
    background: transparent;
    border-radius: 0;
}

.tg-dialog--share .tg-dialog__close {
    right: .1rem;
    top: -.75rem;
}

/* 分享弹窗内容 */
.pop-share {
    text-align: center;
}

/* 海报主体：设计稿白色主图 899 × 1198 */
.pop-share__poster {
    position: relative;
    width: 8.99rem;
    max-width: 100%;
    margin: 0 auto;
}

/* 游戏主视觉图 */
.pop-share__hero {
    display: block;
    width: 100%;
    height: 11.98rem;
    margin: 0 auto;
    border-radius: .08rem;
    object-fit: fill;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: default;
    pointer-events: auto;
}

/* 顶部二维码底图：设计稿 671 × 249，覆盖在主图上方 */
.pop-share__qr-panel {
    position: absolute;
    left: -.17rem;
    top: -.31rem;
    z-index: 2;
    width: 6.71rem;
    height: 2.49rem;
}

.pop-share__qr-bg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

/* QR 渲染容器：覆盖 qrcode-bg 左侧白色预留区 */
.pop-share__qr {
    position: absolute;
    left: .31rem;
    top: .37rem;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.81rem;
    height: 1.81rem;
    background: #fff;
    transform: rotate(-1.5deg);
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: default;
}

.pop-share__qr canvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
}

/* 合成后的整幅海报（主图 + 二维码底板 + 二维码），长按/右键保存即为完整海报 */
/* 合成画布含面板溢出区：916 × 1229，相对海报盒左上偏移 (-17, -31) */
.pop-share__composite {
    display: block;
    width: 9.16rem;
    max-width: none;
    margin: -.31rem 0 0 -.17rem;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: default;
    pointer-events: auto;
}

/* 长按保存提示（仅移动端显示） */
.pop-share__tip {
    position: absolute;
    left: 50%;
    bottom: 1.23rem;
    z-index: 2;
    width: 8.05rem;
    height: .43rem;
    margin: 0;
    transform: translateX(-50%);
    font-family: "en1zc";
    font-size: .42rem;
    font-weight: normal;
    font-stretch: normal;
    line-height: .43rem;
    letter-spacing: -.01rem;
    color: #62605e;
    text-align: center;
    display: none;
}

/* 触屏设备显示长按提示 */
@media (hover: none) and (pointer: coarse) {
    .pop-share__tip {
        display: block;
    }
}

[lang="ja"] .pop-share__tip {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* ---- Pop Pre-Register 弹窗 ---- */
.pop-pre-register {
    text-align: center;
}

.pop-pre-register__desc {
    margin: .5rem 0 1.1rem;
    font-family: "en1zc", "HYYouYuan", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .36rem;
    font-weight: normal;
    line-height: 1.25;
    letter-spacing: -.01rem;
    color: #272727;
}

[lang="ja"] .pop-pre-register__desc {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

.pop-pre-register__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* min-width: 2.4rem; */
    width: 3.17rem;
    height: .71rem;
    padding: 0 .44rem;
    border: 0;
    background: url("../../images/dialog/btn2.png") no-repeat center / 100% 100%;
    color: #1a1a1a;
    font-family: "en2", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .28rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -.01rem;
    cursor: pointer;
    transition: opacity .2s;
}

.pop-pre-register__btn:active {
    opacity: .75;
}

.pop-pre-register__btn-text {
    display: inline-block;
    color: #1a1a1a;
    font-family: "HYYouYuan", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .32rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -.01rem;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

[lang="ja"] .pop-pre-register__btn-text {
    font-family: "ja2";
}

/* ---- Pop Join-Test 弹窗（结构与 Pop Pre-Register 一致） ---- */
.pop-join-test {
    text-align: center;
}

.pop-join-test__desc {
    margin: .5rem 0 1.1rem;
    font-family: "en1zc", "HYYouYuan", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .36rem;
    font-weight: normal;
    line-height: 1.25;
    letter-spacing: -.01rem;
    color: #272727;
}

[lang="ja"] .pop-join-test__desc {
    font-family: "ja1", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

.pop-join-test__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.17rem;
    height: .71rem;
    padding: 0 .44rem;
    border: 0;
    background: url("../../images/dialog/btn2.png") no-repeat center / 100% 100%;
    color: #1a1a1a;
    font-family: "en2", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .28rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -.01rem;
    cursor: pointer;
    transition: opacity .2s;
}

.pop-join-test__btn:active {
    opacity: .75;
}

.pop-join-test__btn-text {
    display: inline-block;
    color: #1a1a1a;
    font-family: "HYYouYuan", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .32rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -.01rem;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

[lang="ja"] .pop-join-test__btn-text {
    font-family: "ja2";
}

/* ---- Pop Reward 预约奖励弹窗 ---- */
.pop-reward {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 卡片图：设计稿 338×329 */
.pop-reward__card {
    display: block;
    width: 3.38rem;
    height: auto;
    user-select: none;
    -webkit-user-select: none;
}

/* 名称绶带：底图 615×101 + 文本叠加（双语文字不同，不走切图） */
.pop-reward__name {
    position: relative;
    width: 6.15rem;
    margin-top: .05rem;
}

.pop-reward__name-bg {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-select: none;
}

.pop-reward__name-text {
    position: absolute;
    /* [inset-fallback] iOS<14.5 不支持 inset 简写，勿删 */
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 .6rem;
    font-family: "en2", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: .28rem;
    line-height: 1;
    letter-spacing: .01rem;
    color: #fbf7ee;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

[lang="ja"] .pop-reward__name-text {
    font-family: "ja2", "源柔ゴシックP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
    letter-spacing: 0;
}

/* 描述文案：设计稿 36/45 字距-1px，宽 618px，色 #272727 居中 */
.pop-reward__desc {
    margin: .1rem auto 0;
    max-width: 6.18rem;
    font-family: "en1zc";
    font-size: .36rem;
    font-weight: normal;
    line-height: .45rem;
    letter-spacing: -.01rem;
    color: #272727;
}

[lang="ja"] .pop-reward__desc {
    font-family: "ja1";
    letter-spacing: 0;
}