/* ======================================================
   Prompt 详情页 — prompt-detail.css   (.pd-* 前缀)
   ====================================================== */

/* ── 页面容器 ── */
.pd-page {
  background: var(--bg, #f8f9fb);
  min-height: 80vh;
  padding: 24px 0 72px;
  font-family: 'Noto Sans SC', 'PingFang SC', system-ui, sans-serif;
  color: var(--text, #1a1d2e);
}
.pd-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── 面包屑 ── */
.pd-bread {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text3, #9499b0);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.pd-bread a {
  color: var(--text3, #9499b0);
  text-decoration: none;
  transition: color .15s;
}
.pd-bread a:hover { color: var(--blue, #3b7ef6); }
.pd-bread > span:last-child { color: var(--text2, #5a5e72); }
.pd-bread-sep { opacity: .4; }

/* ── 布局：左 + 右 ── */
.pd-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

/* ── 通用卡片 ── */
.pd-card {
  background: var(--bg2, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.07));
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}
.pd-card:last-child { margin-bottom: 0; }

/* ── Section 标签 ── */
.pd-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3, #9499b0);
  margin-bottom: 14px;
}

/* ══════════════════════════════
   左栏 — 头部卡片
══════════════════════════════ */

/* 标签行 */
.pd-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pd-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pd-tag-cat  { background: #ede9fe; color: #6d28d9; }
.pd-tag-dom  { background: #d1fae5; color: #065f46; }
.pd-tag-extra { background: #fce7f3; color: #9d174d; }
.pd-tag-free { background: var(--bg3, #f0f2f5); color: var(--text2, #5a5e72); border: 1px solid var(--border, rgba(0,0,0,.07)); }

/* 标题 / 描述 */
.pd-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text, #1a1d2e);
  margin: 0 0 10px;
  line-height: 1.3;
  letter-spacing: -.3px;
}
.pd-desc {
  font-size: 14px;
  color: var(--text2, #5a5e72);
  line-height: 1.7;
  margin: 0 0 18px;
}

/* 元信息行 */
.pd-meta-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.pd-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text3, #9499b0);
}

/* ══════════════════════════════
   左栏 — PROMPT 模板
══════════════════════════════ */
.pd-prompt-body {
  background: #f7f5f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
}
.pd-prompt-text {
  font-size: 14px;
  line-height: 1.85;
  color: var(--text, #1a1d2e);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 变量高亮 pill */
.pd-var-tag {
  display: inline-block;
  padding: 1px 8px;
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  font-family: 'Noto Sans SC', system-ui, sans-serif;
}

/* 操作按钮 */
.pd-actions {
  display: flex;
  gap: 10px;
}
.pd-btn-copy,
.pd-btn-trial {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  font-family: inherit;
}
.pd-btn-copy {
  flex: 1;
  justify-content: center;
  background: var(--text, #1a1d2e);
  color: #fff;
  border: none;
}
.pd-btn-copy:hover { opacity: .85; }
.pd-btn-copy.pd-copied { background: #10b981; }

.pd-btn-trial {
  flex: 1;
  justify-content: center;
  background: transparent;
  color: var(--text, #1a1d2e);
  border: 1px solid var(--border2, rgba(0,0,0,.13));
}
.pd-btn-trial:hover {
  border-color: var(--blue, #3b7ef6);
  color: var(--blue, #3b7ef6);
}

/* ══════════════════════════════
   左栏 — 变量说明
══════════════════════════════ */
.pd-vars-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pd-var-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.pd-var-tag-sm {
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 1px;
}
.pd-var-desc {
  font-size: 13px;
  color: var(--text2, #5a5e72);
  line-height: 1.6;
}

/* ══════════════════════════════
   左栏 — 示例效果（折叠）
══════════════════════════════ */
.pd-card-collapse {
  padding: 0;
  overflow: hidden;
}
.pd-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2, #5a5e72);
  font-family: inherit;
  text-align: left;
}
.pd-collapse-btn:hover { color: var(--text, #1a1d2e); }
.pd-collapse-icon {
  transition: transform .2s;
  flex-shrink: 0;
}
.pd-card-collapse.open .pd-collapse-icon { transform: rotate(180deg); }

.pd-collapse-body {
  display: none;
  padding: 0 24px 24px;
  border-top: 1px solid var(--border, rgba(0,0,0,.07));
}
.pd-card-collapse.open .pd-collapse-body { display: block; }

.pd-example-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text3, #9499b0);
  margin: 16px 0 8px;
}
.pd-example-label:first-child { margin-top: 16px; }

.pd-example-box {
  background: var(--bg, #f8f9fb);
  border: 1px solid var(--border, rgba(0,0,0,.07));
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text, #1a1d2e);
  line-height: 1.7;
}
.pd-example-output {
  background: #f0fff8;
  border-color: rgba(16,185,129,.18);
}

/* ══════════════════════════════
   左栏 — 投票
══════════════════════════════ */
.pd-card-vote .pd-section-label { margin-bottom: 16px; }
.pd-vote-row {
  display: flex;
  gap: 10px;
}
.pd-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border, rgba(0,0,0,.10));
  background: transparent;
  color: var(--text2, #5a5e72);
  font-family: inherit;
  transition: all .15s;
}
.pd-vote-btn:hover:not(:disabled) { background: var(--bg, #f8f9fb); color: var(--text, #1a1d2e); }
.pd-vote-btn:disabled { opacity: .5; cursor: default; }
.pd-vote-up.pd-voted  { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.pd-vote-down.pd-voted { background: #fff7ed; border-color: #fcd34d; color: #b45309; }
.pd-vote-count { font-weight: 400; color: var(--text3, #9499b0); font-size: 13px; }
.pd-vote-thanks { margin-top: 12px; font-size: 13px; color: #10b981; text-align: center; }

/* ══════════════════════════════
   右栏 — 数据统计
══════════════════════════════ */
.pd-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pd-stat {
  background: var(--bg3, #f0f2f5);
  border-radius: 12px;
  padding: 14px 16px;
}
.pd-stat-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--text, #1a1d2e);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -.5px;
}
.pd-stat-label {
  font-size: 11px;
  color: var(--text3, #9499b0);
}

/* ══════════════════════════════
   右栏 — 适配 AI 工具
══════════════════════════════ */
.pd-ai-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pd-ai-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.pd-ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pd-ai-name {
  flex: 1;
  font-weight: 500;
  color: var(--text, #1a1d2e);
}
.pd-ai-status {
  font-size: 12px;
  color: var(--text3, #9499b0);
}

/* ══════════════════════════════
   右栏 — 相关 PROMPT
══════════════════════════════ */
.pd-related-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pd-related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg, #f8f9fb);
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .15s;
}
.pd-related-item:hover {
  border-color: var(--border, rgba(0,0,0,.10));
  background: var(--bg2, #fff);
}
.pd-related-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.pd-related-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1a1d2e);
  margin-bottom: 2px;
  line-height: 1.3;
}
.pd-related-cat {
  font-size: 11px;
  color: var(--text3, #9499b0);
}

/* ══════════════════════════════
   响应式
══════════════════════════════ */
@media (max-width: 900px) {
  .pd-layout { grid-template-columns: 1fr; }
  .pd-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .pd-sidebar .pd-card { margin-bottom: 0; }
}
@media (max-width: 640px) {
  .pd-wrap { padding: 0 16px; }
  .pd-sidebar { grid-template-columns: 1fr; }
  .pd-title { font-size: 20px; }
  .pd-actions { flex-direction: column; }
  .pd-vote-btn { font-size: 13px; padding: 10px 12px; }
  .pd-stats-grid { grid-template-columns: 1fr 1fr; }
}
