/* ============================================================
   PromptHub · AI 提示词库
   ============================================================ */
:root {
  --bg: #0b0f1a;
  --bg-soft: #111827;
  --card: #151c2e;
  --card-hover: #1b2438;
  --border: rgba(148, 163, 184, 0.14);
  --text: #e5eaf3;
  --text-dim: #8b94a7;
  --text-faint: #5b6475;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 背景光晕 */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 400px at 15% 10%, rgba(99, 102, 241, 0.16), transparent 60%),
    radial-gradient(700px 500px at 85% 20%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(500px 400px at 50% 100%, rgba(245, 158, 11, 0.06), transparent 60%);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 26, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-name span { color: var(--primary-2); }

/* 搜索框 */
.search-box {
  position: relative;
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 11px 72px 11px 42px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input::placeholder { color: var(--text-faint); }

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}

.search-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-faint);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  font-family: var(--mono);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn svg { width: 17px; height: 17px; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover { box-shadow: 0 6px 24px rgba(99, 102, 241, 0.55); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover { background: rgba(148, 163, 184, 0.08); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  padding: 9px 16px;
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
}

.btn-ghost.active { color: var(--accent); border-color: rgba(245, 158, 11, 0.35); }

.badge {
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
}

.badge-accent {
  background: rgba(245, 158, 11, 0.18);
  color: var(--accent);
}

/* ============ Hero ============ */
.main { padding-top: 40px; padding-bottom: 60px; }

.hero { text-align: center; padding: 30px 0 38px; }

.hero-title {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 14px;
}

.gradient-text {
  background: linear-gradient(120deg, #818cf8, #c084fc 55%, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-left: 8px;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 620px;
  margin: 0 auto 30px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.stat { display: flex; flex-direction: column; gap: 2px; }

.stat-num {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(120deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label { font-size: 12px; color: var(--text-faint); }

/* ============ 分类栏 ============ */
.category-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.category-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.chip {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
  user-select: none;
}

.chip:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
}

.chip.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.chip-count {
  font-size: 10px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: 1px;
}

.chip.active .chip-count {
  background: rgba(255, 255, 255, 0.2);
}

/* 二级分类栏 */
.subcategory-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: -10px;
  margin-bottom: 24px;
}

.subcategory-bar[hidden] {
  display: none;
}

.chip-sm {
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 600;
}

.result-count {
  font-size: 13px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ============ 提示词卡片 ============ */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.prompt-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
}

.prompt-card:hover {
  transform: translateY(-3px);
  background: var(--card-hover);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--shadow);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.2px;
}

.fav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  border-radius: 8px;
  transition: transform 0.15s;
  filter: grayscale(1) opacity(0.6);
}

.fav-btn:hover { transform: scale(1.15); filter: none; }

.fav-btn.active { filter: none; animation: pop 0.3s ease; }

@keyframes pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.card-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-preview {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  background: rgba(11, 15, 26, 0.6);
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
  max-height: 52px;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.card-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-2);
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
}

.card-copy:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

.card-copy svg { width: 14px; height: 14px; }

.card-views {
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 分类配色 */
.tag-writing { background: rgba(99, 102, 241, 0.16); color: #a5b4fc; }
.tag-coding { background: rgba(16, 185, 129, 0.14); color: #6ee7b7; }
.tag-marketing { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.tag-office { background: rgba(56, 189, 248, 0.14); color: #7dd3fc; }
.tag-study { background: rgba(244, 114, 182, 0.14); color: #f9a8d4; }
.tag-life { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; }
.tag-video { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }

/* 二级分类标签：虚线描边，区别于一级标签 */
.tag-sub {
  background: transparent;
  border: 1px dashed currentColor;
  opacity: 0.85;
}

/* ============ 空状态 ============ */
.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-dim);
}

.empty-icon { font-size: 44px; margin-bottom: 14px; }

.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }

.empty-state p { font-size: 14px; color: var(--text-faint); }

/* ============ 弹窗 ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 6, 12, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay[hidden] {
  display: none;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(148, 163, 184, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.18s;
  z-index: 2;
}

.modal-close:hover { color: var(--text); background: rgba(148, 163, 184, 0.2); }

.modal-close svg { width: 16px; height: 16px; }

.modal-body { padding: 30px 32px 20px; }

.modal-tags { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }

.modal-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  padding-right: 40px;
  margin-bottom: 10px;
}

.modal-desc { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin-bottom: 22px; }

.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.prompt-content {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: #c7d2fe;
  background: rgba(11, 15, 26, 0.7);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 22px;
  max-height: 320px;
  overflow-y: auto;
}

/* 完整示例：绿色系与提示词内容区分 */
.prompt-example {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text);
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius-sm);
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 22px;
  max-height: 340px;
  overflow-y: auto;
}

.modal-tip {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.75;
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin-bottom: 4px;
}

.modal-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  padding: 16px 32px;
  background: rgba(21, 28, 46, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  border-radius: 0 0 18px 18px;
}

.modal-footer .btn-primary { flex: 1; justify-content: center; }

.modal-footer .btn-outline { flex-shrink: 0; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: #1f2937;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .search-box { order: 3; flex-basis: 100%; max-width: none; }
  .hero-stats { gap: 24px; }
  .modal-body { padding: 24px 20px 16px; }
  .modal-footer { padding: 14px 20px; }
  .prompt-grid { grid-template-columns: 1fr; }
}
