/* === 共用基础 === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Roboto", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #333;
  background: #f5f5f5;
  -webkit-font-smoothing: antialiased;
}
a { color: #2980b9; text-decoration: none; transition: color .2s; }
a:hover { color: #e74c3c; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* === 顶部导航 === */
.site-header {
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-brand {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-brand:hover { color: #e74c3c; }
.site-brand .logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #f6b93b, #e55039);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.site-tagline { font-size: 12px; color: #999; font-weight: 400; display: block; }
.main-nav ul { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.main-nav a {
  color: #2c3e50; font-weight: 500; font-size: 14px;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active { color: #e74c3c; border-bottom-color: #e74c3c; }
.main-nav .login-btn {
  background: #e74c3c; color: #fff !important; padding: 8px 16px !important;
  border-radius: 6px; border-bottom: none !important;
}
.main-nav .login-btn:hover { background: #c0392b; }

/* === 英雄区 === */
.hero {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  padding: 48px 24px 32px;
  text-align: center;
}
.hero h1 { font-size: 34px; color: #2c3e50; margin-bottom: 10px; font-weight: 700; }
.hero p { font-size: 15px; color: #555; max-width: 720px; margin: 0 auto; }

/* === 主容器 === */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* === 板块标题 === */
.section {
  margin-bottom: 36px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 3px solid #e74c3c;
}
.section-title {
  font-size: 22px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.section-title .badge {
  font-size: 11px;
  background: #e74c3c;
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 500;
}
.section-title .badge.tutorial { background: #2980b9; }
.section-title .badge.project { background: #e55039; }
.section-more {
  font-size: 13px;
  color: #999;
}
.section-more:hover { color: #e74c3c; }

/* === 4 列卡片网格 === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 1100px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .cards-grid { grid-template-columns: 1fr; }
}
.card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.card-thumb {
  position: relative;
  background: linear-gradient(135deg, #f6b93b, #e55039);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  overflow: hidden;
}
.card-thumb.tutorial { background: linear-gradient(135deg, #2980b9, #6a89cc); }
.card-thumb.project { background: linear-gradient(135deg, #e55039, #ff6b6b); }
.card-thumb .placeholder {
  text-align: center;
  padding: 16px;
}
.card-thumb .placeholder .icon { font-size: 38px; margin-bottom: 6px; }
.card-thumb .placeholder .name { font-size: 13px; font-weight: 600; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb .video-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,.65);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-thumb .sticky-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #e74c3c;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.card-thumb .category-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
}
.card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 8px;
  color: #2c3e50;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px;
}
.card-title:hover { color: #e74c3c; }
.card-excerpt {
  font-size: 12px;
  color: #777;
  line-height: 1.55;
  margin-bottom: 10px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #aaa;
  border-top: 1px solid #f0f0f0;
  padding-top: 8px;
  margin-top: auto;
}
.card-meta .views { display: inline-flex; align-items: center; gap: 3px; }
.card-project-tag {
  background: #fff5f0;
  color: #e55039;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
}

/* === 侧边栏 === */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
}
@media (max-width: 1000px) {
  .layout-with-sidebar { grid-template-columns: 1fr; }
}
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.widget-title {
  font-size: 15px;
  color: #2c3e50;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eee;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.widget-title i { color: #e74c3c; }
.widget ul li {
  padding: 6px 0;
  border-bottom: 1px dashed #eee;
  font-size: 13px;
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: #555; }
.widget ul li a:hover { color: #e74c3c; }
.widget .meta {
  display: block;
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}

/* 推广位 */
.promo-box {
  background: linear-gradient(135deg, #6a89cc, #4a69bd);
  color: #fff;
  text-align: center;
  padding: 22px 16px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(74,105,189,.3);
}
.promo-box h4 { font-size: 17px; margin-bottom: 8px; }
.promo-box p { font-size: 12px; opacity: .92; margin-bottom: 12px; line-height: 1.5; }
.promo-box .btn {
  display: inline-block;
  background: #fff;
  color: #4a69bd;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 12px;
  transition: transform .2s;
}
.promo-box .btn:hover { transform: scale(1.05); color: #4a69bd; }
.promo-box-2 { background: linear-gradient(135deg, #f6b93b, #e55039); }

/* === 底部 === */
.site-footer {
  background: #2c3e50;
  color: #bdc3c7;
  padding: 40px 24px 20px;
  margin-top: 32px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
}
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-col h4 { color: #fff; margin-bottom: 14px; font-size: 15px; font-weight: 600; }
.footer-col p, .footer-col li { font-size: 13px; line-height: 1.8; color: #95a5a6; }
.footer-col li { padding: 3px 0; }
.footer-col a { color: #bdc3c7; }
.footer-col a:hover { color: #fff; }
.footer-about .footer-logo {
  font-size: 22px;
  color: #fff;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-about .footer-logo .logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #f6b93b, #e55039);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.footer-bottom {
  max-width: 1280px;
  margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid #3d556e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #7f8c8d;
}

/* === 加载骨架 === */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === 响应式微调 === */
@media (max-width: 700px) {
  .hero h1 { font-size: 26px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}