/* ==========================================================================
 * PPT 专家 · 独立样式（老板板块）
 * --------------------------------------------------------------------------
 * 🔴 刻意**不写进 style.css**：那是全站共用文件、多个会话在并发改它。
 *    项目规矩：改别人的样式不动 style.css，新功能新建独立 css 并排在它之后加载。
 * 🔴 所有类名统一 pp- 前缀，避免与其它板块撞名（撞名 = 静默改坏别的页面）。
 * 🔴 容器凡是有 absolute 子元素的一律显式 position:relative —— 否则手机端
 *    会被内部装饰撑宽 document，整页被浏览器缩成 77%。
 * ========================================================================== */

.pp-root {
  --pp-bg: #f2f5fa;
  --pp-card: #ffffff;
  --pp-ink: #17223a;
  --pp-sub: #5c6e8a;
  --pp-line: #e1e8f2;
  --pp-brand: #1f4e79;
  --pp-accent: #2e7dd1;
  --pp-soft: #edf3fa;
  --pp-warn: #b4501f;
  --pp-ok: #1e6b4f;
  position: relative;
  background: var(--pp-bg);
  min-height: calc(100vh - 92px);
  padding: 12px 12px 96px;   /* 底部 96：fixed TabBar 实测 ~74px，留够不遮内容 */
  color: var(--pp-ink);
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
/* 🔴 必须写后代选择器：本文件里 .pp-stagebar 等是 display:flex，
 *    而 display:flex 会**盖掉** hidden 属性（元素照样显示）。
 *    只写 .pp-root[hidden] 不够，得让所有后代都吃这条规则。 */
.pp-root[hidden],
.pp-root [hidden] { display: none !important; }
.pp-root * { box-sizing: border-box; }
.pp-root button { font-family: inherit; cursor: pointer; }
.pp-root textarea, .pp-root input, .pp-root select { font-family: inherit; font-size: 14px; }

/* ---------------------------------------------------------------- 空状态 */
.pp-hero { padding: 6px 4px 14px; }
.pp-hero-ico {
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, #1f4e79, #2e7dd1);
  color: #fff; font-size: 22px; line-height: 46px; text-align: center;
  box-shadow: 0 6px 16px rgba(31, 78, 121, .26);
}
.pp-hero h2 { margin: 12px 0 6px; font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.pp-hero p { margin: 0; font-size: 13px; line-height: 1.66; color: var(--pp-sub); }
.pp-hero p b { color: var(--pp-ink); }

.pp-card {
  position: relative;
  background: var(--pp-card);
  border: 1px solid var(--pp-line);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(23, 34, 58, .05);
}

.pp-ta {
  width: 100%; min-height: 92px; max-height: 210px;
  border: none; outline: none; resize: none;
  font-size: 14.5px; line-height: 1.62; color: var(--pp-ink);
  background: transparent; padding: 2px 2px 0;
}
.pp-ta::placeholder { color: #9aa9bd; }

.pp-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--pp-line);
}
.pp-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px; border-radius: 9px; font-size: 12.5px;
  background: var(--pp-soft); color: var(--pp-brand);
  border: 1px solid #d5e3f3; white-space: nowrap;
}
.pp-chip:active { background: #e2ecf8; }
.pp-sel {
  padding: 7px 9px; border-radius: 9px; border: 1px solid #d5e3f3;
  background: var(--pp-soft); color: var(--pp-brand);
  font-size: 12.5px; outline: none;
  -webkit-appearance: none; appearance: none;
  background-image: none;
  max-width: 47%;
}
.pp-go {
  width: 100%; margin-top: 11px; padding: 13px;
  border: none; border-radius: 11px;
  background: linear-gradient(135deg, #1f4e79, #2b6cab);
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 1px;
  box-shadow: 0 5px 14px rgba(31, 78, 121, .24);
}
.pp-go:disabled { opacity: .55; box-shadow: none; }
.pp-go:active:not(:disabled) { transform: translateY(1px); }

.pp-eg { margin: 14px 2px 0; }
.pp-eg-t { font-size: 12px; color: var(--pp-sub); margin-bottom: 7px; }
.pp-eg-list { display: flex; flex-wrap: wrap; gap: 7px; }
.pp-eg-list button {
  padding: 7px 11px; border-radius: 999px; font-size: 12.5px;
  background: #fff; border: 1px solid var(--pp-line); color: #3d5470;
}
.pp-eg-list button:active { background: var(--pp-soft); }

/* 上传提示条 */
.pp-note {
  margin-top: 9px; padding: 9px 11px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.55;
  background: var(--pp-soft); color: var(--pp-brand); border: 1px solid #d5e3f3;
}
.pp-note.bad { background: #fdf1ea; color: var(--pp-warn); border-color: #f3d7c6; }
.pp-note.ok { background: #eaf6f0; color: var(--pp-ok); border-color: #cfe7dc; }

/* 已上传的资料清单 */
.pp-files { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.pp-file-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 9px;
  background: var(--pp-soft); font-size: 12.5px; color: var(--pp-brand);
}
.pp-file-item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-file-item i { font-style: normal; color: var(--pp-sub); flex: none; }
.pp-file-del {
  flex: none; margin-left: auto; border: none; background: transparent;
  color: #9aa9bd; font-size: 16px; line-height: 1; padding: 2px 4px;
}

/* ---------------------------------------------------------------- 生成中 / 舞台 */
.pp-stagebar {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; margin-bottom: 10px;
  background: #fff; border: 1px solid var(--pp-line); border-radius: 12px;
  font-size: 12.5px; color: var(--pp-brand);
}
.pp-spin {
  flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #cfe0f3; border-top-color: var(--pp-accent);
  animation: pp-spin .8s linear infinite;
}
@keyframes pp-spin { to { transform: rotate(360deg); } }
.pp-stagebar-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 舞台（预览区）：深色底衬托幻灯片，像真在放片 */
.pp-view {
  position: relative;
  background: #1b2433;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 8px 26px rgba(15, 25, 45, .18);
}
.pp-canvas {
  position: relative; width: 100%; overflow: hidden;
  border-radius: 7px; background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}
.pp-canvas .pps-stage { border-radius: 7px; }
.pp-fade { animation: pp-fade .32s ease; }
@keyframes pp-fade { from { opacity: .35; } to { opacity: 1; } }

.pp-pager {
  display: flex; align-items: center; gap: 10px;
  margin-top: 9px; color: #c8d6e8; font-size: 12.5px;
}
.pp-pager .pp-nav {
  width: 32px; height: 32px; border-radius: 9px; border: none;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 15px; line-height: 32px;
}
.pp-pager .pp-nav:disabled { opacity: .3; }
.pp-pager .pp-pos { flex: 1; text-align: center; font-variant-numeric: tabular-nums; }
.pp-pager .pp-full {
  border: none; background: rgba(255, 255, 255, .12); color: #fff;
  border-radius: 9px; padding: 7px 11px; font-size: 12px;
}

/* 缩略图横滑 */
.pp-thumbs {
  display: flex; gap: 8px; overflow-x: auto; padding: 11px 2px 4px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.pp-thumbs::-webkit-scrollbar { display: none; }
.pp-thumb {
  position: relative; flex: none; width: 86px;
  border: 2px solid transparent; border-radius: 7px;
  background: #fff; overflow: hidden; box-shadow: 0 1px 4px rgba(23, 34, 58, .13);
}
.pp-thumb.on { border-color: var(--pp-accent); box-shadow: 0 3px 12px rgba(46, 125, 209, .34); }
.pp-thumb-n {
  position: absolute; left: 3px; top: 3px; z-index: 2;
  min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 4px; background: rgba(15, 25, 45, .62); color: #fff;
  font-size: 9.5px; line-height: 15px; text-align: center;
}
.pp-thumb-b { position: relative; width: 86px; height: 48.4px; overflow: hidden; }
.pp-thumb.gen .pp-thumb-b::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(46,125,209,.28) 50%, rgba(255,255,255,0) 100%);
  animation: pp-shim 1.1s linear infinite;
}
@keyframes pp-shim { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* 操作按钮 */
.pp-acts { display: flex; gap: 9px; margin-top: 12px; }
.pp-btn {
  flex: 1; padding: 12px 6px; border-radius: 11px; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--pp-line); background: #fff; color: var(--pp-ink);
  white-space: nowrap;
}
.pp-btn.main {
  background: linear-gradient(135deg, #1f4e79, #2b6cab); color: #fff; border-color: transparent;
  box-shadow: 0 5px 14px rgba(31, 78, 121, .22);
}
.pp-btn:disabled { opacity: .5; }
.pp-btn:active:not(:disabled) { transform: translateY(1px); }

/* 改稿对话 */
.pp-chat {
  display: flex; gap: 8px; margin-top: 12px; align-items: flex-end;
  background: #fff; border: 1px solid var(--pp-line); border-radius: 12px; padding: 8px 9px;
}
.pp-chat input {
  flex: 1; min-width: 0; border: none; outline: none; padding: 7px 2px;
  font-size: 13.5px; background: transparent; color: var(--pp-ink);
}
.pp-chat input::placeholder { color: #9aa9bd; }
.pp-chat button {
  flex: none; padding: 9px 15px; border: none; border-radius: 9px;
  background: var(--pp-accent); color: #fff; font-size: 13.5px; font-weight: 600;
}
.pp-chat button:disabled { opacity: .5; }

/* 再做一份：低调的文字按钮，不能抢「下载 / 分享」的位置 */
.pp-again {
  width: 100%; margin-top: 10px; padding: 11px;
  border: 1px dashed var(--pp-line); border-radius: 11px;
  background: transparent; color: var(--pp-sub); font-size: 13px;
}
.pp-again:active { background: #fff; }

.pp-hints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.pp-hints button {
  padding: 6px 10px; border-radius: 999px; font-size: 12px;
  background: #fff; border: 1px solid var(--pp-line); color: #3d5470;
}

/* 改稿结果 */
.pp-log { margin-top: 11px; display: flex; flex-direction: column; gap: 7px; }
.pp-log-i {
  padding: 9px 11px; border-radius: 10px; font-size: 12.5px; line-height: 1.55;
  background: #fff; border: 1px solid var(--pp-line); color: var(--pp-sub);
}
.pp-log-i b { color: var(--pp-ink); font-weight: 600; }
.pp-log-i.ok { background: #eaf6f0; border-color: #cfe7dc; color: var(--pp-ok); }
.pp-log-i.warn { background: #fdf1ea; border-color: #f3d7c6; color: var(--pp-warn); }

/* 全屏放映 */
.pp-fs {
  position: fixed; inset: 0; z-index: 9999;
  background: #0d1420; display: flex; align-items: center; justify-content: center;
}
.pp-fs-in { width: 100%; max-height: 100vh; overflow: auto; padding: 8px; }
.pp-fs-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10000;
  display: flex; align-items: center; gap: 12px; justify-content: center;
  padding: 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .62));
  color: #fff; font-size: 13px;
}
.pp-fs-bar button {
  border: none; background: rgba(255, 255, 255, .16); color: #fff;
  border-radius: 9px; padding: 8px 13px; font-size: 13px;
}
.pp-fs-x { position: fixed; right: 12px; top: 12px; z-index: 10001; }

/* 场景/篇幅说明 */
.pp-tip { margin: 9px 2px 0; font-size: 12px; color: var(--pp-sub); line-height: 1.6; }

@media (min-width: 720px) {
  .pp-root { padding: 18px 18px 96px; max-width: 880px; margin: 0 auto; }
  .pp-hero h2 { font-size: 22px; }
  .pp-thumb, .pp-thumb-b { width: 116px; }
  .pp-thumb-b { height: 65.2px; }
}


/* ==========================================================================
 * 分享面板
 * --------------------------------------------------------------------------
 * 🔴 它挂在 document.body 上（不在 .pp-root 里），所以**不能引用 --pp-* 变量**
 *    —— 那些变量定义在 .pp-root 作用域内，取不到就是空值，颜色会变黑。
 *    所以这里全部写死颜色（取值与 .pp-root 的一致）。
 * 🔴 存在的理由：只靠剪贴板自动复制，在微信内置浏览器里会**静默失败**，
 *    用户粘出来的是上一次剪贴板的内容（用户实测：粘出来是一张图片的地址）。
 *    链接必须**看得见、选得中、长按能复制**，这是底线。
 * ========================================================================== */
.pp-sheet {
  position: fixed; inset: 0; z-index: 10002;
  display: flex; align-items: flex-end; justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.pp-sheet-mask { position: absolute; inset: 0; background: rgba(11, 20, 34, .55); }
.pp-sheet-box {
  position: relative; width: 100%; max-width: 540px; background: #fff;
  border-radius: 18px 18px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 44px rgba(0, 0, 0, .3);
  animation: ppSheetUp .22s ease-out;
}
@keyframes ppSheetUp { from { transform: translateY(26px); opacity: .55; } to { transform: none; opacity: 1; } }
.pp-sheet-t { font-size: 17px; font-weight: 700; color: #17223a; }
.pp-sheet-d { font-size: 13px; color: #5c6e8a; margin-top: 7px; line-height: 1.6; }
.pp-sheet-url {
  display: block; width: 100%; margin-top: 14px; padding: 12px 13px;
  font-size: 13px; font-family: inherit; line-height: 1.5;
  color: #17223a; background: #f4f7fb; border: 1px solid #e1e8f2; border-radius: 11px;
  -webkit-user-select: all; user-select: all; word-break: break-all;
}
.pp-sheet-url:focus { outline: 2px solid #2e7dd1; outline-offset: 1px; }
.pp-sheet-copy {
  display: block; width: 100%; margin-top: 12px; padding: 13px;
  border: none; border-radius: 11px; font-size: 15px; font-weight: 600; font-family: inherit;
  color: #fff; background: linear-gradient(135deg, #1f4e79, #2b6cab);
  box-shadow: 0 5px 14px rgba(31, 78, 121, .22);
}
.pp-sheet-copy:active { opacity: .88; }
.pp-sheet-hint { font-size: 12px; color: #5c6e8a; margin-top: 10px; line-height: 1.55; }
.pp-sheet-warn {
  font-size: 12px; color: #8a4b12; background: #fff7ea;
  border: 1px solid #f6dfbb; border-radius: 10px; padding: 9px 11px; margin-top: 10px; line-height: 1.55;
}
.pp-sheet-close {
  display: block; width: 100%; margin-top: 11px; padding: 12px;
  border: 1px solid #e1e8f2; border-radius: 11px; background: #fff;
  color: #5c6e8a; font-size: 14px; font-family: inherit;
}
@media (min-width: 620px) {
  .pp-sheet { align-items: center; }
  .pp-sheet-box { border-radius: 18px; }
}


/* ==========================================================================
 * 最近生成（历史记录）
 * --------------------------------------------------------------------------
 * 用户的原话：「没有历史生成记录，我一返回就没了，应该历史记录才对」。
 * 放在空状态的输入卡**下面** —— 用户一进这个功能就先看到"我以前做过什么"，
 * 而不是先面对一个空白输入框。
 * ========================================================================== */
.pp-hist { margin: 0 0 14px; }
.pp-hist-t {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 3px 9px; font-size: 13.5px; font-weight: 600; color: var(--pp-ink);
}
.pp-hist-n { font-weight: 400; font-size: 12px; color: var(--pp-sub); }
.pp-hist-list { display: flex; flex-direction: column; gap: 8px; }
.pp-hist-item { display: flex; align-items: stretch; gap: 7px; }
.pp-hist-open {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px;
  padding: 11px 13px; text-align: left; font-family: inherit;
  border: 1px solid var(--pp-line); border-radius: 11px; background: #fff;
}
.pp-hist-open:active { background: var(--pp-soft); }
.pp-hist-name {
  font-size: 13.5px; font-weight: 600; color: var(--pp-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-hist-meta { font-size: 11.5px; color: var(--pp-sub); }
.pp-hist-del {
  flex: none; width: 40px; border-radius: 11px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--pp-line); background: #fff; color: #9aa8ba;
}
.pp-hist-del:active { background: #fdeceb; color: #b23a2e; border-color: #f3cfcb; }
