/*
 * public/frontend/style-sp.css
 * 窄屏与 @frontend 四屏 SP 专用：在 style.css 之后加载，覆盖/补全 max-width:1023 等。
 * 750 约定与 --sp-750-1 见文件末尾。加载顺序见各 blade: style.css → style-sp.css
 *
 * 断点（小→大の読み方・ファイル内の重ね掛かり順。未マージ大段を動かすと既調デザインが壊れやすい）：
 * 1) (max-width: 1023px) — SP 全般。設問帯等は下記より先に書かれる。
 * 2) (min 481 & max 1023) — 中幅・横持 等で 1) の「設問/結果」字だけ上書き。
 * 3) (max 767 + portrait) — 最狭寄り＋縦、案内行だけ上書き。
 * 4) (max 767) — 旧 480 相当の一括（長大ブロック、1023 より後＝上書きが効く位置）。
 * 5) (min 768 & max 1024) — 小〜中タブレット。1023 と重なる幅では後勝ちで注意。
 * 6) 末尾 (max 1023) 内 :root { --sp-750-1 } — 上記の道具変数。別 @media 維持でキャッシュ上書きの影響を限定。
 */

/* survey：設問区 disabled / 提出ボタン（result に .button_group は無い） */
.num_list_content div.disabled {
    opacity: 0.5;
    pointer-events: none;
}
.button_group div.disabled {
    opacity: 1;
    pointer-events: none;
    background-color: #AAAAAA;
}
.button_group div.ready-to-submit {
    background-color: #5EB693;
    color: white;
}

/* survey：先頭 .content_list に survey-employee-block を併記（同一要素に 2 class。SP 左右 10px） */
@media (max-width: 1023px) {
    .content_list.survey-employee-block {
        box-sizing: border-box;
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* survey / result 共用：AuditCloud ヘッダー。≤1023 で横並び＋SP ロゴ（旧 survey/result 内联）
 * 差分：アンケート＝.container gap 10px、.login_button 5px 10px。結果＝#chooseprint 内のみ gap 4px、6px 18px。 */
.survey-header .survey-header-logo-sp {
    display: none;
}
.survey-header .survey-header-logo-wrap {
    flex-shrink: 0;
}
@media screen and (max-width: 1023px) {
    header.survey-header {
        display: flex;
        align-items: center;
        height: 60px;
        padding-top: 0;
        padding-bottom: 0;
        box-sizing: border-box;
    }
    .survey-header .container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
        width: 100%;
        height: auto;
    }
    .survey-header .survey-header-logo-pc {
        display: none !important;
    }
    .survey-header .survey-header-logo-sp {
        display: block !important;
        width: auto;
        height: min(calc(100vmin * 96 / 750), 56px);
        margin-left: min(calc(100vmin * 32 / 750), 24px);
        margin-right: min(calc(100vmin * 32 / 750), 24px);
    }
    .survey-header .header_login {
        flex: 1;
        min-width: 0;
        justify-content: flex-end;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 4px;
    }
    .survey-header .login_button {
        flex-shrink: 0;
        padding: 6px 18px;
    }
    .survey-header .login_name {
        margin-left: 0;
        min-width: 0;
        flex: 1 1 auto;
    }
    .survey-header .login_name img {
        flex-shrink: 0;
    }
    .survey-header .survey-header-login-name-text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ≤1023：動画（同一断点、複数 @media を 1 つに纏め。順序は従来どおり。） */
@media (max-width: 1023px) {
    /* SP：不叠透明遮罩，直接操作内嵌 YouTube 播放器 */
    .result_video_click_mask {
        display: none !important;
    }
    .result_video_modal{
        padding: 0;
        align-items: stretch;
    }
    .result_video_modal_panel{
        position: relative;
        max-width: 100%;
        width: 100%;
        height: 100dvh;
        height: 100svh;
        min-height: 0;
    }
    .result_video_modal_close{
        position: absolute;
        top: max(8px, env(safe-area-inset-top, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        z-index: 3;
        margin: 0;
    }
    .result_video_modal_frame{
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: none;
        aspect-ratio: auto;
        border-radius: 0;
        box-shadow: none;
    }
    .result_video_modal.result-video-modal-enter .result_video_modal_panel,
    .result_video_modal.result-video-modal-leave-to .result_video_modal_panel{
        transform: translate3d(0, 100%, 0);
    }
    .result_video_modal.result-video-modal-enter-to .result_video_modal_panel,
    .result_video_modal.result-video-modal-leave .result_video_modal_panel{
        transform: none;
    }
    .result_video_grid{
        flex-direction: column;
    }
}
/* survey / result：設問1～10 条；≤1023 均适用（含横持手机・平板），与 ≤480 竖屏同档，防「設問」「結果」折行
 * 说明：视口 ≤1023 走本段；「与旧 480 同档」的整页手机样式见下段 @media (max-width: 767px)。
 * 与 480 已对齐的间距类（如 .num_List 下边距/宽度）应写在本 1023 内。 */
@media (max-width: 1023px) {
    .br-pc {
        display: none;
    }
    /* 手机端：設問-1~10-結果 单行显示，缩小文字与数字 */
    .num_List{
        height: auto;
        padding: 6px 2%;
        flex-wrap: nowrap;
        align-items: center;
        border-radius: 10px;
        /* 与 480 段一致，覆盖 style.css 的 40px/90%，使 481～1023 横持/平板也同档 */
        margin-bottom: 15px;
        width: 94%;
    }
    .num_List .line{
        display: none;
    }
    .num_List >div:first-child{
        flex-shrink: 0;
        font-size: 10px;
        white-space: nowrap;
        margin-right: 2px;
    }
    .num_list_content{
        flex-wrap: nowrap;
        flex: 1;
        min-width: 0;
        margin: 0 2px;
        margin-right: 6px;
        justify-content: space-between;
    }
    .num_list_content >div{
        width: 6.8vw;
        height: 6.8vw;
        min-width: 24px;
        min-height: 24px;
        line-height: 6.8vw;
        font-size: 5vw;
        margin: 0 0.1vw;
    }
    .num_list_content >div.select{
        background: #5EB693;
        color: #FFFFFF;
    }
    .num_list_content2{
        /*margin-left: 10%;*/
    }
    .num_List .select_result,
    .num_List >div:last-child{
        flex-shrink: 0;
        height: 20px;
        padding: 0 4px;
        font-size: 10px;
        font-weight: bold;
        line-height: 20px;
        color: #fff !important;
        background: #5EB693;
        border-radius: 5px;
        white-space: nowrap;
    }
    .content_list2{
        flex-wrap:wrap ;
    }
    .content_list > div:last-child {
        max-width: 100%;
        font-size: 14px;
        line-height: 18px;
    }
    /* 最后一个是案内时（.survey-answer-prompt）不要 8px 上距；无该类名时（如 result）保留上距 */
    .content_list > div:last-child:not(.survey-answer-prompt) {
        margin-top: 8px;
    }
    .content_list > div:last-child.survey-answer-prompt {
        margin-left: 5px;
        margin-top: 0px;
    }
    .print_btn,.print_bottom{
        display: none!important;
    }
    .content2_text_new{
        padding-left:5%;
        padding-right:2%;
    }
    .table-container{
        margin-top:20px;
    }
    .big_result_content{
        padding-top: 20px;
        flex-wrap: wrap;
        display: flex;
    }
    .big_result_content img{
        margin-right: 0;
    }
    .content_title{
        font-size: 24px;
    }
}
/* 横持手机·平板（481～1023）：仅放大「設問」「結果」标签，与 ≤480 的 11px 区分；不作用于 PC */
@media (min-width: 481px) and (max-width: 1023px) {
    .num_List >div:first-child{
        font-size: 18px;
    }
    .num_List .select_result,
    .num_List >div:last-child{
        font-size: 18px;
        height: 28px;
        line-height: 28px;
        padding: 0 10px;
    }
}
/* survey 案内行：仅 ≤767 且竖屏时 margin-top:0；横持或 768+ 不套用本条 */
@media screen and (max-width: 767px) and (orientation: portrait) {
    .content_list > div:last-child.survey-answer-prompt {
        margin-top: 10px;
    }
}
/* 手机端：视口 ≤767（含原 480 与 481～767，与横持手机同套样式；>768 用平板段或 PC） */
@media screen and (max-width: 767px) {
    .icon-large {
        font-size: 16px;
    }

    .icon-small {
        font-size: 14px;
    }

    .rank-wrapper {
        height: auto;
        overflow: visible;
        margin-top: 0;
    }
    header {
        background-color: #fff;
        color: white;
        text-align: center;
        padding: 10px 0;
        height: 100px;
    }
    header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 100%;
    }
    header .header_login{
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .big_result_title{
        font-size: 5vw;
    }
    .big_result_content{
        text-align: center;
        display: flex
    ;
        justify-content: center;
        align-items: baseline;
    }
    .big_result_content img{
        position: relative;
        bottom: 10px;
        margin-right: 6px;
        max-width: 60px;
        height: auto;
    }
    .big_result_content .roboto{
        font-family: Roboto, serif;
        height: 100px;
        font-weight: 500;
        font-size: 110px;
        color: #B90F04;
        margin-right:6px;
        line-height: 1;
    }
    .result_page_body{
        padding-left: 10px;
        padding-right: 10px;
    }
    /**
    弹窗样式
    */
    .dialog {
        /* 隐藏弹窗，默认不显示 */
        /* display: none;  */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        padding:0;
        opacity: 0;
    }
    .dialog_content {
        background: white;
        padding: 40px;
        border-radius: 5px;
        position: relative;
        width: 800px;
        box-sizing: border-box;
    }
    .dialog_close {
        position: absolute;
        top: -30px;
        right: 0;
        background: none;
        border: none;
        font-size: 30px;
        cursor: pointer;
        color: #fff;
        z-index: 999;
    }
    .dialog_item_title{
        background-color: #f0f0f0;
        padding:0 2%;
        font-size:20px;
        color:#333;
    }

    body {
        font-size: 14px;
    }
    .logo {
        width: 80%;
    }
    .container {
        flex-direction: column;
        padding: 15px 10px 0px 10px;
        width: auto;
    }
    header .container{
        padding: 0 5px;
    }
    header, footer {
        padding: 5px 0;
    }
    footer{
        margin-top: 0;
    }
    /* SP：.content_list 仅手机端缩小下边距 */
    .content_list {
        margin-bottom: 15px;
    }
    /* .num_List 下边距/宽：见 max-width:1023 段；本段只保留更窄的圆角 */
    .num_List {
        border-radius: 6px;
    }
    .button button {
        width: 80%;
        height: 60px;
        font-size: 24px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    .button button  img{
        position: absolute;
        right: 36px;
        top:20px;
        width: 20px;
    }
    .main_img{
        width: 100%;
        margin-top:20px;
    }
    .main_img img{
        width: 100%;
    }
    main{
        margin-top:0px;
        padding-top: 15px;
        padding-bottom: 30px;
    }
    .login_name{
        /* margin-top:8px; */
        font-size: 0.9rem;
    }
    .login_button{
        /* margin-top:8px; */
        font-size: 0.8rem;
    }
    main .flex{
        flex-wrap: wrap;
    }
    /* 手机端：设问选项保持一行一个，不沿用桌面端间距 */
    .content_list >div:first-child {
        font-size: 14px;
        height: 26px;
        width: 90px;
        line-height: 26px;
    }
    .content_list >div span {
        font-size: 14px;
        font-weight: 500;
    }
    .question_list{
        width: 90%;
        flex-direction: column;
        align-items: stretch;
        margin-top: 0;
        margin-bottom: 0;
        row-gap: 0;
        column-gap: 0;
        max-width: none;
        padding-top: 10px;
        padding-bottom: 5px;
    }
    .question_list_item{
        width: 100%;
        margin-bottom: 20px;
        font-size: 19px;
        height: 52px;
        line-height: 46px;
    }
    .num_text {
        font-size: 12px;
        line-height: 15px;
        padding:10px 12px;
        border-radius: 3px;
        margin-left: 3%;
        margin-right: 3%;
        width: 94%;
        margin-bottom: 18px;
    }
    .q2tips {
        margin-bottom: 22px;
        font-size: 14px;
        line-height: 22px;
    }
    .button_group{
        width: 94%;
    }
    .button_group div:first-child{
        margin-right: 4%;
    }
    .button_group div {
        width: 160px;
        height: 48px;
        line-height: 50px;
        font-size: 16px;
        border-radius: 5px;
    }
    .content_list >div:last-child span.red{
        margin-left:0;
    }
    .table_message{
        grid-template-columns: 1fr;
        row-gap: 16px;
        column-gap: 0;
    }
    .content2 {
        margin-top: 15px;
    }
    .content2_text_new{
        width: 80%;
        right: 0;
        text-align: right;
    }
    .content2_text_new_title {
        display: flex;                /* 水平排列 */
        flex-wrap: nowrap;            /* 不换行 */
        justify-content: flex-end;    /* 向右对齐 */
        /*gap: 6px;                     !* 两个 div 之间的间距 *!*/
        width: 100%;
    }
    .content2_text_new_title>div{
        white-space: nowrap;
        display: inline-block;
        color: white;
        background: #817F7F;
        border-radius: 20px;
        padding: 2px 8px;
        font-size: 3.5vw;             /* 用 vw 单位让字体随屏幕宽度变化 */
        line-height: 1.5;
    }
    .content2_text_new_title>div:first-child{
        padding-left: 10px;
        padding-right: 10px;
        /*font-size: 12px;*/
        font-size: 3vw;
        height: 5vw;
        line-height: 20px;
    }
    .content2_text_new_title>div:last-child{
        /*font-size: 12px;*/
        font-size: 2vw;
        padding-left: 10px;
        padding-right: 10px;
        height: 4vw;
        line-height: 18px;
        margin-top: 10px;
        /*margin-bottom: 4px;*/
    }
    .content2_text_new_content{
        margin-left:10px;
        text-align: left;
        width: 100%;
    }
    .result-rank-large {
        font-size: 28px;
        line-height: 30px;
    }
    .result-drink-large {
        font-size: 22px;
        line-height: 24px;
    }
    .result-rank-unit-1 {
        font-size: 12px;
    }
    .result-rank-unit-2 {
        font-size: 10px;
    }
    .result-rank-unit-3 {
        font-size: 14px;
    }
    .result-drink-unit-1 {
        font-size: 12px;
    }
    .result-drink-unit-2 {
        font-size: 10px;
    }
    .result-drink-unit-3 {
        font-size: 12px;
    }
    .content3_text{
        flex-wrap: wrap;
    }
    /* 上段 .bg_f0f0f0 だけ従来どおり 5% 左右内边距 */
    .bg_f0f0f0{
        padding: 15px 6% 20px 6%;
        margin-bottom: calc(10px + var(--score-panel-tri-h));
        border-radius: 5px;
    }
    .borde_green {
        margin-top: 0px;
        padding-bottom: 15px;
        border-radius: 5px;
    }
    .result_thanks_box {
        margin-top: 20px;
    }
    .content_title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    .bg_f0f0f0_flat,
    .result_video_block{
        padding: 18px 12px 18px 12px;
        margin-bottom: 22px;
        border-radius: 5px;
    }
    .result_video_important_flag{
        width: 47px;
        height: 47px;
        font-size: 16px;
        transform: translate(calc(50% - 14px), calc(-50%));
    }
    .result_video_item_title {
        margin-top: 10px;
        font-size: 18px;
    }
    .result_video_grid {
        gap: 24px;
    }
    .result_video_item_desc {
        font-size: 15px;
    }
    .table-container {
        margin-top: 0px;
    }
    .result_audit_sources {
        margin-top: 0px;
    }

    .col_img img{
        width: calc(50% - 30px); /* 减去左右边距 */
    }

    .dialog_content2{
        padding:5vw;
        width: 90vw!important;
    }
    .dialog_item_text3{
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .dialog_item_text3 div{
        margin:20px 5%;
        text-align: center;
        line-height: 18px;
        padding:12px 26px;
        color: #fff;
        font-size: 12px;
        border-radius: 22px;
        background: #5EB693;
        width: max-content;
        margin-top: 40px;
    }
    .dialog_item_text4{
        text-align: center;
        margin:20px 5%;
        font-size: 12px;
        margin-top: 0;
    }
    .dialog_item_text5{
        margin-bottom:22px;
        padding-bottom:12px;
        border-bottom: 1px solid #5EB693;
        font-size:20px ;
        font-weight: 500;
    }
    .dialog_item_text6{
        position: relative;
        background: #EDF7F3;
        border-radius: 10px;
        border: 1px solid #5EB693;
        text-align: center;
        padding-left:2%;
        padding-right:2%;
        margin-bottom:20px;
    }
    .dialog_item_text61{
        /*display: flex;*/
        justify-content: center;
        align-items: center;
        height: 74px;
        /*font-size: 16px;*/
        font-size: 4vw;
        border-bottom: 1px solid #5EB693;
        margin:0 -15px;
    }
    .dialog_item_text61 img{
        margin-right:10px
    }
    .dialog_item_text62{
        padding-top: 26px;
        padding-bottom: 20px;
        /*font-size: 16px;*/
        font-size: 3.5vw;
        color: #333333;
    }
    .dialog_item_text63{
        /*font-size: 18px;*/
        font-size: 4vw;
        /*line-height: 18px;*/
        padding-top:16px;
        padding-bottom: 16px;
        background: #F9F7E4;
        border-radius: 5px;
        border: 1px solid #C7C4A9;
        line-height: 26px;


    }
    .dialog_item_text64{
        margin-top:10px;
        margin-bottom: 27px;
        text-align: right;
        /*font-size: 12px;*/
        font-size: 3vw;
    }
    .share_item{
        font-weight: 500;
        /*font-size: 16px;*/
        font-size: 14px;
        color: #0E84AB;
        line-height: 28px;
        padding-left:24px ;
        position: relative;
    }
    .share_item img{
        position: absolute;
        top: 7px;
        left: 0;
    }
    .share_item a{
        text-decoration: none;
        color: #0E84AB;
        word-break: break-all;
    }
    .share_item a:hover{
        text-decoration: underline;
    }
    .dialog_item_text7{
        padding:27px 2%;
        background: #F4F2F3;
        border-radius: 10px;
        text-align: center;
    }
    .bg_item.bg_item--white {
        margin-top: 18px;
        padding: 8px 10px;
        font-size: 10px;
        font-weight: 600;
    }
    .bg_item_small {
        font-size: 10px;
        line-height: 16px;
        margin-top: 4px;
        font-weight: 400;
    }
    .result-supervision-credit {
        font-size: 10px;
    }
    .content5 {
        padding-bottom: 0px;
    }
    .content_title--result-link-section {
        margin-top: 18px;
    }
    .bg_item {
        margin-top: 12px;
    }
    .dialog_item_text71{
        display: flex;
        justify-content: center;
        align-items: center;
        /*font-size: 20px;*/
        font-size: 5vw;
        margin-bottom: 10px;

    }
    .dialog_item_text72{
        font-size: 16px;
    }
    .dialog_item_text7 a{
        color: #0E84AB;
        cursor: pointer;
        text-decoration: none;
        font-size: 4vw;
        line-height: 16px;
    }
    .dialog_item_text7 a:hover{
        text-decoration: underline;

    }
    .dialog_item_text73{
        font-size: 3vw;
    }
}

/* 平板设备 */
@media (min-width: 768px) and (max-width: 1024px) {
    body {
        font-size: 18px;
    }
    .container {
        padding: 20px;
    }
    header .container{
        padding: 0 10px;
    }
    header, footer {
        padding: 10px 0;
    }
    main {
        margin-top:10px;
    }
    .print_btn,.print_bottom{
        display: none!important;
    }
    .col_img img{
        width: calc(50% - 30px); /* 减去左右边距 */
    }
}

/* ---------------------------------------------------------------------------
   【750 竖版设计稿 → CSS 维护约定 | 主针对 @frontend 四屏的 SP(≤1023) 新写/改版】
   落地页：index、survey、result、error（先 style.css 再本文件）；preview 等同理。
   1) 2× 稿：PS 上量的 px ÷2 → 本文件中的 px（逻辑宽约 375）。
   2) 等比于画板宽：width/横向间距 类尺寸可用 calc(设计值 * var(--sp-750-1))；例 300 → calc(300 * var(--sp-750-1))。
      该变量只在本段 @media 中定义，请仅在 max-width:1023 相关规则内使用。
   3) 历史大段旧 px/多断点不必一次改；新块、改块优先 750+本变量 或 ÷2。
   --------------------------------------------------------------------------- */
@media (max-width: 1023px) {
    :root {
        /* 画板 750 的 1 个「宽度单位」对应视口比例，用于与屏宽成比例的尺寸 */
        --sp-750-1: calc(100vw / 750);
    }
}
