/*
 * /ppt 全屏画报 deck（沿用旧站展示形式）
 * 作用域限定在 .ppt-deck 内，避免旧版全局样式影响站点的菜单。
 */

/* 画报页：锁滚动、黑底；旋转态只作用于 .ppt-deck，站点控件保持正立 */
.ppt-html,
.ppt-html body {
    height: 100%;
    overflow: hidden;
    background: #000;
}

/* 画报页不加载 Font Awesome：菜单按钮用字体无关的字符图标兜底 */
.ppt-html .menu-icon i::before {
    content: "\2630";
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-style: normal;
    font-weight: 400;
    line-height: 1;
}

.ppt-html .menu-icon i.fa-times::before { content: "\00D7"; }

.ppt-deck {
    --bg: #000;
    --fg: #fff;
    --muted: rgba(255, 255, 255, 0.58);
    --muted-2: rgba(255, 255, 255, 0.5);
    --hairline: rgba(255, 255, 255, 0.1);
    --surface: rgba(255, 255, 255, 0.06);
    --chrome-h: 46px;
    --n: 1;
    --pill-float: clamp(14px, 3%, 26px);
    --font-body: "Barlow", "Noto Sans SC", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --ease: cubic-bezier(0.77, 0, 0.175, 1);
    --dur-slide: 0.6s;
    --dur-enter: 0.7s;

    position: fixed;
    inset: 0;
    z-index: 900;
    overflow: hidden;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.ppt-deck button {
    font: inherit;
    color: inherit;
}

/* 内容保护：禁右键/长按存图/拖拽（JS 同时拦截右键与开发者工具快捷键） */
.ppt-deck img,
.ppt-noscript img {
    display: block;
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    user-select: none;
}

/* 仅供读屏/搜索引擎的标题 */
.ppt-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ─── 滑页引擎 ─────────────────────────────────────────────────── */
.ppt-deck #deck {
    display: flex;
    width: calc(100% * var(--n, 1));
    height: 100%;
    transition: transform var(--dur-slide) var(--ease);
    will-change: transform;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.ppt-deck .slide {
    flex: 0 0 calc(100% / var(--n, 1));
    width: calc(100% / var(--n, 1));
    height: 100%;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.ppt-deck .stage {
    height: 100%;
    display: grid;
    place-items: center;
    position: relative;
}

.ppt-deck .work-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
}

.ppt-deck .slide.is-active .work-img {
    animation: pptImgIn var(--dur-enter) var(--ease) forwards;
}

@keyframes pptImgIn {
    from { opacity: 0; transform: scale(1.02); }
    to { opacity: 1; transform: none; }
}

/* ─── 入场动画系统（脚本就绪后才隐藏并动画，避免字体加载期黑屏）── */
.ppt-deck.ppt-anim [data-anim] { opacity: 0; }

.ppt-deck.ppt-anim .slide.is-active [data-anim] {
    animation-duration: var(--dur-enter);
    animation-timing-function: var(--ease);
    animation-fill-mode: forwards;
}

.ppt-deck.ppt-anim .slide.is-active [data-anim="fade-in"] { animation-name: pptFadeIn; }
.ppt-deck.ppt-anim .slide.is-active [data-anim="fade-up"] { animation-name: pptFadeUp; }

.ppt-deck.ppt-anim [data-delay="0"] { animation-delay: 0s; }
.ppt-deck.ppt-anim [data-delay="1"] { animation-delay: 0.12s; }
.ppt-deck.ppt-anim [data-delay="2"] { animation-delay: 0.26s; }
.ppt-deck.ppt-anim [data-delay="3"] { animation-delay: 0.42s; }

@keyframes pptFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pptFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: none; }
}

/* ─── 封面 ─────────────────────────────────────────────────────── */
.ppt-deck .slide--cover .stage {
    height: 100%;
    position: relative;
}

.ppt-deck .cover-type {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    z-index: 1;
    pointer-events: none;
}

.ppt-deck .cover-media {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 3;
    height: 90%;
    width: auto;
    object-fit: contain;
}

.ppt-deck .cover-scrim {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 62%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.52) 46%, rgba(0, 0, 0, 0.88) 100%);
    z-index: 2;
    pointer-events: none;
}

.ppt-deck .cover-wordmark {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
}

.ppt-deck .cover-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--chrome-h) + var(--pill-float) + clamp(46px, 8%, 90px));
    text-align: center;
    z-index: 3;
    font-family: var(--font-mono);
    font-size: clamp(10px, 1.2vw, 13px);
    letter-spacing: 0.3em;
    color: var(--muted);
    text-transform: uppercase;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.ppt-deck .cover-hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--chrome-h) + var(--pill-float) + clamp(20px, 3.4%, 38px));
    text-align: center;
    z-index: 3;
    font-family: var(--font-mono);
    font-size: clamp(9px, 0.9vw, 11px);
    letter-spacing: 0.16em;
    color: var(--muted-2);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* ─── 底部 chrome：药丸形悬浮导航条 ────────────────────────────── */
.ppt-deck #chrome {
    position: fixed;
    left: 50%;
    bottom: var(--pill-float);
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.ppt-deck #brand {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.32em;
    color: var(--fg);
    white-space: nowrap;
    padding: 0 6px;
}

.ppt-deck .nav-arrow,
.ppt-deck .fs-btn {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--hairline);
    background: transparent;
    color: var(--fg);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}

.ppt-deck .nav-arrow:hover,
.ppt-deck .fs-btn:hover {
    background: var(--surface);
    border-color: rgba(255, 255, 255, 0.3);
}

.ppt-deck .nav-arrow:active,
.ppt-deck .fs-btn:active { transform: translateY(1px); }

.ppt-deck .nav-arrow:focus-visible,
.ppt-deck .fs-btn:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 2px;
}

.ppt-deck .nav-arrow:disabled {
    opacity: 0.28;
    cursor: default;
    background: transparent;
}

.ppt-deck .nav-arrow svg,
.ppt-deck .fs-btn svg {
    width: 16px;
    height: 16px;
}

.ppt-deck #btn-rotate.is-on {
    background: var(--surface);
    border-color: rgba(255, 255, 255, 0.45);
}

.ppt-deck #counter {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-right: 6px;
}

/* ─── 小屏适配 ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .ppt-deck .cover-media {
        height: 90%;
        width: auto;
    }

    .ppt-deck .cover-caption {
        bottom: calc(var(--chrome-h) + var(--pill-float) + clamp(38px, 7%, 64px));
    }
}

/* ─── 画面 90° 旋转：只旋转画报层，站点控件保持可点 ──────────── */
.ppt-deck.is-rotated {
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    width: 100vh;
    height: 100vw;
    transform: translateX(100vw) rotate(90deg);
    transform-origin: 0 0;
}

/* ─── 竖屏旋转提示弹窗 ───────────────────────────────────────── */
.ppt-deck #rotate-prompt {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.82);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}

.ppt-deck #rotate-prompt.show {
    opacity: 1;
    visibility: visible;
}

.ppt-deck .rp-box {
    text-align: center;
    color: var(--fg);
    padding: 24px;
    max-width: 320px;
}

.ppt-deck .rp-phone {
    width: 54px;
    height: 94px;
    margin: 0 auto 28px;
    border: 3px solid var(--fg);
    border-radius: 12px;
    position: relative;
    animation: pptRpRotate 2.6s ease-in-out infinite;
}

.ppt-deck .rp-phone::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 7px;
    width: 18px;
    height: 3px;
    border-radius: 2px;
    background: var(--fg);
    transform: translateX(-50%);
}

@keyframes pptRpRotate {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.ppt-deck .rp-title {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.2em;
}

.ppt-deck .rp-sub {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.ppt-deck .rp-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.ppt-deck .rp-btn {
    padding: 10px 26px;
    border-radius: 999px;
    background: transparent;
    color: var(--fg);
    font-size: 13px;
    letter-spacing: 0.14em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.ppt-deck .rp-btn:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 2px;
}

.ppt-deck .rp-rotate {
    border: 1px solid var(--fg);
    background: var(--fg);
    color: #000;
}

.ppt-deck .rp-rotate:hover { background: rgba(255, 255, 255, 0.85); }
.ppt-deck .rp-close { border: 1px solid var(--hairline); }

.ppt-deck .rp-close:hover {
    background: var(--surface);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ─── 禁 JS 兜底：可滚动的全部作品列表 ───────────────────────── */
.ppt-noscript {
    position: fixed;
    inset: 0;
    z-index: 120;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #000;
    color: #fff;
    padding: 5.5rem 1.5rem 3rem;
}

.ppt-noscript h2 {
    font-family: "Barlow", "Noto Sans SC", system-ui, sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    text-align: center;
}

.ppt-noscript-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 1.5rem;
}

.ppt-noscript figure { margin: 0; }

.ppt-noscript img {
    width: 100%;
    height: auto;
}

.ppt-noscript figcaption {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    line-height: 1.5;
}

/* ─── 减少动效 ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ppt-deck #deck { transition: none; }
    .ppt-deck.ppt-anim [data-anim],
    .ppt-deck.ppt-anim .work-img { opacity: 1; }

    .ppt-deck.ppt-anim .slide.is-active [data-anim],
    .ppt-deck.ppt-anim .slide.is-active .work-img { animation: none; }

    .ppt-deck .rp-phone { animation: none; }
}
