/* ============================================================
   Prompt Hub · AIGC 提示词库
   设计系统：B 端规范风格（清爽、专业、克制）
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  /* 主色 */
  --c-primary: #4f46e5;
  --c-primary-hover: #4338ca;
  --c-primary-soft: #eef2ff;

  /* 分类色 */
  --c-text: #2563eb;
  --c-text-soft: #eff6ff;
  --c-image: #db2777;
  --c-image-soft: #fdf2f8;
  --c-video: #ea580c;
  --c-video-soft: #fff7ed;
  --c-agent: #059669;
  --c-agent-soft: #ecfdf5;

  /* 中性色 */
  --c-bg: #f6f7f9;
  --c-surface: #ffffff;
  --c-border: #e8eaed;
  --c-border-strong: #d1d5db;
  --c-text-1: #1f2329;   /* 标题 */
  --c-text-2: #4e5969;   /* 正文 */
  --c-text-3: #86909c;   /* 次要 */
  --c-text-4: #c9cdd4;   /* 占位 */

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.12);

  /* 圆角 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* 间距 */
  --header-h: 64px;
  --content-max: 1280px;
}

/* ---------- 重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text-1);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }
pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

/* ---------- 顶部导航 ---------- */
.app-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--content-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c-primary), #7c3aed);
  color: #fff; font-size: 20px;
  border-radius: var(--r-md);
  box-shadow: 0 2px 8px rgba(79,70,229,.35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; color: var(--c-text-1); }
.brand-text small { font-size: 11px; color: var(--c-text-3); }

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav a {
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--c-text-2);
  transition: all .15s;
  white-space: nowrap;
}
.main-nav a:hover { background: var(--c-bg); color: var(--c-text-1); }
.main-nav a.active { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.search-box {
  position: relative;
  display: flex; align-items: center;
  width: 280px;
}
.search-box .search-icon {
  position: absolute; left: 12px;
  font-size: 14px; opacity: .5;
  pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 36px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-bg);
  font-size: 13px;
  color: var(--c-text-1);
  transition: all .15s;
}
.search-box input:focus {
  outline: none;
  border-color: var(--c-primary);
  background: var(--c-surface);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.search-kbd {
  position: absolute; right: 10px;
  font-size: 11px; color: var(--c-text-3);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ---------- 主区域 ---------- */
.app-main { max-width: var(--content-max); margin: 0 auto; padding: 32px 24px 64px; }

/* ---------- 首页 Hero ---------- */
.hero {
  text-align: center;
  padding: 40px 0 48px;
}
.hero h1 {
  font-size: 36px; font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -.5px;
  background: linear-gradient(135deg, var(--c-text), var(--c-image), var(--c-video));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 16px; color: var(--c-text-2);
  max-width: 640px; margin: 0 auto;
}
.hero-stats {
  display: flex; justify-content: center; gap: 40px;
  margin-top: 28px;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 28px; color: var(--c-primary); }
.hero-stat span { font-size: 12px; color: var(--c-text-3); }

/* ---------- 分类卡片网格 ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 16px;
}
.cat-card {
  position: relative;
  padding: 28px 24px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: all .2s;
  overflow: hidden;
  cursor: pointer;
}
.cat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--cat-color);
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--cat-color);
}
.cat-card .cat-icon {
  font-size: 40px; display: block; margin-bottom: 14px;
}
.cat-card h3 { font-size: 18px; margin: 0 0 6px; }
.cat-card .cat-desc { font-size: 13px; color: var(--c-text-3); margin: 0 0 16px; min-height: 38px; }
.cat-card .cat-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; border-top: 1px solid var(--c-border);
}
.cat-card .cat-count { font-size: 13px; color: var(--c-text-2); }
.cat-card .cat-count strong { color: var(--cat-color); font-size: 18px; }
.cat-card .cat-go { color: var(--cat-color); font-size: 13px; font-weight: 600; }

/* ---------- 分类页头部 ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 24px;
}
.page-head .ph-left h1 { font-size: 26px; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.page-head .ph-left p { margin: 0; color: var(--c-text-3); font-size: 14px; }
.page-head .ph-right { display: flex; align-items: center; gap: 12px; }

.result-count { font-size: 13px; color: var(--c-text-3); }
.result-count strong { color: var(--c-text-1); }

/* ---------- 筛选区 ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--c-border);
}
.filter-label { font-size: 13px; color: var(--c-text-3); margin-right: 4px; flex-shrink: 0; }
.chip {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  font-size: 13px;
  color: var(--c-text-2);
  transition: all .15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--c-primary); color: var(--c-primary); }
.chip.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  font-weight: 500;
}
.chip .chip-count { opacity: .65; margin-left: 4px; font-size: 11px; }

.sort-select {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  font-size: 13px;
  color: var(--c-text-2);
  cursor: pointer;
}
.sort-select:focus { outline: none; border-color: var(--c-primary); }

/* ---------- 提示词卡片网格 ---------- */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}
.prompt-card {
  display: flex; flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: all .18s;
  overflow: hidden;
}
.prompt-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--c-border-strong);
  transform: translateY(-2px);
}
.prompt-card.is-fav { border-color: #fbbf24; }

.pc-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 18px 0;
}
.pc-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 22px;
  border-radius: var(--r-md);
  background: var(--cat-soft);
}
.pc-title-wrap { flex: 1; min-width: 0; }
.pc-title {
  font-size: 15px; font-weight: 600; margin: 2px 0 4px;
  color: var(--c-text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pc-sub {
  font-size: 12px; color: var(--c-text-3);
}
.fav-btn {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--c-text-4);
  font-size: 16px;
  transition: all .15s;
}
.fav-btn:hover { background: #fffbeb; color: #f59e0b; }
.fav-btn.on { color: #f59e0b; }

.pc-body { padding: 12px 18px 14px; flex: 1; }
.pc-desc {
  font-size: 13px; color: var(--c-text-2);
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--c-bg);
  color: var(--c-text-3);
}
.pc-tag.has-var { background: #fffbeb; color: #b45309; }

.pc-prompt {
  margin: 12px 18px 0;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--c-text-3);
  line-height: 1.55;
  max-height: 84px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  word-break: break-word;
  position: relative;
}
.pc-prompt-lang {
  position: absolute; top: 6px; right: 8px;
  font-size: 10px; color: var(--c-text-4);
  background: var(--c-surface);
  padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--c-border);
}
.pc-prompt-zh {
  margin: 8px 18px 0;
  padding: 10px 12px;
  background: var(--cat-soft);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--cat-color);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--c-text-2);
  line-height: 1.6;
  max-height: 76px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  word-break: break-word;
}
.pc-clickable { cursor: pointer; }
.pc-clickable:hover .pc-title { color: var(--cat-color); }
.pc-detail-link {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--c-primary); font-weight: 500;
}

/* 卡片内 GLM 运行结果 */
.pc-result {
  margin: 8px 18px 0;
  padding: 10px 12px;
  background: linear-gradient(135deg, #f0fdf4, #ecfeff);
  border: 1px solid #bbf7d0;
  border-radius: var(--r-sm);
  font-size: 12px; line-height: 1.6;
  color: var(--c-text-2);
  max-height: 92px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  word-break: break-word;
}
.pc-result-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600;
  color: #047857; background: #d1fae5;
  padding: 1px 7px; border-radius: 3px;
  margin-bottom: 4px;
}
.pc-result-text { white-space: pre-wrap; }

/* 卡片内生成媒体（图片/视频） */
.pc-media {
  position: relative;
  margin: 8px 18px 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  cursor: pointer;
}
.pc-media img, .pc-media video {
  display: block; width: 100%; height: 150px; object-fit: cover;
}
.pc-media-badge {
  position: absolute; top: 6px; left: 6px;
  font-size: 10px; font-weight: 600; color: #047857;
  background: rgba(209,250,229,.95); padding: 2px 7px; border-radius: 3px;
  backdrop-filter: blur(2px);
}
.pc-media video { pointer-events: none; }
.pc-media:hover video { }

.pc-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  margin-top: 14px;
  border-top: 1px solid var(--c-border);
  background: #fafbfc;
}
.pc-source { font-size: 11px; color: var(--c-text-4); }
.pc-actions { display: flex; gap: 6px; }
.pc-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  transition: all .15s;
}
.pc-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.pc-btn.primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.pc-btn.primary:hover { background: var(--c-primary-hover); }

/* ---------- 加载更多 / 空状态 ---------- */
.load-more-wrap { text-align: center; margin-top: 36px; }
.btn-load-more {
  padding: 10px 32px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface);
  font-size: 14px; color: var(--c-text-2);
  transition: all .15s;
}
.btn-load-more:hover { border-color: var(--c-primary); color: var(--c-primary); }

.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--c-text-3);
}
.empty .empty-icon { font-size: 56px; margin-bottom: 16px; opacity: .4; }
.empty p { margin: 4px 0; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(31,35,41,.55);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .15s ease;
}
.modal-mask[hidden] { display: none; }
.modal {
  width: 100%; max-width: 680px;
  max-height: 88vh;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: pop .18s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--c-border);
}
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  font-size: 16px; color: var(--c-text-3);
}
.modal-close:hover { background: var(--c-bg); color: var(--c-text-1); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-vars { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.var-field { display: flex; flex-direction: column; gap: 6px; }
.var-field label { font-size: 13px; font-weight: 600; color: var(--c-text-1); }
.var-field label .var-name {
  display: inline-block;
  background: #fffbeb; color: #b45309;
  padding: 1px 8px; border-radius: 4px; font-size: 12px;
  font-family: monospace; margin-left: 6px;
}
.var-field input, .var-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--c-text-1);
  background: var(--c-surface);
  resize: vertical;
}
.var-field input:focus, .var-field textarea:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.var-field small { font-size: 11px; color: var(--c-text-4); }
.modal-preview-label {
  font-size: 12px; font-weight: 600; color: var(--c-text-2);
  margin-bottom: 8px;
}
.modal-preview {
  margin: 0;
  padding: 14px 16px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--r-md);
  font-size: 13px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  max-height: 280px; overflow-y: auto;
}
.modal-preview .hl { background: rgba(245,158,11,.35); border-radius: 3px; padding: 1px 3px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--c-border);
}
.modal-no-vars { color: var(--c-text-3); font-size: 13px; text-align: center; padding: 12px 0; }

/* ---------- 按钮 ---------- */
.btn {
  height: 38px; padding: 0 18px;
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-hover); }
.btn-ghost { background: var(--c-surface); color: var(--c-text-2); border: 1px solid var(--c-border); }
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 300;
  background: #1f2329;
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all .25s;
  pointer-events: none;
}
.toast[hidden] { display: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .toast-icon { margin-right: 6px; }

/* ---------- 页脚 ---------- */
.app-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  font-size: 12px; color: var(--c-text-3);
}
.footer-source { color: var(--c-text-4); }

/* ---------- 分类色注入 ---------- */
[data-cat="text"]  { --cat-color: var(--c-text);  --cat-soft: var(--c-text-soft); }
[data-cat="image"] { --cat-color: var(--c-image); --cat-soft: var(--c-image-soft); }
[data-cat="video"] { --cat-color: var(--c-video); --cat-soft: var(--c-video-soft); }
[data-cat="agent"] { --cat-color: var(--c-agent); --cat-soft: var(--c-agent-soft); }

/* ---------- 动画 ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.prompt-card { animation: slideUp .25s ease backwards; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 详情页 ---------- */
.detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--c-text-3);
  margin-bottom: 20px; padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  transition: all .15s;
}
.detail-back:hover { border-color: var(--c-primary); color: var(--c-primary); }

.detail-head {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 24px; background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  margin-bottom: 20px;
}
.detail-head .dh-icon {
  width: 64px; height: 64px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 32px;
  border-radius: var(--r-md); background: var(--cat-soft);
}
.detail-head .dh-info { flex: 1; min-width: 0; }
.detail-head .dh-cat {
  font-size: 12px; color: var(--cat-color); font-weight: 600;
  margin-bottom: 6px;
}
.detail-head h1 { font-size: 24px; margin: 0 0 8px; }
.detail-head .dh-desc { color: var(--c-text-2); margin: 0 0 14px; }
.detail-head .dh-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-head .dh-tag {
  font-size: 12px; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--c-bg); color: var(--c-text-2);
}
.detail-head .dh-tag.var { background: #fffbeb; color: #b45309; }
.detail-head .dh-fav {
  flex-shrink: 0; width: 40px; height: 40px;
  display: grid; place-items: center; font-size: 20px;
  border-radius: var(--r-sm); color: var(--c-text-4);
  border: 1px solid var(--c-border);
}
.detail-head .dh-fav.on { color: #f59e0b; background: #fffbeb; border-color: #fcd34d; }

.detail-section {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.detail-section h2 {
  font-size: 15px; margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
  color: var(--c-text-1);
}
.detail-section h2 .sec-badge {
  font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 4px;
  background: var(--c-bg); color: var(--c-text-3);
}
.prompt-full {
  margin: 0; padding: 16px 18px;
  background: #0f172a; color: #e2e8f0;
  border-radius: var(--r-md);
  font-size: 13.5px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
  max-height: 420px; overflow-y: auto;
}
.prompt-full .hl { background: rgba(245,158,11,.35); border-radius: 3px; padding: 1px 3px; }
.prompt-zh-full {
  margin: 0; padding: 16px 18px;
  background: var(--cat-soft);
  border-left: 4px solid var(--cat-color);
  border-radius: var(--r-md);
  font-size: 14px; line-height: 1.85;
  white-space: pre-wrap; word-break: break-word;
  color: var(--c-text-1);
}
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* 详情页生成媒体 */
.detail-media {
  border-radius: var(--r-md); overflow: hidden;
  background: #0f172a; border: 1px solid var(--c-border);
}
.detail-media img { display: block; width: 100%; max-height: 600px; object-fit: contain; }
.detail-media video { display: block; width: 100%; max-height: 560px; background: #000; }

.var-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.var-chip {
  font-family: monospace; font-size: 12px;
  padding: 4px 10px; border-radius: var(--r-sm);
  background: #fffbeb; color: #b45309;
  border: 1px solid #fde68a;
}

/* ---------- 执行面板 ---------- */
.exec-hint {
  font-size: 12px; color: var(--c-text-3);
  background: var(--c-primary-soft);
  border-radius: var(--r-sm);
  padding: 8px 12px; margin-bottom: 14px;
  display: flex; gap: 8px; align-items: flex-start;
}
.exec-config { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.exec-config .cfg-full { grid-column: 1 / -1; }
.cfg-field { display: flex; flex-direction: column; gap: 4px; }
.cfg-field label { font-size: 12px; color: var(--c-text-2); font-weight: 500; }
.cfg-field input, .cfg-field textarea, .cfg-field select {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--c-border); border-radius: var(--r-sm);
  font-size: 13px; color: var(--c-text-1); background: var(--c-surface);
  font-family: inherit;
}
.cfg-field input:focus, .cfg-field textarea:focus, .cfg-field select:focus {
  outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.cfg-field textarea { resize: vertical; min-height: 60px; }
.cfg-save-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cfg-saved-tip { font-size: 12px; color: var(--c-agent); }
.exec-run-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.exec-status { font-size: 12px; color: var(--c-text-3); }
.exec-status.error { color: #dc2626; }
.exec-status.ok { color: var(--c-agent); }
.btn-run {
  height: 40px; padding: 0 22px;
  border-radius: var(--r-sm); font-size: 14px; font-weight: 600;
  background: var(--c-primary); color: #fff;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .15s;
}
.btn-run:hover { background: var(--c-primary-hover); }
.btn-run:disabled { background: var(--c-text-4); cursor: not-allowed; }
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.exec-result {
  margin-top: 4px; padding: 16px 18px;
  background: #f8fafc; border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: 13.5px; line-height: 1.75; color: var(--c-text-1);
  white-space: pre-wrap; word-break: break-word;
  min-height: 60px;
}
.exec-result.empty { color: var(--c-text-4); text-align: center; display: grid; place-items: center; }
.exec-result-meta { font-size: 11px; color: var(--c-text-4); margin-top: 10px; text-align: right; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .search-box { width: 200px; }
  .header-inner { gap: 16px; }
  .main-nav { gap: 2px; }
  .main-nav a { padding: 7px 10px; font-size: 13px; }
}
@media (max-width: 720px) {
  .header-inner { padding: 0 14px; gap: 10px; flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; }
  .app-header { height: auto; }
  .brand-text { display: none; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .header-actions { flex: 1; }
  .search-box { width: 100%; }
  .search-kbd { display: none; }
  .hero h1 { font-size: 26px; }
  .hero-stats { gap: 24px; }
  .app-main { padding: 20px 14px 48px; }
  .prompt-grid { grid-template-columns: 1fr; }
  .page-head .ph-left h1 { font-size: 22px; }
  .detail-head { flex-direction: column; }
  .exec-config { grid-template-columns: 1fr; }
  .detail-head .dh-fav { position: absolute; }
}
