/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --bg: #f5f7fa;
  --white: #fff;
  --border: #e8eaed;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 8px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }

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

/* ===== Header ===== */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), #4fc3f7);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.nav { display: flex; gap: 28px; list-style: none; }
.nav a {
  color: var(--text-light);
  font-size: .95rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all .2s;
}
.nav a:hover, .nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, rgba(26,115,232,0.85), rgba(79,195,247,0.85)), url('../images/hero.jpg') center/cover no-repeat;
  color: #fff;
  padding: 50px 0;
}
.hero h1 { font-size: 2rem; margin-bottom: 12px; font-weight: 700; }
.hero p { font-size: 1.1rem; opacity: .9; max-width: 600px; line-height: 1.8; }

/* ===== Section Titles ===== */
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 40px 0 24px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}

/* ===== Article Cards ===== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.card-img {
  height: 180px;
  overflow: hidden;
  background: #e8eaed;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.card:hover .card-img img {
  transform: scale(1.05);
}

.card-body { padding: 20px; }
.card-tag {
  display: inline-block;
  font-size: .75rem;
  color: var(--primary);
  background: #e8f0fe;
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.card-body h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  line-height: 1.5;
}
.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--primary); }
.card-body p {
  font-size: .9rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: .8rem;
  color: var(--text-muted);
}

/* ===== Featured (large card) ===== */
.featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}
.featured-main {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.featured-main .card-img { height: 260px; overflow: hidden; }
.featured-main .card-body h3 { font-size: 1.3rem; }
.featured-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.featured-sidebar .side-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  transition: transform .2s;
}
.featured-sidebar .side-item:hover { transform: translateY(-2px); }
.featured-sidebar .side-item h4 {
  font-size: .95rem;
  margin-bottom: 6px;
  line-height: 1.5;
}
.featured-sidebar .side-item h4 a { color: var(--text); }
.featured-sidebar .side-item h4 a:hover { color: var(--primary); }
.featured-sidebar .side-item p {
  font-size: .85rem;
  color: var(--text-light);
  line-height: 1.6;
}
.featured-sidebar .side-item .card-meta {
  margin-top: 8px;
}

/* ===== Article Detail ===== */
.article-page { padding: 40px 0 60px; }
.article-page .container {
  max-width: 800px;
}
.article-header { margin-bottom: 30px; }
.article-header h1 {
  font-size: 1.8rem;
  line-height: 1.4;
  margin-bottom: 16px;
}
.article-meta {
  display: flex;
  gap: 20px;
  color: var(--text-muted);
  font-size: .9rem;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.article-content {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px;
  margin-bottom: 30px;
}
.article-content h2 {
  font-size: 1.3rem;
  margin: 28px 0 14px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}
.article-content h3 {
  font-size: 1.1rem;
  margin: 22px 0 10px;
}
.article-content p {
  margin-bottom: 16px;
  text-align: justify;
}
.article-content ul, .article-content ol {
  margin: 12px 0 16px 24px;
}
.article-content li {
  margin-bottom: 6px;
}
.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  margin: 16px 0;
  background: #f8f9fa;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-light);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .95rem;
  margin-bottom: 24px;
}

/* Related articles */
.related { margin-top: 40px; }
.related h3 {
  font-size: 1.15rem;
  margin-bottom: 16px;
  font-weight: 700;
}
.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.related-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.related-item h4 { font-size: .9rem; line-height: 1.5; }
.related-item h4 a { color: var(--text); }
.related-item h4 a:hover { color: var(--primary); }
.related-item .card-meta { margin-top: 8px; }

/* ===== Footer ===== */
.footer {
  background: #2c3e50;
  color: #ccc;
  padding: 30px 0;
  margin-top: auto;
  font-size: .85rem;
  text-align: center;
}
.footer a { color: #aaa; }
.footer a:hover { color: #fff; }
.footer-info { margin-bottom: 8px; }
.footer-icp { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.footer-icp a { color: #aaa; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--white); padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px; }
  .nav.open { display: flex; }
  .menu-toggle { display: block; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 1rem; }
  .featured { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: 1fr; }
  .article-content { padding: 24px 20px; }
  .article-header h1 { font-size: 1.4rem; }
  .section-title { font-size: 1.2rem; }
}
