/* AI HTML 幻灯片「分享查看页」样式（独立于主应用 app.css，前缀 hps-）。 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    background: #0b0d12;
    color: #e8eaf0;
    font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
    overflow: hidden;
}
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 不可用占位 ── */
.hps-state {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
}
.hps-state-icon { font-size: 46px; }
.hps-state-title { font-size: 20px; font-weight: 600; }
.hps-state-desc { font-size: 14px; color: #9aa0b0; max-width: 420px; line-height: 1.6; }
.hps-state-link {
    margin-top: 10px;
    color: #b7a7ff;
    text-decoration: none;
    font-size: 13px;
}
.hps-state-link:hover { text-decoration: underline; }

/* ── 密码校验 ── */
.hps-verify {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.hps-verify-card {
    width: 100%;
    max-width: 340px;
    background: #151823;
    border: 1px solid #262a38;
    border-radius: 16px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.hps-verify-icon { font-size: 34px; text-align: center; }
.hps-verify-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: #0e1017;
    border: 1px solid #2c3040;
    border-radius: 10px;
    color: #e8eaf0;
    font-size: 15px;
    outline: none;
}
.hps-verify-input:focus { border-color: #7C5CFF; }
.hps-verify-error { color: #ff6b6b; font-size: 13px; text-align: center; }
.hps-verify-submit {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: #7C5CFF;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.hps-verify-submit:hover { background: #6a4bf0; }
.hps-verify-submit:disabled { opacity: .6; cursor: default; }

/* ── 查看器 ── */
.hps-app { position: fixed; inset: 0; }
.hps-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.hps-top.show { opacity: 1; transform: none; pointer-events: auto; }
.hps-title { flex: 1; font-size: 15px; font-weight: 600; }
.hps-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .1);
    color: #e8eaf0;
    cursor: pointer;
}
.hps-icon-btn:hover { background: rgba(255, 255, 255, .2); }

.hps-stage-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.hps-frame {
    position: relative;
    width: min(100vw, calc(100vh * 16 / 9));
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.hps-frame iframe {
    width: 1280px;
    height: 720px;
    border: 0;
    transform-origin: top left;
    background: #fff;
}

.hps-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(20, 22, 30, .55);
    color: #fff;
    cursor: pointer;
    opacity: .55;
    transition: opacity .15s ease, background .15s ease;
}
.hps-nav:hover { opacity: 1; background: rgba(20, 22, 30, .85); }
.hps-nav:disabled { opacity: .15; cursor: default; }
.hps-nav.prev { left: 16px; }
.hps-nav.next { right: 16px; }

.hps-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(20, 22, 30, .6);
    color: #e8eaf0;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.hps-made {
    position: absolute;
    bottom: 16px;
    right: 18px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(20, 22, 30, .6);
    color: #cfd2dd;
    text-decoration: none;
    font-size: 12px;
}
.hps-made:hover { background: rgba(20, 22, 30, .85); }
.hps-made-logo { height: 16px; width: auto; }

@media (max-width: 640px) {
    .hps-nav { width: 38px; height: 38px; }
    .hps-nav.prev { left: 8px; }
    .hps-nav.next { right: 8px; }
    .hps-made span { display: none; }
}

/* ── RTL（阿拉伯语等从右到左语言）──────────────────────────────
   只覆盖物理方向属性；幻灯片本身保持 LTR。 */

/* 分享页：舞台固定 LTR —— iframe 是行内元素，RTL 下 1280px 宽的 iframe 会贴右排版、向左溢出，
   再按左上角缩放后整页偏移（桌面右移 160px 露白条，手机整页移出画面只剩白底） */
[dir="rtl"] .hps-frame { direction: ltr; }

/* 分享页：上一页 / 下一页左右互换，箭头朝向随之翻转 */
[dir="rtl"] .hps-nav.prev { left: auto; right: 16px; }
[dir="rtl"] .hps-nav.next { right: auto; left: 16px; }
[dir="rtl"] .hps-nav svg { transform: scaleX(-1); }

/* 分享页：页码「1 / 4」按 LTR 显示，否则被重排成「4 / 1」 */
[dir="rtl"] .hps-counter { direction: ltr; }

/* 分享页：右下角「由 PPT.AI 制作」徽标移到左下角（logo 图片本身不镜像） */
[dir="rtl"] .hps-made { right: auto; left: 18px; }

@media (max-width: 640px) {
    [dir="rtl"] .hps-nav.prev { right: 8px; }
    [dir="rtl"] .hps-nav.next { left: 8px; }
}
