/* AI建站评测站 - 专业现代风格 CSS */

/* ========== 变量 ========== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #0ea5e9;
  --accent: #f97316;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 8px;
  --max-w: 1200px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

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

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* ========== 头部 ========== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

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

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

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.main-nav a {
  padding: 6px 14px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 15px;
  transition: all 0.2s;
}

.main-nav a:hover, .main-nav a.active {
  background: var(--primary);
  color: #fff;
}

.search-box {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}

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

.search-box button {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
}

/* ========== 主体布局 ========== */
.main-content {
  max-width: var(--max-w);
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

/* ========== 文章卡片 ========== */
.article-list {
  display: grid;
  gap: 20px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-card .card-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.article-card .card-meta span {
  margin-right: 12px;
}

.article-card h2 {
  font-size: 18px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.article-card h2 a { color: var(--text); }
.article-card h2 a:hover { color: var(--primary); }

.article-card .summary {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag {
  display: inline-block;
  background: #eff6ff;
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  margin-right: 6px;
}

/* ========== 工具卡片 ========== */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: var(--shadow);
  transition: box-shadow 0.2s;
}

.tool-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.tool-card img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  margin-bottom: 10px;
  object-fit: cover;
}

.tool-card h3 { font-size: 15px; margin-bottom: 6px; }

.tool-card .rating {
  color: #f59e0b;
  font-size: 14px;
  margin-bottom: 8px;
}

.tool-card .commission {
  font-size: 12px;
  color: #16a34a;
  background: #f0fdf4;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ========== 侧边栏 ========== */
.sidebar { }
.sidebar .widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.sidebar .widget h3 {
  font-size: 15px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.sidebar .widget ul {
  list-style: none;
}

.sidebar .widget li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.sidebar .widget li:last-child { border: none; }

/* ========== 文章详情页 ========== */
.article-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.article-header { margin-bottom: 24px; }
.article-header h1 {
  font-size: 26px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.article-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.article-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}

.article-body h2 {
  font-size: 20px;
  margin: 28px 0 12px;
  color: var(--text);
}

.article-body h3 {
  font-size: 17px;
  margin: 20px 0 10px;
}

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

.article-body ul, .article-body ol {
  margin: 0 0 16px 24px;
}

.article-body li { margin-bottom: 6px; }

.article-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 16px 0;
}

.article-body a {
  color: var(--primary);
  text-decoration: underline;
}

/* 工具推荐框 */
.tool-recommend-box {
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.tool-recommend-box .tool-info h4 {
  font-size: 16px;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.tool-recommend-box .tool-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.tool-recommend-box .try-btn {
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius);
  white-space: nowrap;
  font-size: 14px;
  display: inline-block;
  text-align: center;
  transition: background 0.2s;
}

.tool-recommend-box .try-btn:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* 相关文章 */
.related-articles {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.related-articles h3 {
  font-size: 17px;
  margin-bottom: 16px;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.related-item {
  background: var(--bg);
  padding: 12px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.4;
}

.related-item a { color: var(--text); }
.related-item a:hover { color: var(--primary); }

/* ========== 分类页 ========== */
.page-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 22px;
  margin-bottom: 8px;
}

.page-header p { color: var(--text-muted); font-size: 14px; }

/* ========== 分页 ========== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.pagination a {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-muted);
  background: var(--surface);
  transition: all 0.2s;
}

.pagination a:hover, .pagination a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ========== 底部 ========== */
.site-footer {
  background: var(--text);
  color: #94a3b8;
  padding: 24px 0;
  margin-top: 40px;
  text-align: center;
  font-size: 14px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-links a { color: #94a3b8; }
.footer-links a:hover { color: #fff; }

.copyright { line-height: 1.6; }

/* ========== 工具页 ========== */
.tool-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.tool-detail-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tool-detail-header img {
  width: 80px;
  height: 80px;
  border-radius: 16px;
}

.tool-detail-header h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.tool-detail-header .sub-info {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-muted);
}

.tool-detail-header .sub-info span {
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 4px;
}

.affiliate-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #ea580c);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0;
  transition: transform 0.2s;
  text-align: center;
}

.affiliate-btn:hover {
  transform: scale(1.05);
  color: #fff;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  .sidebar { display: none; }
  .main-nav { display: none; }
  .search-box { display: none; }
}

@media (max-width: 600px) {
  .article-detail { padding: 16px; }
  .article-header h1 { font-size: 20px; }
  .tool-detail-header { flex-direction: column; }
}

/* ========== 首页特色区块 ========== */
.hero-section {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff;
  border-radius: var(--radius);
  padding: 40px 32px;
  margin-bottom: 24px;
  text-align: center;
}

.hero-section h1 {
  font-size: 28px;
  margin-bottom: 12px;
}

.hero-section p {
  font-size: 16px;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto 20px;
}

.hero-section .hero-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-btn-primary {
  background: #fff;
  color: var(--primary);
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 600;
}

.hero-btn-primary:hover { color: var(--primary-dark); }

.hero-btn-secondary {
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.3);
}

/* 分类标签栏 */
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.category-tab {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-muted);
  background: var(--surface);
  transition: all 0.2s;
  cursor: pointer;
}

.category-tab:hover, .category-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 网格工具 */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

/* 广告占位 */
.ad-container {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  margin: 16px 0;
}
