/* ===== AI实用指南 主样式 ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(99,102,241,.06);
  --shadow-hover: 0 4px 12px rgba(99,102,241,.18);
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-logo {
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: 8px 16px 8px 40px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  background: var(--bg-soft);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.header-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  background: #fff;
}
.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}
.header-nav { display: flex; gap: 8px; }
.header-nav a {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-muted);
  transition: all .2s;
}
.header-nav a:hover { background: var(--bg-soft); color: var(--primary); }
.header-cta {
  padding: 7px 18px !important;
  background: var(--gradient) !important;
  color: #fff !important;
  border-radius: 20px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  white-space: nowrap;
  transition: opacity .2s, transform .2s !important;
}
.header-cta:hover { opacity: .9; transform: translateY(-1px); }

/* ===== Hero区域 ===== */
.hero {
  background: linear-gradient(160deg, #f0f4ff 0%, #faf5ff 50%, #f0fdff 100%);
  padding: 56px 24px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, rgba(99,102,241,.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 20px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
}
.hero h1 span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 32px;
}
.hero-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.hero-search input {
  width: 100%;
  padding: 14px 56px 14px 20px;
  border: 2px solid var(--border);
  border-radius: 32px;
  font-size: 15px;
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.hero-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}
.hero-search button {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px;
  background: var(--gradient);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  transition: transform .2s, opacity .2s;
}
.hero-search button:hover { transform: translateY(-50%) scale(1.05); }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 22px; font-weight: 800; color: var(--primary); }
.hero-stat span { font-size: 12px; color: var(--text-muted); }

/* ===== 关键词导航区 ===== */
.keywords-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-more {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color .2s;
}
.section-more:hover { color: var(--primary); }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.category-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.category-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.category-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.category-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.category-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.keyword-tag {
  display: inline-block;
  padding: 5px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text);
  transition: all .2s;
  cursor: pointer;
}
.keyword-tag:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}

/* 分类颜色 */
.cat-ai-tools .category-icon { background: #eff6ff; }
.cat-ai-code .category-icon { background: #f0fdf4; }
.cat-enterprise .category-icon { background: #fdf4ff; }
.cat-compare .category-icon { background: #fff7ed; }
.cat-news .category-icon { background: #f0fdfa; }

/* ===== 最新文章区 ===== */
.latest-section {
  background: var(--bg-soft);
  padding: 48px 24px;
}
.latest-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.post-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all .2s;
}
.post-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.post-card-cat {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
  background: rgba(99,102,241,.1);
  color: var(--primary);
}
.post-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}
.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}
.post-card-read {
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
}

/* ===== CTA横幅 ===== */
.cta-banner {
  background: var(--gradient);
  padding: 48px 24px;
  text-align: center;
  color: #fff;
}
.cta-banner h2 {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 800;
  margin-bottom: 12px;
}
.cta-banner p {
  font-size: 16px;
  opacity: .85;
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-white {
  padding: 12px 28px;
  background: #fff;
  color: var(--primary);
  border-radius: 28px;
  font-weight: 700;
  font-size: 15px;
  transition: transform .2s, box-shadow .2s;
  border: none;
  cursor: pointer;
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.15); color: var(--primary); }
.btn-outline-white {
  padding: 12px 28px;
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,.6);
  border-radius: 28px;
  font-weight: 600;
  font-size: 15px;
  transition: all .2s;
}
.btn-outline-white:hover { background: rgba(255,255,255,.15); border-color: #fff; color: #fff; }

/* ===== 页脚 ===== */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 40px 24px 24px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid #1e293b;
}
.footer-brand .site-logo { font-size: 20px; display: block; margin-bottom: 10px; }
.footer-brand p { font-size: 13px; line-height: 1.6; max-width: 280px; }
.footer-col h4 { color: #e2e8f0; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 13px; color: #94a3b8; transition: color .2s; }
.footer-col ul li a:hover { color: #e2e8f0; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  font-size: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== 文章页 ===== */
.article-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
}
.article-header { margin-bottom: 28px; }
.article-cat {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(99,102,241,.1);
  color: var(--primary);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}
.article-title {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
}
.article-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.article-content {
  font-size: 16px;
  line-height: 1.8;
  color: #1e293b;
}
.article-content h2 { font-size: 22px; font-weight: 700; margin: 32px 0 14px; color: var(--text); }
.article-content h3 { font-size: 18px; font-weight: 600; margin: 24px 0 10px; color: var(--text); }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { padding-left: 24px; margin-bottom: 16px; }
.article-content li { margin-bottom: 6px; }
.article-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Fira Code', monospace;
}
.article-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 20px;
}
.article-content pre code { background: none; padding: 0; color: inherit; }
.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  background: #f8fafc;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 20px;
  color: var(--text-muted);
}
.article-content table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.article-content th { background: var(--bg-soft); padding: 10px 14px; text-align: left; font-weight: 600; border: 1px solid var(--border); }
.article-content td { padding: 10px 14px; border: 1px solid var(--border); }
.article-content tr:hover td { background: #f8fafc; }

/* FAQ样式 */
.faq-section { margin: 32px 0; }
.faq-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-question {
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-soft);
  transition: background .2s;
}
.faq-question:hover { background: #f1f5f9; }
.faq-answer { padding: 14px 18px; font-size: 14px; color: var(--text-muted); line-height: 1.7; display: none; }
.faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-question { background: rgba(99,102,241,.06); color: var(--primary); }

/* 文章内CTA */
.article-cta {
  background: linear-gradient(135deg, #f0f4ff, #faf5ff);
  border: 1.5px solid rgba(99,102,241,.2);
  border-radius: var(--radius);
  padding: 24px;
  margin: 32px 0;
  text-align: center;
}
.article-cta h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.article-cta p { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }
.btn-primary {
  display: inline-block;
  padding: 10px 24px;
  background: var(--gradient);
  color: #fff;
  border-radius: 24px;
  font-weight: 600;
  font-size: 14px;
  transition: opacity .2s, transform .2s;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); color: #fff; }

/* 侧边栏 */
.sidebar-widget {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.sidebar-widget h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.sidebar-post { display: flex; gap: 10px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.sidebar-post:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sidebar-post-title { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text); }
.sidebar-post-title:hover { color: var(--primary); }
.sidebar-post-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== 搜索结果 ===== */
#search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 200;
  max-height: 360px;
  overflow-y: auto;
  display: none;
}
#search-results.show { display: block; }
.search-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-soft); }
.search-result-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.search-result-excerpt { font-size: 12px; color: var(--text-muted); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .hero { padding: 40px 16px 32px; }
  .category-grid { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 24px; }
  .article-layout { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  .keywords-section, .latest-section { padding: 32px 16px; }
}
@media (max-width: 480px) {
  .header-inner { gap: 12px; }
  .header-search { max-width: none; }
  .hero h1 { font-size: 24px; }
}
