/* ============================================================
   设备样式（CSS 变量驱动）
   每台设备通过 JS 注入：--screen-w / --screen-h / --vw / --vh / --scale / --brand-color
   ============================================================ */

/* 通用屏幕 */
.screen {
    position: relative;
    overflow: hidden;
    background: #fff;
}
.screen iframe {
    display: block;
    border: 0;
    background: #fff;
    transform-origin: 0 0;
    pointer-events: none;
    width: var(--vw);
    height: var(--vh);
    transform: scale(var(--scale));
}
.screen-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #9aa3b2;
    font-size: 13px;
    letter-spacing: .5px;
    pointer-events: none;
    transition: opacity .3s ease;
}
.screen-placeholder.hidden { opacity: 0; }

/* ============================================================
   桌面端
   ============================================================ */
.device-desktop .monitor {
    position: relative;
    width: calc(var(--screen-w) + 24px);
    padding: 12px 12px 22px;
    background: linear-gradient(180deg, #2b3145, #1e2333);
    border-radius: 14px 14px 6px 6px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.device-desktop .monitor::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 7px;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    background: #0d1220;
}
.device-desktop .screen-desktop {
    width: var(--screen-w);
    height: var(--screen-h);
    border-radius: 3px;
}
.device-desktop .monitor-neck {
    width: 64px;
    height: 26px;
    margin: 0 auto;
    background: linear-gradient(180deg, #232838, #171c29);
}
.device-desktop .monitor-base {
    width: 230px;
    height: 12px;
    margin: 0 auto;
    border-radius: 0 0 12px 12px;
    background: linear-gradient(180deg, #232838, #161b27);
    box-shadow: 0 18px 30px -16px rgba(15, 23, 42, .7);
}

/* ============================================================
   笔记本
   ============================================================ */
.device-laptop .laptop-lid {
    width: calc(var(--screen-w) + 16px);
    padding: 8px 8px 10px;
    background: linear-gradient(180deg, #2b3145, #1e2333);
    border-radius: 12px 12px 3px 3px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.device-laptop .screen-laptop {
    width: var(--screen-w);
    height: var(--screen-h);
    border-radius: 3px;
}
.device-laptop .laptop-base {
    position: relative;
    width: calc(var(--screen-w) + 80px);
    height: 16px;
    margin-left: -40px;
    border-radius: 0 0 14px 14px;
    background: linear-gradient(180deg, #333a52, #1b2030);
    box-shadow: 0 22px 34px -20px rgba(15, 23, 42, .8);
}

/* ============================================================
   平板
   ============================================================ */
.device-tablet .tablet-body {
    padding: 8px;
    background: linear-gradient(160deg, #2b3145, #1e2333);
    border-radius: 20px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
    width: calc(var(--screen-w) + 16px);
    height: calc(var(--screen-h) + 16px);
}
.device-tablet .screen-tablet {
    width: var(--screen-w);
    height: var(--screen-h);
    border-radius: 14px;
}

/* ============================================================
   手机机身
   ============================================================ */
.device-phone .phone-body {
    position: relative;
    padding: 4px;
    background: linear-gradient(160deg, #2b3145, #161b27);
    border-radius: 16px;
    box-shadow:
        0 22px 44px -18px rgba(15, 23, 42, .6),
        inset 0 1px 0 rgba(255, 255, 255, .08);
    width: calc(var(--screen-w) + 8px);
    height: calc(var(--screen-h) + 8px);
}
.device-phone .screen-phone {
    width: var(--screen-w);
    height: var(--screen-h);
    border-radius: 12px;
}

/* ============================================================
   挖孔（居中 / 左上 / 右上）
   旋转规则（逆时针 90°）：
     竖屏左上 → 横屏左下
     竖屏右上 → 横屏左上
     竖屏居中 → 横屏左侧居中
   ============================================================ */
.phone-punch {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 32%, #1e2440 0%, #05070d 72%);
    z-index: 4;
    pointer-events: none;
    box-shadow:
        inset 0 1px 1px rgba(100, 130, 200, .25),
        inset 0 -1px 1px rgba(0, 0, 0, .6),
        0 0 2px rgba(0, 0, 0, .5);
}

/* ---- 竖屏 ---- */
.device-phone[data-shape="portrait"] .phone-punch {
    top: 9px;
    left: 50%;
    margin-left: -4px;
}
.device-phone[data-shape="portrait"] .phone-punch.is-left {
    left: 12px;
    margin-left: 0;
}
.device-phone[data-shape="portrait"] .phone-punch.is-right {
    left: auto;
    right: 12px;
    margin-left: 0;
}

/* ---- 横屏 ---- */
.device-phone[data-shape="landscape"] .phone-punch {
    top: 50%;
    left: 9px;
    margin-top: -4px;
    margin-left: 0;
}
/* 竖屏左上角 → 横屏左下角 */
.device-phone[data-shape="landscape"] .phone-punch.is-left {
    top: auto;
    bottom: 12px;
    left: 9px;
    margin-top: 0;
}
/* 竖屏右上角 → 横屏左上角 */
.device-phone[data-shape="landscape"] .phone-punch.is-right {
    top: 12px;
    bottom: auto;
    left: 9px;
    margin-top: 0;
}

/* ============================================================
   居中双孔（药丸形状）
   ============================================================ */
.phone-punch-dual {
    position: absolute;
    background: #05070d;
    z-index: 4;
    pointer-events: none;
    border-radius: 999px;
    box-shadow:
        inset 0 -1px 1px rgba(80, 100, 150, .18),
        0 1px 3px rgba(0, 0, 0, .65);
}
.device-phone[data-shape="portrait"] .phone-punch-dual {
    top: 9px;
    left: 50%;
    width: 26px;
    height: 8px;
    margin-left: -13px;
}
.device-phone[data-shape="landscape"] .phone-punch-dual {
    top: 50%;
    left: 9px;
    width: 8px;
    height: 26px;
    margin-top: -13px;
}

/* ============================================================
   水滴 / 美人尖
   ============================================================ */
.phone-teardrop {
    position: absolute;
    z-index: 4;
    pointer-events: none;
    background: #0a0a0f;
    width: 30px;
    height: 16px;
    box-shadow:
        inset 0 -1px 1px rgba(80, 100, 150, .18),
        0 1px 2px rgba(0, 0, 0, .55);
    clip-path: polygon(
        0 0,
        100% 0,
        100% 55%,
        62% 100%,
        38% 100%,
        0 55%
    );
}
.device-phone[data-shape="portrait"] .phone-teardrop {
    top: 4px;
    left: 50%;
    margin-left: -15px;
}
.device-phone[data-shape="landscape"] .phone-teardrop {
    top: 50%;
    left: 4px;
    width: 16px;
    height: 30px;
    margin-top: -15px;
    clip-path: polygon(
        0 0,
        55% 0,
        100% 38%,
        100% 62%,
        55% 100%,
        0 100%
    );
}

/* ============================================================
   刘海
   ============================================================ */
.phone-notch {
    position: absolute;
    background: #0a0a0f;
    z-index: 4;
    pointer-events: none;
    box-shadow:
        inset 0 -1px 1px rgba(80, 100, 150, .18),
        0 1px 2px rgba(0, 0, 0, .55);
}
.device-phone[data-shape="portrait"] .phone-notch {
    top: 4px;
    left: 50%;
    width: 62px;
    height: 11px;
    margin-left: -31px;
    border-radius: 0 0 10px 10px;
}
.device-phone[data-shape="landscape"] .phone-notch {
    top: 50%;
    left: 4px;
    width: 11px;
    height: 62px;
    margin-top: -31px;
    border-radius: 0 10px 10px 0;
}

/* ============================================================
   灵动岛
   ============================================================ */
.phone-island {
    position: absolute;
    background: #05070d;
    z-index: 4;
    pointer-events: none;
    border-radius: 999px;
    box-shadow:
        inset 0 -1px 1px rgba(80, 100, 150, .18),
        0 1px 3px rgba(0, 0, 0, .65),
        0 0 0 1px rgba(0, 0, 0, .3);
}
.device-phone[data-shape="portrait"] .phone-island {
    top: 8px;
    left: 50%;
    width: 26px;
    height: 8px;
    margin-left: -13px;
}
.device-phone[data-shape="portrait"] .phone-island.is-low {
    top: 11px;
}
.device-phone[data-shape="landscape"] .phone-island {
    top: 50%;
    left: 8px;
    width: 8px;
    height: 26px;
    margin-top: -13px;
}
.device-phone[data-shape="landscape"] .phone-island.is-low {
    left: 11px;
}

/* ============================================================
   品牌色边框（由 JS 注入 --brand-color）
   ============================================================ */
.device[data-brand-color] .phone-body {
    border: 1.5px solid var(--brand-color);
}