/* PDF 工具 —— 子页 / 通用组件样式。
 * 在 layout.css 之后加载，接管 PDF 工具专属外观（紫粉渐变背景、返回栏、
 * 白色内容卡片、上传区、文件列表、进度条、结果卡片）。所有子页复用。
 */

:root {
  --pt-gradient: linear-gradient(135deg, #f3eafe 0%, #fde8f5 35%, #fde8e8 70%, #fef3e8 100%);
}

/* 紫粉渐变背景 —— 覆盖 layout.css 的灰色 canvas 与 hero 渐变 */
body.pdf-tool-body { background: var(--pt-gradient) fixed; }
body.pdf-tool-body .app > .main { background: transparent; }

.hidden { display: none !important; }

/* ============ 顶部返回栏（子页用，毛玻璃 sticky） ============ */
.pdf-tool-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 13px 36px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}
.pt-back {
  font-size: 13.5px; color: var(--text-secondary); text-decoration: none;
  padding: 6px 12px; border-radius: 8px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.pt-back:hover { background: rgba(0, 0, 0, 0.05); color: var(--text-primary); }
.pt-titlebox { display: flex; align-items: baseline; gap: 10px; flex: 1; min-width: 0; }
.pt-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.pt-subtitle { font-size: 12.5px; color: var(--text-tertiary); }
.pt-actions { display: flex; gap: 8px; }

.pdf-tool-content { padding-top: 26px; max-width: 940px; }

/* ============ 白色内容卡片 ============ */
.pt-card {
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  margin-bottom: 18px;
}
.pt-card h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--text-primary); }
.pt-card-desc { font-size: 12.5px; color: var(--text-tertiary); margin-bottom: 16px; line-height: 1.6; }

/* ============ 上传拖拽区 ============ */
.pt-drop {
  border: 1.5px dashed rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  padding: 40px 20px; text-align: center;
  color: var(--text-secondary); cursor: pointer;
  transition: .15s; background: rgba(0, 0, 0, 0.012);
}
.pt-drop:hover, .pt-drop.over {
  border-color: var(--accent); background: rgba(0, 113, 227, 0.06); color: var(--accent);
}
.pt-drop-ico { font-size: 34px; margin-bottom: 8px; }
.pt-drop-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }

/* ============ 文件列表 ============ */
.pt-filelist { list-style: none; margin: 16px 0 0; padding: 0; }
.pt-filelist li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; font-size: 13px;
  border: 0.5px solid rgba(0, 0, 0, 0.07); border-radius: 10px; margin-bottom: 6px;
  background: #fff;
}
.pt-fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-fst { font-size: 12px; white-space: nowrap; }
.pt-fst.wait  { color: var(--text-tertiary); }
.pt-fst.doing { color: var(--warning); }
.pt-fst.ok    { color: var(--success); }
.pt-fst.err   { color: var(--danger); white-space: normal; word-break: break-word; }

/* ============ 操作行 + 按钮 ============ */
.pt-actions-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.pt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 510;
  border: none; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: rgba(0, 0, 0, 0.05); color: var(--text-primary);
  transition: background .15s, transform .12s;
}
.pt-btn:hover:not(:disabled) { background: rgba(0, 0, 0, 0.09); }
.pt-btn:active:not(:disabled) { transform: scale(0.97); }
.pt-btn-primary { background: var(--accent); color: #fff; }
.pt-btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.pt-btn:disabled { opacity: .45; cursor: not-allowed; }
.pt-btn-sm { padding: 4px 11px; font-size: 12px; }
.pt-status { font-size: 12px; color: var(--text-tertiary); }
.pt-input {
  border: 0.5px solid rgba(0, 0, 0, 0.14); border-radius: 8px;
  padding: 7px 11px; font-size: 13px; font-family: inherit;
}

/* ============ 本地处理记录 ============ */
.pt-history { margin: 22px 0 8px; border-top: 0.5px solid rgba(0, 0, 0, 0.1); padding-top: 14px; }
.pt-history-head { display:flex; justify-content:space-between; align-items:center; font-size:13px; font-weight:600; color:var(--text-secondary); }
.pt-history-clear { border:0; background:transparent; color:var(--text-tertiary); font:inherit; font-size:12px; cursor:pointer; padding:4px; }
.pt-history-list { display:flex; flex-direction:column; gap:6px; margin-top:10px; }
.pt-history-item { display:flex; align-items:center; gap:10px; padding:9px 10px; background:rgba(255,255,255,.68); border:0.5px solid rgba(0,0,0,.08); border-radius:8px; font-size:12px; }
.pt-history-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-primary); }
.pt-history-time { color:var(--text-tertiary); white-space:nowrap; }
.pt-history-download { border:0; background:transparent; color:var(--accent); cursor:pointer; font:inherit; font-size:12px; padding:3px; }
.pt-history-empty { font-size:12px; color:var(--text-tertiary); padding:8px 0; }

/* ============ 图片缩略图网格 ============ */
.pt-imggrid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pt-imgcard {
  width: 132px; border: 0.5px solid rgba(0, 0, 0, 0.07); border-radius: 10px;
  overflow: hidden; background: #fff; cursor: grab; position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.pt-imgcard.dragging { opacity: .4; }
.pt-imgcard.drag-over { outline: 2px solid var(--accent); }
.pt-imgcard .pt-thumb {
  width: 132px; height: 150px; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.04); overflow: hidden;
}
.pt-imgcard .pt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pt-imgcard .pt-thumb .pt-ph { font-size: 11px; color: var(--text-tertiary); text-align: center; padding: 8px; }
.pt-imgcard .pt-imgbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 7px; font-size: 11px;
  background: rgba(0, 0, 0, 0.02); border-top: 0.5px solid rgba(0, 0, 0, 0.06);
}
.pt-imgcard .pt-ord {
  background: var(--accent); color: #fff; border-radius: 50%;
  width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 11px;
}
.pt-mini {
  background: rgba(0, 0, 0, 0.06); color: var(--text-secondary);
  padding: 2px 7px; font-size: 11px; border-radius: 5px; cursor: pointer;
  margin-left: 4px;
}
.pt-mini:hover { background: rgba(0, 0, 0, 0.12); }
.pt-mini.del { background: rgba(255, 59, 48, 0.12); color: var(--danger); }
.pt-mini.del:hover { background: rgba(255, 59, 48, 0.20); }

/* ============ 进度条（阶段 2+ SSE 工具用） ============ */
.pt-progress { margin-top: 18px; }
.pt-progress.hidden { display: none; }
.pt-progress-bar {
  height: 10px; background: rgba(0, 0, 0, 0.08);
  border-radius: 999px; overflow: hidden;
}
.pt-progress-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: var(--accent); transition: width .35s ease;
}
.pt-progress-text { font-size: 12.5px; color: var(--text-secondary); margin-top: 8px; }

/* ============ 结果卡片（阶段 2+ 用） ============ */
.pt-result { margin-top: 18px; }
.pt-result.hidden { display: none; }

/* ============ 「建设中」占位页 ============ */
.pt-building { text-align: center; padding: 56px 28px; }
.pt-building-icon {
  width: 76px; height: 76px; margin: 0 auto 20px;
  border-radius: 20px; display: flex; align-items: center; justify-content: center;
  color: var(--accent); background: rgba(0, 113, 227, 0.08);
}
.pt-building-title { font-size: 19px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; }
.pt-building-desc { font-size: 13.5px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 22px; }
.pt-building-desc a { color: var(--accent); text-decoration: none; }
.pt-building-desc a:hover { text-decoration: underline; }
