/* IT职业启蒙 - 全局样式 */
:root {
  --accent-color: #2196f3;
  --accent-dark: #1976d2;
  --accent-light: #64b5f6;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f7fa;
  --bg-card: #fff;
  --border-color: #e8e8e8;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

/* 头部导航 */
.header {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-color);
}

.logo span {
  color: var(--text-primary);
}

.nav {
  display: flex;
  gap: 30px;
}

.nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav a:hover,
.nav a.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  width: 280px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 14px;
}

.search-box button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

/* Hero区域 */
.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
}

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

.hero p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 30px;
}

.hero-search {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  background: #fff;
  padding: 8px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.hero-search input {
  flex: 1;
  border: none;
  padding: 12px 16px;
  font-size: 15px;
  outline: none;
}

.hero-search button {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search button:hover {
  background: var(--accent-dark);
}

/* 分类区域 */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px;
}

.section-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 22px;
  background: var(--accent-color);
  border-radius: 2px;
}

/* 分类卡片 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.category-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  border: 1px solid var(--border-color);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-light);
}

.category-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-color) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  color: #fff;
}

.category-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.category-card p {
  font-size: 13px;
  color: var(--text-muted);
}

/* 内容卡片 */
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.content-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

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

.content-thumb {
  height: 160px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 48px;
}

.content-body {
  padding: 20px;
}

.content-tag {
  display: inline-block;
  background: rgba(33, 150, 243, 0.1);
  color: var(--accent-color);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
}

.content-card h3 {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.content-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 列表布局 */
.list-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.list-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.list-item:hover {
  box-shadow: var(--shadow-md);
}

.list-thumb {
  width: 120px;
  height: 90px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 32px;
}

.list-content {
  flex: 1;
}

.list-content h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.list-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 筛选器 */
.filter-bar {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.filter-item {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.filter-item:hover,
.filter-item.active {
  background: var(--accent-color);
  color: #fff;
}

.filter-result {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
}

/* 面包屑 */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--accent-color);
}

.breadcrumb span {
  margin: 0 8px;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination a,
.pagination span {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 0.2s;
}

.pagination a {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.pagination a:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.pagination .current {
  background: var(--accent-color);
  color: #fff;
}

/* 文章详情 */
.article-header {
  background: var(--bg-card);
  padding: 40px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  max-width: var(--max-width);
  margin: 0 auto 16px;
  font-size: 28px;
  line-height: 1.4;
}

.article-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  background: var(--bg-card);
}

.article-body h2 {
  font-size: 22px;
  margin: 32px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.article-body h3 {
  font-size: 18px;
  margin: 24px 0 12px;
}

.article-body p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.article-body ul,
.article-body ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.article-body strong {
  color: var(--text-primary);
}

/* 三栏布局 */
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.col-section h4 {
  font-size: 15px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-color);
}

.col-section ul {
  list-style: none;
}

.col-section li {
  margin-bottom: 12px;
}

.col-section a {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-section a::before {
  content: '•';
  color: var(--accent-color);
}

.col-section a:hover {
  color: var(--accent-color);
}

/* 两栏布局 */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* 404页面 */
.error-page {
  min-height: calc(100vh - var(--header-height) - 200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.error-code {
  font-size: 120px;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 20px;
  opacity: 0.8;
}

.error-page h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: 30px;
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--accent-dark);
  color: #fff;
}

/* 页脚 */
.footer {
  background: #1a1a2e;
  color: #fff;
  padding: 50px 20px 20px;
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.footer-brand p {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  line-height: 1.8;
}

.footer-links h4 {
  font-size: 14px;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.8);
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: rgba(255,255,255,0.5);
  font-size: 13px;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 20px;
    justify-content: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
  }

  .search-box {
    width: auto;
    flex: 1;
  }

  .hero {
    padding: 40px 16px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .hero-search {
    flex-direction: column;
  }

  .hero-search button {
    width: 100%;
  }

  .section {
    padding: 24px 16px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .three-col,
  .two-col {
    grid-template-columns: 1fr;
  }

  .list-item {
    flex-direction: column;
  }

  .list-thumb {
    width: 100%;
    height: 160px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-result {
    margin-left: 0;
    text-align: center;
  }

  .article-header h1 {
    font-size: 22px;
  }

  .article-meta {
    flex-wrap: wrap;
    gap: 12px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .error-code {
    font-size: 80px;
  }
}
