:root {
  --primary: #e74c3c;
  --primary-dark: #c0392b;
  --secondary: #2c3e50;
  --accent: #f39c12;
  --bg: #f8f9fa;
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --border: #e0e0e0;
  --white: #fff;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.1);
}

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

html { scroll-behavior: smooth; }

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

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

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--secondary); font-weight: 700; }
.logo-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
}
.logo-text { font-size: 22px; }
.main-nav { display: flex; gap: 5px; }
.nav-link {
  padding: 8px 16px;
  color: var(--text);
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active { background: var(--primary); color: var(--white); }
.header-cta .btn { white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-size: 15px;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(231,76,60,0.3); }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-block { display: block; width: 100%; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  color: var(--white);
  padding: 80px 0 60px;
  text-align: center;
}
.hero h1 { font-size: 42px; margin-bottom: 16px; font-weight: 800; }
.hero p { font-size: 18px; opacity: 0.9; margin-bottom: 30px; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero .btn { padding: 14px 40px; font-size: 17px; }
.hero .btn-primary { background: var(--white); color: var(--primary); }
.hero .btn-primary:hover { background: var(--bg); color: var(--primary-dark); }

/* Feature Cards */
.features { padding: 60px 0; }
.section-title {
  text-align: center;
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--secondary);
  font-weight: 700;
}
.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 40px;
  font-size: 16px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--white);
  padding: 32px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.3s;
  text-align: center;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.feature-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}
.feature-card h3 { font-size: 18px; margin-bottom: 8px; color: var(--secondary); }
.feature-card p { color: var(--text-light); font-size: 14px; line-height: 1.6; }

/* Main Layout */
.main-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  padding: 40px 0;
}
.content-area { min-width: 0; }

/* Article Cards */
.article-list { display: flex; flex-direction: column; gap: 20px; }
.article-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.article-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.article-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-muted); }
.article-meta .cat-tag {
  background: var(--primary);
  color: var(--white);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
}
.article-card h2 { font-size: 22px; color: var(--secondary); line-height: 1.4; }
.article-card h2 a { color: var(--secondary); }
.article-card h2 a:hover { color: var(--primary); }
.article-excerpt { color: var(--text-light); line-height: 1.7; font-size: 15px; }
.article-card .read-more { font-weight: 600; font-size: 14px; }

/* Article Detail */
.article-detail {
  background: var(--white);
  border-radius: var(--radius);
  padding: 48px;
  box-shadow: var(--shadow);
}
.article-detail .article-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.article-detail h1 { font-size: 32px; color: var(--secondary); line-height: 1.3; margin-bottom: 16px; }
.article-detail .article-meta { font-size: 14px; }
.article-detail .article-body { font-size: 16px; line-height: 1.8; color: var(--text); }
.article-detail .article-body h2 { font-size: 24px; margin: 36px 0 16px; color: var(--secondary); border-left: 4px solid var(--primary); padding-left: 12px; }
.article-detail .article-body h3 { font-size: 20px; margin: 28px 0 14px; color: var(--secondary); }
.article-detail .article-body p { margin-bottom: 18px; }
.article-detail .article-body ul, .article-detail .article-body ol { padding-left: 24px; margin-bottom: 18px; }
.article-detail .article-body li { margin-bottom: 8px; }
.article-detail .article-body blockquote { border-left: 4px solid var(--accent); padding: 16px 20px; background: #fff8e1; margin: 24px 0; border-radius: 0 var(--radius) var(--radius) 0; color: var(--text); }
.article-detail .article-body blockquote p { margin-bottom: 0; }
.article-detail .article-body code { background: var(--bg); padding: 2px 8px; border-radius: 4px; font-family: Consolas, monospace; font-size: 14px; }
.article-detail .article-body .highlight-box { background: linear-gradient(135deg, #fff5f5, #fff8e1); border: 1px solid #ffe; padding: 20px 24px; border-radius: var(--radius); margin: 24px 0; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 90px; }
.widget {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.widget-title {
  font-size: 17px;
  color: var(--secondary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  font-weight: 700;
}
.search-form { display: flex; gap: 8px; }
.search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary); }
.search-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
}
.hot-list { list-style: none; }
.hot-list li {
  position: relative;
  padding: 10px 0 10px 30px;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
  line-height: 1.5;
}
.hot-list li:last-child { border-bottom: none; }
.hot-list .hot-rank {
  position: absolute;
  left: 0;
  top: 10px;
  width: 22px; height: 22px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.cat-list { list-style: none; }
.cat-list li { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.cat-list li:last-child { border-bottom: none; }
.cat-list li a { color: var(--text); font-size: 14px; }
.cat-list li a:hover { color: var(--primary); }
.widget-cta { background: linear-gradient(135deg, var(--primary), var(--accent)); color: var(--white); text-align: center; }
.widget-cta .widget-title { color: var(--white); border-bottom-color: rgba(255,255,255,0.3); }
.widget-cta p { margin-bottom: 16px; font-size: 14px; }
.widget-cta .btn-primary { background: var(--white); color: var(--primary); }
.widget-cta .btn-primary:hover { background: var(--bg); color: var(--primary-dark); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  background: var(--bg);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.tag-cloud a:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* Category Page */
.cat-header {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: var(--white);
  padding: 50px 0 40px;
  margin-bottom: 30px;
  text-align: center;
}
.cat-header h1 { font-size: 32px; margin-bottom: 10px; }
.cat-header p { opacity: 0.9; font-size: 16px; max-width: 600px; margin: 0 auto; }
.breadcrumb { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .separator { margin: 0 8px; }

/* Footer */
.site-footer { background: var(--secondary); color: #ccc; padding: 50px 0 0; margin-top: 60px; }
.footer-inner { padding: 0 20px; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  padding-bottom: 40px;
}
.footer-col h4 { color: var(--white); margin-bottom: 16px; font-size: 16px; }
.footer-col p { font-size: 14px; line-height: 1.7; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: #ccc; font-size: 14px; }
.footer-col ul li a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 20px 0; text-align: center; font-size: 13px; color: #999; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
.pagination a, .pagination span {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
}
.pagination a:hover, .pagination .current {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* Table of Contents */
.toc { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0; }
.toc h3 { font-size: 16px; margin-bottom: 12px; color: var(--secondary); }
.toc ol { padding-left: 20px; }
.toc ol li { margin-bottom: 6px; }
.toc a { font-size: 14px; }

/* Responsive */
@media (max-width: 900px) {
  .main-content { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .article-detail { padding: 28px 20px; }
  .article-card { padding: 20px; }
  .article-card h2 { font-size: 18px; }
  .main-nav { display: none; }
  .header-cta .btn { padding: 8px 16px; font-size: 14px; }
}

/* Utility */
.clearfix::after { content: ""; display: table; clear: both; }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
