/* ============================================
   lanyamokuai.com - 蓝牙模块技术知识库
   ============================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-gray: #f9fafb;
  --border: #e5e7eb;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  color: var(--text);
  line-height: 1.7;
  background: var(--bg);
}

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.site-nav {
  display: flex;
  gap: 24px;
  list-style: none;
}
.site-nav a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--primary);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  padding: 60px 24px;
  text-align: center;
}
.hero h1 {
  font-size: 32px;
  margin-bottom: 12px;
}
.hero p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 24px;
}
.search-box {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  outline: none;
}
.search-box button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-dark);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 14px;
}

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

/* Hot Questions */
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}
.hot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}
.hot-card {
  background: var(--bg-gray);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s, transform 0.2s;
}
.hot-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.hot-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
}
.hot-card p {
  font-size: 13px;
  color: var(--text-light);
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}
.cat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
}
.cat-card:hover {
  box-shadow: var(--shadow);
}
.cat-card .cat-icon {
  font-size: 28px;
  margin-bottom: 8px;
}
.cat-card h3 {
  font-size: 17px;
  margin-bottom: 4px;
}
.cat-card .cat-count {
  font-size: 13px;
  color: var(--text-light);
}

/* Article List */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.article-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s;
}
.article-item:hover {
  box-shadow: var(--shadow);
}
.article-item h3 {
  font-size: 17px;
  margin-bottom: 6px;
}
.article-item p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 8px;
}
.article-meta {
  font-size: 12px;
  color: var(--text-light);
}

/* Article Detail */
.article-header {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 0;
}
.article-header h1 {
  font-size: 28px;
  margin-bottom: 12px;
}
.article-meta {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 24px;
}
.article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 40px;
}
.article-content h2 {
  font-size: 22px;
  margin: 32px 0 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.article-content h3 {
  font-size: 18px;
  margin: 24px 0 12px;
}
.article-content p {
  margin-bottom: 16px;
}
.article-content ul, .article-content ol {
  margin: 12px 0 16px 24px;
}
.article-content li {
  margin-bottom: 6px;
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.article-content th,
.article-content td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.article-content th {
  background: var(--bg-gray);
  font-weight: 600;
}
.article-content pre {
  background: #1f2937;
  color: #e5e7eb;
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  margin: 16px 0;
}
.article-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
}
.article-content pre code {
  background: none;
  padding: 0;
}
.article-content strong {
  font-weight: 600;
}
.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 8px 16px;
  margin: 16px 0;
  background: var(--bg-gray);
  color: var(--text-light);
}
.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* Breadcrumb */
.breadcrumb {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 24px;
  font-size: 13px;
  color: var(--text-light);
}
.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

/* Related */
.related {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 40px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.related h2 {
  font-size: 18px;
  margin-bottom: 12px;
}
.related-list {
  list-style: none;
}
.related-list li {
  margin-bottom: 8px;
}
.related-list a {
  color: var(--primary);
  text-decoration: none;
  font-size: 15px;
}
.related-list a:hover {
  text-decoration: underline;
}

/* CTA */
.cta {
  max-width: 800px;
  margin: 0 auto 40px;
  padding: 0 24px;
  text-align: center;
  padding: 20px;
  background: var(--bg-gray);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.cta p {
  color: var(--text-light);
  font-size: 14px;
}
.cta a {
  color: var(--primary);
  font-weight: 600;
}

/* Footer */
.site-footer {
  background: #1f2937;
  color: #9ca3af;
  padding: 32px 24px;
  text-align: center;
  font-size: 14px;
}
.site-footer a {
  color: #d1d5db;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 32px;
}
.pagination a,
.pagination span {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
}
.pagination span.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 12px 0; }
  .site-nav { gap: 16px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
  .hero h1 { font-size: 24px; }
  .hot-grid, .cat-grid { grid-template-columns: 1fr; }
}
