/* ===== 试卷转换助手 · 使用指南弹窗 =====
   结构见 guide.html：顶（标题）/ 中（可滚动内容）/ 底（标语 + 滑出按钮）
   高度 = 浏览器可视高度 70%，居中；内容滚到底时底部按钮滑出 */

.ptw-guide-overlay[hidden] { display: none !important; }

.ptw-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: ptw-guide-fade 0.22s ease both;
}

.ptw-guide {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(760px, 92vw);
  height: 70vh;
  min-height: 360px;
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24), 0 2px 8px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  animation: ptw-guide-pop 0.26s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

/* 顶：标题 */
.ptw-guide-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(180deg, #fbfdff, #ffffff);
}

.ptw-guide-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ptw-guide-x {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 9px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.ptw-guide-x:hover { background: #e2e8f0; color: #0f172a; }

/* 中：内容（唯一滚动区） */
.ptw-guide-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 26px 22px;
  color: #334155;
  font-size: 14px;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.ptw-guide-body::-webkit-scrollbar { width: 8px; }
.ptw-guide-body::-webkit-scrollbar-track { background: transparent; }
.ptw-guide-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
  border: 2px solid #fff;
}
.ptw-guide-body::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 内容块样式（从原指南 HTML 迁移，统一加 .guide- 前缀避免污染全局） */
.guide-notice {
  background: #f1f5f9;
  border-left: 4px solid #3b82f6;
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  color: #475569;
  margin-bottom: 14px;
}

.guide-points {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  color: #475569;
  margin-bottom: 18px;
}

.guide-h3 {
  display: flex;
  align-items: center;
  margin: 22px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.guide-h3::before {
  content: "";
  flex: 0 0 auto;
  display: inline-block;
  width: 4px;
  height: 15px;
  background: #3b82f6;
  border-radius: 2px;
  margin-right: 8px;
}

.guide-p { margin: 14px 0 8px; color: #1e293b; }

.guide-ul { margin: 0 0 10px; padding-left: 20px; }
.guide-ul li { margin-bottom: 7px; }

.guide-hl { color: #3b82f6; font-weight: 500; }

.guide-code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}

/* 底：标语 + 滑出按钮（整行水平居中） */
.ptw-guide-foot {
  flex: 0 0 auto;
  padding: 13px 24px 16px;
  border-top: 1px solid #eef2f7;
  background: #fff;
}

.ptw-guide-foot-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 38px;
}

.ptw-guide-thanks {
  font-size: 13px;
  font-style: italic;
  color: #94a3b8;
  white-space: nowrap;
}

/* 初始：0 宽、透明、右侧偏移 → 滚到底时划出 */
.ptw-guide-ok {
  flex: 0 0 auto;
  max-width: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transform: translateX(12px);
  pointer-events: none;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: max-width 0.34s cubic-bezier(0.22, 0.9, 0.3, 1),
              padding 0.34s cubic-bezier(0.22, 0.9, 0.3, 1),
              opacity 0.28s ease, transform 0.34s cubic-bezier(0.22, 0.9, 0.3, 1),
              box-shadow 0.2s ease;
}

.ptw-guide-foot.is-end .ptw-guide-ok {
  max-width: 240px;
  padding: 9px 18px;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.ptw-guide-foot.is-end .ptw-guide-ok:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.ptw-guide-ok:active { transform: translateX(0) scale(0.97); }

@keyframes ptw-guide-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ptw-guide-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 手机：更贴边的边距、标题缩小 */
@media (max-width: 640px) {
  .ptw-guide-overlay { padding: 10px; }
  .ptw-guide { width: 100%; height: 70vh; border-radius: 14px; }
  .ptw-guide-head { padding: 14px 16px; }
  .ptw-guide-title { font-size: 16px; }
  .ptw-guide-body { padding: 16px 18px 18px; font-size: 13.5px; }
  .ptw-guide-foot { padding: 11px 16px 14px; }
  .ptw-guide-foot-inner { gap: 8px; flex-wrap: wrap; row-gap: 8px; }
  .ptw-guide-thanks { font-size: 12px; white-space: normal; text-align: center; line-height: 1.5; }
  .ptw-guide-ok { font-size: 13px; }
  .ptw-guide-foot.is-end .ptw-guide-ok { padding: 8px 14px; }
}

/* ===== 工作台状态栏里的「查看使用指南」入口 ===== */
.status-guide {
  flex: 0 0 auto;
  pointer-events: auto;   /* .statusbar 整体 pointer-events:none，这里单独放开 */
  margin-left: 6px;
  color: #3b82f6;
  font-size: 12px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s ease, opacity 0.16s ease;
}

.status-guide:hover { color: #1d4ed8; text-decoration: underline; }
