/* ===== 移动端横屏旋转提示遮罩（共享：所有 ks100 移动端页面）=====
   需求：移动端且高度<宽度（横屏/因旋转导致）时，显示全屏遮罩，
   上层为手机顺时针旋转动画，提示用户转回竖屏。纯 CSS / 零 JS。
   视觉参考：https://2019.makemepulse.com/ 移动端竖屏锁定提示。
   关键：须中和 css/z-index.css 全局横屏锁（其把整页 html 旋转 -90°），
   否则本页 fixed 遮罩会被带着旋转、无法正立显示。中和仅作用于同条件场景。
   本文件为单一真源，各移动端页面通过 <link rel="stylesheet" href="../css/ks100/landscape-rotate.css"> 引入即可。 */

/* 1) 中和全局横屏锁（仅移动横屏场景；本文件晚于 z-index.css 加载，!important 同级后写胜出） */
@media screen and (orientation: landscape) and (max-width: 768px) {
    html {
        transform: none !important;
        width: auto !important;
        height: auto !important;
        position: static !important;
        top: auto !important;
        left: auto !important;
        overflow: visible !important;
    }
}

/* 2) 遮罩默认隐藏 */
.rs-rotate-overlay {
    display: none;
}

/* 3) 移动横屏时显示遮罩 —— 参考 makemepulse 噪点深蓝灰底 + 米白卡片 + 横屏手机顺时针旋转 */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .rs-rotate-overlay {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: var(--z-lightbox);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20%;
        padding: 28px;
        background:
            radial-gradient(circle at 18% 22%, rgba(241, 241, 241, 0.035) 0, transparent 2px),
            radial-gradient(circle at 82% 18%, rgba(241, 241, 241, 0.03) 0, transparent 1.5px),
            radial-gradient(circle at 64% 78%, rgba(241, 241, 241, 0.04) 0, transparent 2px),
            radial-gradient(circle at 35% 88%, rgba(241, 241, 241, 0.03) 0, transparent 1.5px),
            linear-gradient(160deg, #5e647c 0%, #4f5568 100%);
        color: #1c1c1e;
        text-align: center;
        -webkit-font-smoothing: antialiased;
    }

    /* 顶部提示卡片 */
    .rs-rotate-card {
        background: #f2efe7;
        color: #1c1c1e;
        padding: 14px 22px;
        border-radius: 14px;
        font-size: 15px;
        font-weight: 600;
        line-height: 1.45;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
        max-width: 260px;
    }

    /* 舞台：手机 + 两侧弧线箭头 */
    .rs-rotate-stage {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 18px;
        position: relative;
    }

    /* 手机图标：默认横屏态，顶部带听筒条 */
    .rs-rotate-phone {
        width: 112px;
        height: 58px;
        background: #f2efe7;
        border-radius: 14px;
        position: relative;
        box-sizing: border-box;
        box-shadow:
            0 0 0 2px rgba(241, 241, 241, 0.35),
            0 18px 40px rgba(0, 0, 0, 0.22);
        /* 横屏态(-90°) → 顺时针转至竖屏(0°) → 停顿 → 回横屏，循环 */
        animation: rs-rotate-clockwise 2.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
        flex-shrink: 0;
    }

    /* 听筒/状态条（横屏态下置于右侧窄边、竖向居中） */
    .rs-rotate-phone::after {
        content: "";
        position: absolute;
        right: 6px;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 26px;
        background: rgba(28, 28, 30, 0.35);
        border-radius: 2px;
    }

    /* 居中勾选标记：独立于手机旋转，绝对定位在舞台中心（即手机中心）。
       用内联 SVG + stroke-dashoffset 描边"画出"勾（无淡入）。路径本身即为标准 ✓
       （左上起笔 → 最低点 → 右上），无需额外旋转。 */
    .rs-rotate-check {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 30px;
        height: 30px;
        transform: translate(-50%, -50%);
        overflow: visible;
    }
    .rs-check-path {
        fill: none;
        stroke: #1c1c1e;
        stroke-width: 3.2;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-dasharray: 1;
        stroke-dashoffset: 1;
        animation: rs-check-draw 2.8s ease-in-out infinite;
    }

    .rs-rotate-text {
        margin: 0;
        color: rgba(241, 241, 241, 0.78);
        font-size: 13px;
        line-height: 1.5;
        font-weight: 400;
        letter-spacing: 0.02em;
    }
    .rs-rotate-text small {
        display: block;
        font-size: 12px;
        opacity: 0.85;
    }
}

/* 手机顺时针旋转关键帧：横屏(0° 横矩形) → 顺时针转90°成竖屏(90° 竖矩形) → 停顿 → 回横屏 */
@keyframes rs-rotate-clockwise {
    0%   { transform: rotate(0deg); }
    28%  { transform: rotate(90deg); }
    56%  { transform: rotate(90deg); }
    84%  { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* 勾选标记描边绘制：与手机旋转(2.8s)同步——旋转完成(28%)起从短臂侧描出，竖屏停顿(28%~56%)保持，回旋转出时反向描去 */
@keyframes rs-check-draw {
    0%   { stroke-dashoffset: 1; }
    28%  { stroke-dashoffset: 1; }
    50%  { stroke-dashoffset: 0; }
    56%  { stroke-dashoffset: 0; }
    72%  { stroke-dashoffset: 1; }
    100% { stroke-dashoffset: 1; }
}
