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

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2333;
  --bg-card-hover: #242d3d;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #58a6ff;
  --accent-green: #3fb950;
  --accent-orange: #d29922;
  --accent-red: #f85149;
  --accent-purple: #bc8cff;
  --accent-cyan: #39d2c0;
  --accent-pink: #f778ba;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Header ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(22, 27, 34, 0.92);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.logo:hover {
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-count {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ===== Main Content ===== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* ===== Hero Section ===== */
.hero {
  text-align: center;
  padding: 40px 0 32px;
}

.hero h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 20px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hero-tags .tag-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}

.hero-tags .tag-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88, 166, 255, 0.08);
}

.hero-tags .tag-btn.active {
  border-color: var(--accent);
  color: #fff;
  background: rgba(88, 166, 255, 0.15);
}

/* ===== Search Bar ===== */
.search-bar {
  position: relative;
  max-width: 480px;
  margin: 0 auto 32px;
}

.search-bar input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

.search-bar input:focus {
  border-color: var(--accent);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding-bottom: 48px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all .25s ease;
  cursor: pointer;
  position: relative;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(88, 166, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.tag-direct-injection { background: rgba(248, 81, 73, 0.15); color: var(--accent-red); }
.tag-indirect-injection { background: rgba(57, 210, 192, 0.15); color: var(--accent-cyan); }
.tag-prompt-leaking { background: rgba(188, 140, 255, 0.15); color: var(--accent-purple); }
.tag-jailbreak { background: rgba(210, 153, 34, 0.15); color: var(--accent-orange); }
.tag-encoding-bypass { background: rgba(88, 166, 255, 0.15); color: var(--accent); }
.tag-context-manipulation { background: rgba(247, 120, 186, 0.15); color: var(--accent-pink); }
.tag-risk-control { background: rgba(248, 81, 73, 0.15); color: var(--accent-red); }
.tag-language-bypass { background: rgba(63, 185, 80, 0.15); color: var(--accent-green); }
.tag-semantic-bypass { background: rgba(210, 153, 34, 0.2); color: var(--accent-orange); }
.tag-multi-modal-injection { background: rgba(247, 120, 186, 0.15); color: var(--accent-pink); }

.tag-default { background: rgba(139, 148, 158, 0.2); color: var(--text-secondary); }

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.card-brief {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  flex: 1;
}

.card-preview {
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 48px;
  position: relative;
}

.card-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(transparent, var(--bg-primary));
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-category {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-arrow {
  color: var(--text-muted);
  font-size: 14px;
  transition: transform .2s;
}

.card:hover .card-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 15px;
}

/* ===== Detail Page ===== */
.detail-view {
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 60px;
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.detail-breadcrumb a {
  color: var(--text-secondary);
}

.detail-breadcrumb a:hover {
  color: var(--accent);
}

.detail-header {
  margin-bottom: 28px;
}

.detail-header .card-tags {
  margin-bottom: 12px;
}

.detail-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.detail-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 12px;
  line-height: 1.7;
}

.detail-prompt-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.detail-prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88, 166, 255, 0.08);
}

.copy-btn.copied {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.detail-prompt-body {
  padding: 20px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  background: var(--bg-primary);
}

.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.info-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.info-value {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.detail-url-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 32px;
}

.detail-url-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.url-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.url-display {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13px;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #79c0ff;
}

.btn-primary.copied {
  background: var(--accent-green);
}

.detail-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.detail-back-link:hover {
  color: var(--accent);
}

.detail-scenario-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

.scenario-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.scenario-value {
  font-size: 14px;
  color: var(--text-primary);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-inner {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .main-content {
    padding: 16px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero p {
    font-size: 14px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .detail-info-grid {
    grid-template-columns: 1fr;
  }

  .url-copy-row {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-title {
    font-size: 20px;
  }

  .btn-primary {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .header-count {
    display: none;
  }

  .hero {
    padding: 24px 0 20px;
  }

  .card {
    padding: 16px;
  }
}

/* ===== Loading / Transition ===== */
.fade-in {
  animation: fadeIn .3s ease;
}

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