/* ===== 工程机械云 - 全局样式 ===== */
:root {
  --accent-color: #2196f3;
  --accent-dark: #1976d2;
  --accent-light: #e3f2fd;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-white: #fff;
  --bg-gray: #f5f7fa;
  --border-color: #e8e8e8;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
}

* {
  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-gray);
}

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header 页头 ===== */
.header {
  background: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

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

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

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

.nav a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s;
}

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

.search-box {
  position: relative;
  width: 280px;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 16px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-box button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: var(--accent-color);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
}

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

.hero-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

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

.hero-search {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  height: 56px;
  padding: 0 60px 0 24px;
  border: none;
  border-radius: 28px;
  font-size: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.hero-search input:focus {
  outline: none;
}

.hero-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: var(--accent-color);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* ===== Section 通用 ===== */
.section {
  padding: 40px 0;
}

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

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

/* ===== Category Filter ===== */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.category-filter a {
  padding: 8px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  transition: all 0.2s;
}

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

/* ===== Link Cards ===== */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.link-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.link-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.link-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.link-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-url {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.link-tag {
  padding: 2px 8px;
  background: var(--bg-gray);
  border-radius: 10px;
}

.verified {
  color: #4caf50;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== Stats ===== */
.stats-bar {
  background: var(--bg-white);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 0;
}

.stats-grid {
  display: flex;
  justify-content: center;
  gap: 60px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-color);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== Article Lists ===== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.article-list {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.article-list-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.article-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.article-item:last-child {
  border-bottom: none;
}

.article-item a {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

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

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

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

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

.breadcrumb span {
  color: var(--text-muted);
  margin: 0 8px;
}

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

/* ===== Category Header ===== */
.category-header {
  background: var(--bg-white);
  padding: 30px 0;
  text-align: center;
}

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

.category-header p {
  color: var(--text-secondary);
}

.sub-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.sub-categories a {
  padding: 6px 14px;
  background: var(--bg-gray);
  border-radius: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.sub-categories a:hover {
  background: var(--accent-color);
  color: #fff;
}

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

.pagination a,
.pagination span {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
}

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

/* ===== Article Detail ===== */
.article-detail {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}

.article-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

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

.article-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
}

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

.article-body h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 30px 0 16px;
}

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

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

.article-body li {
  margin-bottom: 8px;
}

.article-tags {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.article-tags span {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-gray);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-right: 8px;
  margin-bottom: 8px;
}

/* ===== 404 Page ===== */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

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

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

.error-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

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

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

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

/* ===== Footer ===== */
.footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border-color);
  padding: 40px 0 20px;
  margin-top: 40px;
}

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

.footer-brand .logo {
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

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

.footer-links a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .content-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .nav {
    order: 3;
    width: 100%;
    margin-top: 12px;
    gap: 20px;
    justify-content: center;
  }

  .search-box {
    width: 200px;
  }

  .hero-title {
    font-size: 28px;
  }

  .stats-grid {
    gap: 30px;
  }

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

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

  .article-detail {
    padding: 24px;
  }

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

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

  .category-filter {
    gap: 8px;
  }

  .category-filter a {
    padding: 6px 12px;
    font-size: 12px;
  }

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