/* ========================================
   DarenNet — 嵌入式技术博客主样式
   ======================================== */

/* 基础重置 */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-dark: #0d1117;
  --bg-card: #161b22;
  --bg-header: #0d1117;
  --border: #30363d;
  --text: #c9d1d9;
  --text-light: #8b949e;
  --text-bright: #f0f6fc;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --green: #3fb950;
  --orange: #d29922;
  --red: #f85149;
  --purple: #a371f7;
  --tag-robot: #f0883e;
  --tag-drone: #58a6ff;
  --tag-chip: #3fb950;
  --tag-security: #f85149;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* 页面底色 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg-dark);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* 容器 */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ========== Header ========== */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 36px; height: 36px; background: var(--accent); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 800;
}
.logo-text { font-size: 20px; font-weight: 700; color: var(--text-bright); }
.logo-text span { color: var(--accent); }

/* 导航 */
.nav-links { display: flex; gap: 8px; list-style: none; }
.nav-links a {
  display: block; padding: 8px 16px; border-radius: var(--radius);
  color: var(--text); font-size: 14px; transition: all 0.2s;
}
.nav-links a:hover { background: rgba(88,166,255,0.1); color: var(--accent); }

/* 移动菜单 */
.menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

/* ========== Hero ========== */
.hero {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0d1117 100%);
  padding: 80px 0 60px; text-align: center; border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 42px; color: var(--text-bright); margin-bottom: 16px; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 18px; color: var(--text-light); max-width: 700px; margin: 0 auto 30px; }

/* 行业标签 */
.hero-tags { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-tag {
  padding: 8px 20px; border-radius: 20px; font-size: 14px; font-weight: 600;
  color: #fff; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.hero-tag:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.hero-tag.robot { background: var(--tag-robot); }
.hero-tag.drone { background: var(--tag-drone); }
.hero-tag.chip { background: var(--tag-chip); }
.hero-tag.security { background: var(--tag-security); }

/* 统计条 */
.stats-bar {
  display: flex; justify-content: center; gap: 48px; padding: 30px 0;
  border-bottom: 1px solid var(--border);
}
.stat-item { text-align: center; }
.stat-num { font-size: 32px; font-weight: 700; color: var(--text-bright); }
.stat-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* ========== 主体布局 ========== */
.main-layout { display: flex; gap: 30px; padding: 40px 0; }
.content-main { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }

/* ========== 文章卡片 ========== */
.section-title {
  font-size: 22px; color: var(--text-bright); margin-bottom: 20px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.section-title::before { content: ""; display: block; width: 4px; height: 22px; background: var(--accent); border-radius: 2px; }

.article-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 16px; transition: border-color 0.2s;
}
.article-card:hover { border-color: var(--accent); }

.article-card .meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.article-card .category {
  font-size: 12px; padding: 2px 10px; border-radius: 12px; font-weight: 600; color: #fff;
}
.category.robot { background: var(--tag-robot); }
.category.drone { background: var(--tag-drone); }
.category.chip { background: var(--tag-chip); }
.category.security { background: var(--tag-security); }

.article-card .date { font-size: 13px; color: var(--text-light); }
.article-card h3 { font-size: 18px; color: var(--text-bright); margin-bottom: 8px; }
.article-card h3 a { color: inherit; }
.article-card h3 a:hover { color: var(--accent); }
.article-card .excerpt { font-size: 14px; color: var(--text-light); line-height: 1.6; }
.article-card .tags { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.article-card .tags span {
  font-size: 12px; padding: 2px 8px; background: rgba(88,166,255,0.08);
  color: var(--accent); border-radius: 4px;
}

/* 更多链接 */
.more-link { text-align: right; margin-top: 12px; }
.more-link a { font-size: 14px; color: var(--accent); }

/* ========== 侧边栏 ========== */
.sidebar-section {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.sidebar-section h4 {
  font-size: 16px; color: var(--text-bright); margin-bottom: 14px;
  padding-left: 10px; border-left: 3px solid var(--accent);
}

/* 热门文章 */
.hot-list { list-style: none; }
.hot-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.hot-list li:last-child { border-bottom: none; }
.hot-list a { font-size: 14px; color: var(--text); display: block; transition: color 0.2s; }
.hot-list a:hover { color: var(--accent); }
.hot-list .hot-num {
  display: inline-block; width: 20px; height: 20px; line-height: 20px;
  text-align: center; border-radius: 4px; font-size: 12px; font-weight: 700;
  background: rgba(88,166,255,0.1); color: var(--accent); margin-right: 6px;
}
.hot-list li:nth-child(1) .hot-num { background: var(--red); color: #fff; }
.hot-list li:nth-child(2) .hot-num { background: var(--orange); color: #fff; }
.hot-list li:nth-child(3) .hot-num { background: var(--green); color: #fff; }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  font-size: 12px; padding: 4px 12px; border: 1px solid var(--border);
  border-radius: 12px; color: var(--text-light); transition: all 0.2s;
}
.tag-cloud a:hover { border-color: var(--accent); color: var(--accent); background: rgba(88,166,255,0.06); }

/* 公告 */
.notice-text { font-size: 14px; color: var(--text-light); line-height: 1.8; }
.notice-text a { color: var(--accent); }

/* ========== 技能板块 ========== */
.skills-section { padding: 40px 0; margin-bottom: 40px; }
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.skill-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 20px; text-align: center; transition: border-color 0.2s, transform 0.2s;
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.skill-icon { font-size: 36px; margin-bottom: 12px; }
.skill-card h3 { font-size: 16px; color: var(--text-bright); margin-bottom: 8px; }
.skill-card p { font-size: 13px; color: var(--text-light); line-height: 1.6; }

/* ========== Footer ========== */
.site-footer {
  background: var(--bg-header); border-top: 1px solid var(--border);
  padding: 40px 0 20px; margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.footer-col h4 { font-size: 15px; color: var(--text-bright); margin-bottom: 14px; }
.footer-col p { font-size: 13px; color: var(--text-light); line-height: 1.8; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 13px; color: var(--text-light); }
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom {
  text-align: center; font-size: 12px; color: var(--text-light);
  padding-top: 20px; border-top: 1px solid var(--border);
}

/* ========== 分类页面 ========== */
.category-header {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px 30px; margin: 40px 0 30px; text-align: center;
}
.category-header h2 { font-size: 28px; color: var(--text-bright); margin-bottom: 10px; }
.category-header p { font-size: 15px; color: var(--text-light); max-width: 600px; margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 30px; font-size: 14px; }

/* ========== 文章详情页 ========== */
.article-detail { max-width: 800px; margin: 40px auto; }
.article-detail h1 { font-size: 30px; color: var(--text-bright); margin-bottom: 12px; }
.article-detail .article-meta { font-size: 13px; color: var(--text-light); margin-bottom: 24px; display: flex; gap: 16px; }
.article-detail .article-body { font-size: 15px; color: var(--text); line-height: 1.9; }
.article-detail .article-body h2 { font-size: 22px; color: var(--text-bright); margin: 32px 0 14px; }
.article-detail .article-body h3 { font-size: 18px; color: var(--text-bright); margin: 24px 0 10px; }
.article-detail .article-body p { margin-bottom: 16px; }
.article-detail .article-body ul, .article-detail .article-body ol { margin: 12px 0 16px 20px; }
.article-detail .article-body li { margin-bottom: 6px; }
.article-detail .article-body code {
  background: var(--bg-card); padding: 2px 8px; border-radius: 4px; font-size: 13px;
  color: var(--orange); border: 1px solid var(--border);
}
.article-detail .article-body pre {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; overflow-x: auto; margin: 16px 0; font-size: 14px; line-height: 1.6;
}
.article-detail .article-body blockquote {
  border-left: 3px solid var(--accent); padding: 8px 16px; margin: 16px 0;
  color: var(--text-light); background: rgba(88,166,255,0.04);
}

/* ========== 分页 ========== */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span {
  display: block; width: 36px; height: 36px; line-height: 36px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px;
  color: var(--text); transition: all 0.2s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .dots { color: var(--text-light); border: none; }

/* ========== 响应式 ========== */
@media screen and (max-width: 768px) {
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
  .main-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-bar { gap: 24px; }
  .stat-num { font-size: 24px; }
  /* 移动端导航 */
  .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; background: var(--bg-header); border-bottom: 1px solid var(--border);
    padding: 10px 20px;
  }
  .nav-links.open { display: flex; }
  .menu-toggle { display: block; }
}

@media screen and (max-width: 480px) {
  .hero { padding: 50px 0 40px; }
  .hero h1 { font-size: 26px; }
  .skills-grid { grid-template-columns: 1fr; }
}
