/* Prompt 工程进阶指南 - 样式表 */
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-code: #1e293b;
  --bg-prompt: #eff6ff;
  --text: #1e293b;
  --text-light: #64748b;
  --text-code: #e2e8f0;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --max-width: 1320px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-light); }

img { max-width: 100%; height: auto; }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  background: var(--primary-dark);
  color: #fff;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-logo { font-size: 1.25rem; font-weight: 700; color: #fff; }
.site-logo:hover { color: #fff; opacity: 0.9; }
.site-nav { display: flex; gap: 24px; flex-wrap: wrap; }
.site-nav a { color: rgba(255,255,255,0.85); font-size: 0.9rem; }
.site-nav a:hover { color: #fff; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 16px; font-weight: 800; }
.hero p { font-size: 1.2rem; opacity: 0.9; max-width: 700px; margin: 0 auto; }

/* Section */
.section { padding: 60px 0; }
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--primary-dark);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); }
.card-desc { color: var(--text-light); font-size: 0.9rem; line-height: 1.6; }
.card-meta { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Tags / Badges */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}
.tag-beginner { background: #dcfce7; color: #166534; }
.tag-intermediate { background: #fef3c7; color: #92400e; }
.tag-advanced { background: #fee2e2; color: #991b1b; }
.tag-category { background: #eff6ff; color: var(--primary); }

/* Filters */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Article Content */
.article { max-width: 860px; margin: 0 auto; padding: 48px 24px; }
.article h1 { font-size: 2rem; margin-bottom: 16px; color: var(--primary-dark); }
.article h2 { font-size: 1.4rem; margin: 32px 0 16px; color: var(--text); border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.article h3 { font-size: 1.15rem; margin: 24px 0 12px; }
.article p { margin-bottom: 16px; }
.article ul, .article ol { margin: 0 0 16px 24px; }
.article li { margin-bottom: 8px; }

/* Prompt Example Block */
.prompt-block {
  background: var(--bg-prompt);
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
  position: relative;
}
.prompt-block-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.prompt-block pre {
  background: transparent;
  padding: 0;
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
}

/* Code Block */
.code-block {
  background: var(--bg-code);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
  position: relative;
  overflow-x: auto;
}
.code-block pre {
  color: var(--text-code);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Copy Button */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: rgba(255,255,255,0.7);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.copy-btn.copied { background: var(--success); color: #fff; border-color: var(--success); }

.prompt-block .copy-btn {
  background: rgba(30,64,175,0.1);
  border-color: rgba(30,64,175,0.2);
  color: var(--primary);
}
.prompt-block .copy-btn:hover { background: rgba(30,64,175,0.2); }

/* Output Block */
.output-block {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
}
.output-block-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.output-block pre {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Tips & Pitfalls */
.tips-list, .pitfalls-list { list-style: none; margin-left: 0; padding: 0; }
.tips-list li, .pitfalls-list li { padding: 8px 0 8px 28px; position: relative; }
.tips-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.pitfalls-list li::before { content: "✗"; position: absolute; left: 0; color: var(--danger); font-weight: 700; }

/* Template Block */
.template-block {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
  position: relative;
}
.template-block-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.template-block pre {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Related Links */
.related-section { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.related-links { display: flex; gap: 12px; flex-wrap: wrap; }
.related-link {
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.related-link:hover { border-color: var(--primary); background: var(--bg-prompt); }

/* Footer */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 40px 0;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
.footer-col h4 { color: #fff; margin-bottom: 12px; font-size: 0.95rem; }
.footer-col a { color: rgba(255,255,255,0.7); display: block; margin-bottom: 8px; font-size: 0.85rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; font-size: 0.8rem; }

/* Breadcrumb */
.breadcrumb { padding: 12px 0; font-size: 0.85rem; color: var(--text-light); }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 8px; }

/* Responsive */
@media (max-width: 768px) {
  .hero { padding: 48px 0; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .site-nav { gap: 16px; }
  .section { padding: 40px 0; }
  .article { padding: 32px 16px; }
  .article h1 { font-size: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .site-header .container { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; }
  .filters { gap: 8px; }
  .filter-btn { padding: 4px 12px; font-size: 0.8rem; }
}
