/* 基础样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* 主内容区 */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* 顶部导航 */
.site-header {
  background: white;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #333;
  font-weight: 700;
  font-size: 20px;
}

.logo-icon {
  font-size: 24px;
}

.nav-menu {
  display: flex;
  gap: 8px;
  flex: 1;
}

.nav-item {
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: #666;
  font-size: 14px;
  transition: all 0.2s;
}

.nav-item:hover {
  background: #f5f5f5;
  color: #333;
}

.nav-item.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
}

/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  background: #f5f7fa;
  border-radius: 8px;
  padding: 4px;
}

.search-input {
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 14px;
  width: 200px;
  outline: none;
}

.search-btn {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
}

/* Banner */
.banner-ad {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 40px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.banner-ad h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.banner-ad p {
  opacity: 0.9;
}

.banner-ad .btn {
  background: white;
  color: #667eea;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

/* 广告位 */
.ad-banner {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.ad-item {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 14px 20px;
  border-radius: 10px;
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.ad-icon {
  font-size: 18px;
}

.ad-text {
  font-size: 13px;
  font-weight: 500;
}

/* 推荐内容区块 */
.recommend-section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.more-link {
  color: #6366f1;
  text-decoration: none;
  font-size: 14px;
}

/* 内容布局 */
.content-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
}

.sidebar-left {
  position: sticky;
  top: 100px;
  align-self: start;
}

/* 卡片 */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-weight: 600;
  font-size: 16px;
}

.content-card {
  min-height: 400px;
}

/* 二级分类列表 */
.subcategory-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subcategory-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s;
}

.subcategory-item:hover {
  background: #f5f5f5;
}

.subcategory-item.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
}

.sub-icon {
  font-size: 18px;
}

.sub-name {
  font-size: 14px;
  font-weight: 500;
}

/* 工具网格 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}

.tool-card-wrapper {
  display: block;
}

.tool-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  border: 1px solid #f0f0f0;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.tool-info {
  flex: 1;
  min-width: 0;
}

.tool-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.tool-desc {
  font-size: 13px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

/* 详情页 */
.detail-page {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.breadcrumb {
  margin-bottom: 24px;
  font-size: 14px;
  color: #666;
}

.breadcrumb a {
  color: #6366f1;
  text-decoration: none;
}

.breadcrumb span {
  margin: 0 8px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f0f0;
}

.detail-icon {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
}

.detail-title {
  flex: 1;
}

.detail-title h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.detail-title p {
  color: #666;
  margin-bottom: 12px;
}

.detail-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: #f5f7fa;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: #666;
}

.visit-btn {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.detail-section {
  margin-bottom: 32px;
}

.detail-section h2 {
  font-size: 20px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
}

.intro-content {
  line-height: 1.8;
  color: #444;
}

.feature-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.feature-list li {
  padding: 12px 16px;
  background: #f5f7fa;
  border-radius: 8px;
}

.feature-list li::before {
  content: "✓ ";
  color: #6366f1;
  font-weight: bold;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.pricing-card {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.plan-name {
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 24px;
  font-weight: 700;
  color: #6366f1;
  margin-bottom: 16px;
}

.plan-features {
  list-style: none;
  font-size: 13px;
  color: #666;
}

.plan-features li {
  padding: 4px 0;
}

.detail-links {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.link-btn {
  padding: 10px 20px;
  background: #f5f7fa;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s;
}

.link-btn:hover {
  background: #e8eaed;
}

.back-link {
  margin-top: 24px;
}

.back-link a {
  color: #6366f1;
  text-decoration: none;
}

/* 文章页 */
.article-page {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f0f0;
}

.article-header h1 {
  font-size: 32px;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  gap: 8px;
}

.article-intro {
  padding: 20px;
  background: #f5f7fa;
  border-radius: 8px;
  margin-bottom: 24px;
  border-left: 4px solid #6366f1;
}

.article-body {
  line-height: 1.8;
}

.article-body h1, .article-body h2, .article-body h3 {
  margin: 24px 0 12px;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body code {
  background: #f5f7fa;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.article-body pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}

.article-body blockquote {
  border-left: 4px solid #6366f1;
  padding-left: 16px;
  margin: 16px 0;
  color: #666;
}

/* 搜索弹窗 */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  z-index: 1000;
}

.search-modal-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 70vh;
  overflow: hidden;
}

.search-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-modal-header h3 {
  font-size: 16px;
}

.search-close {
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.search-results-list {
  padding: 16px;
  max-height: 50vh;
  overflow-y: auto;
}

.search-result-item {
  display: block;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 8px;
}

.search-result-item:hover {
  background: #f5f7fa;
}

.result-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.result-name mark {
  background: #fef3c7;
  padding: 0 2px;
}

.result-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}

.result-category {
  font-size: 12px;
  color: #999;
}

.result-count {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

.search-empty {
  text-align: center;
  padding: 40px;
  color: #666;
}

.search-empty .tip {
  font-size: 13px;
  color: #999;
  margin-top: 8px;
}

/* 页脚 */
.site-footer {
  background: white;
  padding: 24px;
  text-align: center;
  color: #666;
  margin-top: 40px;
  border-top: 1px solid #f0f0f0;
}

/* 响应式 */
@media (max-width: 768px) {
  .content-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-left {
    position: static;
  }

  .subcategory-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .subcategory-item {
    padding: 8px 14px;
  }

  .detail-header {
    flex-direction: column;
  }

  .visit-btn {
    margin-left: 0;
    margin-top: 16px;
    text-align: center;
  }

  .header-container {
    flex-wrap: wrap;
    gap: 16px;
  }

  .nav-menu {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .search-box {
    flex: 1;
  }

  .search-input {
    width: 100%;
  }
}
