/* ===== 新能源投资 - 充电设备资讯 ===== */
/* 主色调: #1565c0 (蓝色) */

/* ===== CSS 变量 ===== */
:root {
  --accent-color: #1565c0;
  --accent-dark: #0d47a1;
  --accent-light: #42a5f5;
  --text-primary: #212121;
  --text-secondary: #616161;
  --text-muted: #9e9e9e;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-card: #fafafa;
  --border-color: #e0e0e0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* ===== 重置样式 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

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

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

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

ul {
  list-style: none;
}

/* ===== 布局容器 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header 页头 ===== */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

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

.nav a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.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: 240px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.875rem;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-search {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

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

.hero-search button {
  padding: 16px 32px;
  background: var(--accent-color);
  color: white;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

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

/* ===== 分类卡片 ===== */
.categories {
  padding: 48px 0;
  background: var(--bg-secondary);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

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

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

.category-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.5rem;
}

.category-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.category-count {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ===== 资源列表 ===== */
.resources {
  padding: 48px 0;
}

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s;
}

.resource-item:hover {
  border-color: var(--accent-light);
}

.resource-icon {
  width: 56px;
  height: 56px;
  background: var(--accent-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.resource-info {
  flex: 1;
  min-width: 0;
}

.resource-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-meta {
  display: flex;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

.resource-action {
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

.btn-outline:hover {
  background: var(--accent-color);
  color: white;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

/* ===== 文章列表 ===== */
.articles-section {
  padding: 48px 0;
  background: var(--bg-secondary);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.article-column {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.column-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.article-item::before {
  content: "•";
  color: var(--accent-color);
  font-weight: bold;
}

.article-link {
  color: var(--text-primary);
  font-size: 0.9375rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-link:hover {
  color: var(--accent-color);
}

/* ===== Footer 页脚 ===== */
.footer {
  background: var(--text-primary);
  color: white;
  padding: 48px 0 24px;
}

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

.footer-brand .logo {
  color: white;
  margin-bottom: 16px;
}

.footer-brand .logo-icon {
  background: var(--accent-color);
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #424242;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ===== 面包屑 ===== */
.breadcrumb {
  padding: 16px 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

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

.breadcrumb-separator {
  color: var(--text-muted);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== 分类页头部 ===== */
.category-header {
  padding: 40px 0;
  background: var(--bg-secondary);
  text-align: center;
}

.category-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.category-header p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.category-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.category-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== 筛选栏 ===== */
.filter-bar {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.filter-inner {
  display: flex;
  gap: 24px;
  font-size: 0.9375rem;
}

.filter-item {
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

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

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

.page-item {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

.page-item:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.page-item.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.page-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== 文章详情页 ===== */
.article-header {
  padding: 40px 0;
  background: var(--bg-secondary);
}

.article-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-meta-bar {
  display: flex;
  gap: 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.article-meta-bar span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-content {
  padding: 48px 0;
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 24px 0 12px;
}

.article-body p {
  margin-bottom: 16px;
}

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

.article-body ul li {
  list-style: disc;
  margin-bottom: 8px;
}

.article-body ol li {
  list-style: decimal;
  margin-bottom: 8px;
}

.article-body strong {
  font-weight: 600;
}

.article-preview {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 40px;
  margin: 32px 0;
  text-align: center;
  border: 2px dashed var(--border-color);
}

.preview-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.preview-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.download-section {
  text-align: center;
  padding: 32px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin: 32px 0;
}

.download-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ===== 相关资源 ===== */
.related-resources {
  padding: 32px 0;
  border-top: 1px solid var(--border-color);
}

.related-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
  transition: border-color 0.2s;
}

.related-card:hover {
  border-color: var(--accent-light);
}

.related-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.related-card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ===== 404 页面 ===== */
.error-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}

.error-content {
  max-width: 480px;
}

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

.error-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.error-desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

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

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

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

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

  .nav {
    order: 3;
    width: 100%;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

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

  .hero {
    padding: 40px 0;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .hero-search {
    flex-direction: column;
    border-radius: var(--radius-md);
  }

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

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

  .resource-item {
    flex-wrap: wrap;
  }

  .resource-action {
    width: 100%;
    margin-top: 12px;
  }

  .resource-action .btn {
    width: 100%;
    justify-content: center;
  }

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

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

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .article-title {
    font-size: 1.5rem;
  }

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

  .error-code {
    font-size: 5rem;
  }

  .error-actions {
    flex-direction: column;
  }

  .error-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-stats {
    flex-direction: column;
    gap: 8px;
  }

  .filter-inner {
    flex-wrap: wrap;
    gap: 12px 24px;
  }

  .pagination {
    flex-wrap: wrap;
  }
}
