/* ============================================================
   ppt-viewer.css — 网页版 PPT 阅览器（作品详情页 / 上传页共用）
   设计基准：作品详情页暖白体系（#fffaf2 底 / 白卡 / #f0e2cd 描边 / #d97706 强调）
   移动优先：320px 起可用，768px 起放大缩略图与按钮
   ============================================================ */

/* ---------- 区块外壳（详情页卡片，与 .pd-card 同风格） ---------- */
.deck-sec {
  margin: 18px 0;
  background: #fff;
  border: 1px solid #f0e2cd;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 18px 50px -30px rgba(0, 0, 0, .28);
}
.deck-sec-h {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin: 0 0 12px; font-size: 17px; font-weight: 800; color: #22160a; letter-spacing: -.2px;
}
.deck-sec-h .deck-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.deck-sec-h .deck-pages {
  margin-left: auto; font-size: 12.5px; font-weight: 600; color: #b45309;
  background: #fff5e6; border: 1px solid #fbe0bb; border-radius: 999px; padding: 3px 11px;
}
.deck-tip {
  margin: 0 0 12px; font-size: 12.5px; line-height: 1.7; color: #8a7a66;
}
.deck-tip b { color: #b45309; }
.deck-cap { margin: 8px 0 0; font-size: 13px; color: #8a7a66; line-height: 1.7; }

/* ---------- 组件根 ---------- */
.deck {
  --dk-line: #f0e2cd;
  --dk-line-soft: #f7efe2;
  --dk-bg: #f6f2ea;
  --dk-ink: #22160a;
  --dk-muted: #8a7a66;
  --dk-accent: #d97706;
  --dk-accent-soft: #fff5e6;
  border: 1px solid var(--dk-line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(180, 140, 90, .07);
  position: relative;
}
.deck + .deck { margin-top: 14px; }
.deck:focus-within { box-shadow: 0 0 0 3px rgba(245, 158, 11, .18), 0 2px 10px rgba(180, 140, 90, .07); }

/* ---------- 顶栏 ---------- */
.deck-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--dk-line-soft);
  background: #fffdf9; font-size: 12.5px; color: var(--dk-muted);
}
.deck-name {
  font-weight: 700; color: var(--dk-ink); font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52%;
}
.deck-badge {
  flex: none; font-size: 11.5px; font-weight: 700; color: #b45309;
  background: var(--dk-accent-soft); border: 1px solid #fbe0bb;
  border-radius: 999px; padding: 2px 8px; letter-spacing: .2px;
}
.deck-dl {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 600; color: #b45309; text-decoration: none;
  border: 1px solid #f3d9b5; border-radius: 999px; padding: 5px 12px; background: #fff;
  transition: background .15s, border-color .15s;
}
.deck-dl:hover { background: #fff5e6; border-color: #e9c294; }

/* ---------- 舞台（当前页） ---------- */
.deck-stage {
  position: relative; background: var(--dk-bg);
  display: flex; align-items: center; justify-content: center;
  min-height: 160px; overflow: hidden;
  touch-action: pan-y;
}
.deck-img {
  display: block; max-width: 100%; max-height: 72vh;
  width: auto; height: auto;
  background: #fff;
}

.deck-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .06);
  background: rgba(255, 255, 255, .8);
  color: #4b3a24; font-size: 22px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 10px rgba(60, 40, 10, .16);
  transition: background .15s, transform .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.deck-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.deck-arrow:active { transform: translateY(-50%) scale(.94); }
.deck-arrow:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 2px; }
.deck-prev { left: 10px; }
.deck-next { right: 10px; }

.deck-count {
  position: absolute; right: 10px; bottom: 10px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(24, 18, 10, .62); color: #fff;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  letter-spacing: .3px; pointer-events: none;
}

/* ---------- 工具条 ---------- */
.deck-tools {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-top: 1px solid var(--dk-line-soft); background: #fff;
}
.deck-btn {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--dk-line); background: #fff; color: #5a4a33;
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  border-radius: 9px; padding: 6px 11px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.deck-btn:hover { background: var(--dk-accent-soft); border-color: #eecda1; color: #b45309; }
.deck-btn:disabled { opacity: .4; cursor: default; }
.deck-btn:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 2px; }
.deck-btn .dk-ico { display: block; flex: none; }
.deck-track {
  flex: 1 1 auto; height: 4px; border-radius: 999px; background: #f3ece1; overflow: hidden; min-width: 40px;
}
.deck-track i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 999px; transition: width .18s ease;
}
.deck-fs { padding: 6px 9px; }

/* ---------- 缩略图条 ---------- */
.deck-thumbs {
  display: flex; gap: 8px; padding: 10px 12px 12px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--dk-line-soft); background: #fffdf9;
}
.deck-thumbs::-webkit-scrollbar { height: 6px; }
.deck-thumbs::-webkit-scrollbar-thumb { background: #ebdfcd; border-radius: 999px; }
.deck-th {
  flex: 0 0 auto; width: 92px; padding: 0; cursor: pointer;
  border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  background: #fff; line-height: 0; position: relative;
  transition: border-color .15s, transform .15s;
}
.deck-th img { display: block; width: 100%; height: auto; background: var(--dk-bg); }
.deck-th span {
  position: absolute; left: 4px; bottom: 4px; min-width: 16px;
  background: rgba(24, 18, 10, .6); color: #fff; font-size: 10px; line-height: 1.5;
  border-radius: 4px; padding: 0 4px; font-variant-numeric: tabular-nums;
}
.deck-th:hover { border-color: #eecda1; }
.deck-th[aria-selected="true"] { border-color: var(--dk-accent); box-shadow: 0 2px 8px rgba(217, 119, 6, .22); }
.deck-th:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 1px; }

/* ---------- 文字版（可搜索/可复制） ---------- */
.deck-text { border-top: 1px solid var(--dk-line-soft); background: #fff; }
.deck-text > summary {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 13px; font-size: 12.5px; font-weight: 600; color: var(--dk-muted);
  cursor: pointer; list-style: none; user-select: none;
}
.deck-text > summary::-webkit-details-marker { display: none; }
.deck-text > summary::before { content: '▸'; color: var(--dk-accent); font-size: 11px; }
.deck-text[open] > summary::before { content: '▾'; }
.deck-text > summary:hover { color: #b45309; }
.deck-txt-list {
  margin: 0; padding: 0 16px 14px; list-style: none;
  max-height: 320px; overflow-y: auto;
  font-size: 13.5px; line-height: 1.75; color: #4b5563;
}
.deck-txt-list li {
  display: flex; gap: 8px; padding: 6px 0; cursor: pointer;
  border-top: 1px dashed #f6eddd;
}
.deck-txt-list li:first-child { border-top: 0; }
.deck-txt-list li b {
  flex: none; color: #b45309; font-size: 12px; font-variant-numeric: tabular-nums;
  padding-top: 2px; min-width: 20px;
}
.deck-txt-list li .t { white-space: pre-line; word-break: break-word; }
.deck-txt-list li:hover .t { color: #22160a; }
.deck-txt-empty { padding: 0 16px 14px; margin: 0; font-size: 13px; color: #9ca3af; }

/* ---------- 加载 / 失败 ---------- */
.deck-loading {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 46px 16px; color: var(--dk-muted); font-size: 13.5px;
}
.deck-spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid #f0dfc6; border-top-color: var(--dk-accent);
  animation: deck-rot .8s linear infinite;
}
@keyframes deck-rot { to { transform: rotate(360deg); } }
.deck-err {
  padding: 26px 18px; text-align: center; color: var(--dk-muted); font-size: 13.5px; line-height: 1.8;
}
.deck-err a { color: #b45309; font-weight: 600; }
.deck-skel {
  aspect-ratio: 16 / 9; background: linear-gradient(100deg, #f7f2e9 30%, #fdfaf4 50%, #f7f2e9 70%);
  background-size: 220% 100%; animation: deck-shine 1.4s ease-in-out infinite;
}
@keyframes deck-shine { from { background-position: 130% 0; } to { background-position: -30% 0; } }

/* ---------- 全屏 ---------- */
.deck:fullscreen,
.deck.deck-fs-fallback {
  border: 0; border-radius: 0; background: #14100a;
  display: flex; flex-direction: column; justify-content: center;
  width: 100vw; height: 100vh; overflow: hidden;
}
/* 不支持 Fullscreen API 的浏览器（部分微信内置 WebView）用固定定位兜底 */
.deck.deck-fs-fallback { position: fixed; inset: 0; z-index: 9999; }
.deck:fullscreen .deck-head,
.deck.deck-fs-fallback .deck-head {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  background: linear-gradient(180deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
  border: 0; color: #e8dcc8; opacity: 0; transition: opacity .2s;
}
.deck:fullscreen:hover .deck-head,
.deck.deck-fs-fallback:hover .deck-head { opacity: 1; }
.deck:fullscreen .deck-name,
.deck.deck-fs-fallback .deck-name { color: #fff; }
.deck:fullscreen .deck-dl,
.deck.deck-fs-fallback .deck-dl { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: #fff; }
.deck:fullscreen .deck-stage,
.deck.deck-fs-fallback .deck-stage { background: #14100a; flex: 1 1 auto; min-height: 0; }
.deck:fullscreen .deck-img,
.deck.deck-fs-fallback .deck-img { max-height: calc(100vh - 150px); }
.deck:fullscreen .deck-thumbs,
.deck.deck-fs-fallback .deck-thumbs { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .08); }
.deck:fullscreen .deck-tools,
.deck.deck-fs-fallback .deck-tools { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .08); }
.deck:fullscreen .deck-btn,
.deck.deck-fs-fallback .deck-btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #f3ece1; }
.deck:fullscreen .deck-track,
.deck.deck-fs-fallback .deck-track { background: rgba(255, 255, 255, .16); }
.deck:fullscreen .deck-text,
.deck.deck-fs-fallback .deck-text { display: none; }

/* ---------- 响应式 ---------- */
@media (min-width: 768px) {
  .deck-arrow { width: 44px; height: 44px; font-size: 25px; }
  .deck-prev { left: 14px; }
  .deck-next { right: 14px; }
  .deck-th { width: 108px; }
  .deck-tip { font-size: 13px; }
}
@media (max-width: 420px) {
  .deck-arrow { width: 34px; height: 34px; font-size: 20px; background: rgba(255, 255, 255, .86); }
  .deck-prev { left: 6px; }
  .deck-next { right: 6px; }
  .deck-th { width: 76px; }
  .deck-tools { gap: 6px; padding: 8px 10px; }
  .deck-btn { padding: 6px 9px; font-size: 12px; }
  .deck-btn .dk-label { display: none; }
  .deck-img { max-height: 58vh; }
}

/* ---------- 无障碍 ---------- */
@media (prefers-reduced-motion: reduce) {
  .deck-img, .deck-th, .deck-arrow, .deck-track i, .deck-btn { transition: none !important; }
  .deck-skel { animation: none; }
  .deck-spin { animation-duration: 2s; }
}
.deck-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
