/* ═══════════════════════════════════════════════════════
   BizVan Portal — 商务车改装行业门户 深色主题
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────── */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2333;
  --bg-card-hover: #212a3b;
  --bg-input: #0d1117;
  --border: #30363d;
  --border-hover: #484f58;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #f0883e;
  --accent-hover: #ff9d5c;
  --accent-glow: rgba(240, 136, 62, 0.2);
  --gold: #d4a843;
  --gold-glow: rgba(212, 168, 67, 0.15);
  --hot-red: #e5534b;
  --hot-red-glow: rgba(229, 83, 75, 0.15);
  --pinned-blue: #58a6ff;
  --success: #3fb950;
  --danger: #f85149;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
}

/* ── Reset & Base ──────────────────────────────── */
*, *::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", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }

/* ── Layout ────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── Header / Nav ──────────────────────────────── */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  font-weight: 900;
}

.brand-accent { color: var(--accent); }

.nav-links {
  display: flex; align-items: center; gap: 24px;
  list-style: none;
}

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

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

.search-mini {
  display: flex; align-items: center; gap: 6px;
}

.search-mini input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  width: 180px;
  outline: none;
  transition: border-color var(--transition), width var(--transition);
}

.search-mini input:focus {
  border-color: var(--accent);
  width: 240px;
}

.search-mini button {
  background: var(--accent);
  color: #fff;
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition);
  display: flex; align-items: center; justify-content: center;
}

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

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; }

/* ── Hero Pinned Section ───────────────────────── */
.hero-section {
  padding: 32px 0 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.hero-main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 360px;
  background: linear-gradient(135deg, var(--bg-card), #1a2744);
  border: 1px solid var(--gold);
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: 40px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.hero-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px var(--gold-glow);
}

.hero-main .badge-pinned {
  position: absolute; top: 20px; left: 20px;
  background: var(--gold); color: #0d1117;
  padding: 4px 12px; border-radius: 4px;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 1px;
}

.hero-main h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}

.hero-main h2 a { color: var(--text-primary); }
.hero-main h2 a:hover { color: var(--gold); }

.hero-main .meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.hero-side {
  display: flex; flex-direction: column; gap: 12px;
}

.hero-side-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  flex: 1;
  display: flex; align-items: center;
  gap: 16px;
  transition: transform var(--transition), border-color var(--transition);
  cursor: pointer;
}

.hero-side-item:hover {
  border-color: var(--gold);
  transform: translateX(4px);
}

.hero-side-item .thumb {
  width: 80px; height: 60px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1a2744, #2a3454);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.hero-side-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.hero-side-item .meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Section Headers ───────────────────────────── */
.section-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex; align-items: center;
  gap: 8px;
}

.section-title .icon { font-size: 1.1rem; }
.icon-hot { color: var(--hot-red); }
.icon-rec { color: var(--accent); }
.icon-new { color: var(--accent); }

.sort-tabs {
  display: flex; gap: 4px;
}

.sort-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.sort-tab:hover { color: var(--text-primary); border-color: var(--border-hover); }
.sort-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Filter Tabs ─────────────────────────────── */
.filter-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.filter-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.filter-tab.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Article Cards ─────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

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

.card-image {
  height: 180px;
  background: linear-gradient(135deg, #1a2744, #2d1a3a);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  color: var(--text-muted);
  position: relative;
  overflow: hidden;
}

.card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.card-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-hot { background: var(--hot-red); color: #fff; }
.badge-rec { background: var(--accent); color: #fff; }
.badge-pinned { background: var(--gold); color: #0d1117; }

.card-body { padding: 16px; }

.card-body h3 {
  font-size: 1.05rem; font-weight: 600;
  margin-bottom: 8px; line-height: 1.4;
}

.card-body h3 a { color: var(--text-primary); }
.card-body h3 a:hover { color: var(--accent); }

.card-body .card-summary {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.card-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.78rem; color: var(--text-muted);
}

.card-meta .tags {
  display: flex; gap: 6px; flex-wrap: wrap;
}

.tag {
  background: rgba(240, 136, 62, 0.12);
  color: var(--accent);
  padding: 2px 8px; border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
}

/* ── Article List (compact) ─────────────────────── */
.article-list {
  display: flex; flex-direction: column;
  gap: 2px;
  margin-bottom: 32px;
}

.article-list-item {
  display: flex; align-items: center;
  gap: 20px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all var(--transition);
}

.article-list-item:hover {
  background: var(--bg-card);
  border-color: var(--border);
}

.article-list-item .list-num {
  font-size: 1.5rem; font-weight: 800;
  color: var(--border);
  width: 40px; text-align: center;
  flex-shrink: 0;
}

.article-list-item:nth-child(-n+3) .list-num {
  color: var(--accent);
}

.article-list-item .list-content { flex: 1; }

.article-list-item h3 {
  font-size: 1rem; font-weight: 600;
  margin-bottom: 4px;
}

.article-list-item h3 a { color: var(--text-primary); }
.article-list-item h3 a:hover { color: var(--accent); }

.article-list-item .list-meta {
  font-size: 0.78rem; color: var(--text-muted);
  display: flex; gap: 16px;
}

.article-list-item .list-info {
  text-align: right; flex-shrink: 0;
  font-size: 0.78rem; color: var(--text-muted);
  display: flex; gap: 12px; align-items: center;
}

.list-views { color: var(--text-muted); }

/* ── Pagination ────────────────────────────────── */
.pagination {
  display: flex; justify-content: center;
  align-items: center; gap: 8px;
  padding: 24px 0 48px;
}

.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

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

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

.pagination .disabled {
  opacity: 0.4; pointer-events: none;
}

/* ── Word Download Button ────────────────────── */
.article-detail .word-download {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff !important;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background var(--transition);
}
.btn-download:hover {
  background: var(--accent-hover);
  color: #fff !important;
}

/* ── Article Detail ────────────────────────────── */
.article-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.article-detail .article-cover {
  width: 100%; height: 360px;
  background: linear-gradient(135deg, #1a2744, #2d1a3a);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
  overflow: hidden;
}

.article-detail .article-cover img {
  width: 100%; height: 100%; object-fit: cover;
}

.article-detail .article-header { margin-bottom: 32px; }

.article-detail h1 {
  font-size: 2rem; font-weight: 800;
  line-height: 1.3; margin-bottom: 16px;
}

.article-detail .article-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 0.85rem; color: var(--text-muted);
  align-items: center;
}

.article-detail .article-body {
  font-size: 1.05rem; line-height: 1.8;
  color: var(--text-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  background: var(--bg-card);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.article-detail .article-body h1 { font-size: 1.6rem; margin: 24px 0 12px; color: var(--text-primary); }
.article-detail .article-body h2 { font-size: 1.3rem; margin: 20px 0 10px; color: var(--text-primary); }
.article-detail .article-body h3 { font-size: 1.1rem; margin: 16px 0 8px; color: var(--text-primary); }
.article-detail .article-body p { margin-bottom: 16px; color: var(--text-primary); }
.article-detail .article-body li { color: var(--text-primary); }
.article-detail .article-body strong { color: var(--text-primary); }
.article-detail .article-body img {
  border-radius: var(--radius);
  margin: 16px 0;
}
.article-detail .article-body table {
  width: 100%; border-collapse: collapse;
  margin: 16px 0;
  color: var(--text-primary);
}
.article-detail .article-body td, .article-detail .article-body th {
  border: 1px solid var(--border);
  padding: 8px 12px; text-align: left;
  color: var(--text-primary);
}
.article-detail .article-body th { background: var(--bg-secondary); color: var(--text-primary); }

.article-detail .article-tags {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; flex-wrap: wrap;
}

.article-detail .article-tags .tag {
  font-size: 0.8rem; padding: 4px 12px;
}

/* ── Search Page ───────────────────────────────── */
.search-page {
  padding: 40px 0;
}

.search-hero {
  text-align: center;
  padding: 40px 0;
}

.search-hero h2 {
  font-size: 1.8rem; margin-bottom: 20px;
}

.search-form-large {
  display: flex; max-width: 600px; margin: 0 auto;
}

.search-form-large input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 24px 0 0 24px;
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}

.search-form-large input:focus {
  border-color: var(--accent);
}

.search-form-large button {
  background: var(--accent);
  color: #fff; border: none;
  padding: 12px 28px;
  border-radius: 0 24px 24px 0;
  font-size: 1rem; font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.search-form-large button:hover {
  background: var(--accent-hover);
}

.search-info {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.no-results {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
}

.no-results .icon { font-size: 3rem; margin-bottom: 16px; }

/* ── Footer ────────────────────────────────────── */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Responsive ────────────────────────────────── */

/* ── 小屏手机 (iPhone SE / 主流安卓) ──────── */
@media (max-width: 480px) {
  html { font-size: 15px; }

  .container { padding: 0 12px; }

  /* 导航 */
  .navbar { height: 52px; padding: 0 12px; }
  .brand { font-size: 1.1rem; gap: 6px; }
  .brand-icon { width: 28px; height: 28px; font-size: 0.9rem; }
  .nav-links.open { top: 52px; padding: 12px 16px; }
  .nav-toggle { padding: 8px; font-size: 1.2rem; }
  .search-mini { display: none; }

  /* Hero */
  .hero-section { margin: 16px 0; }
  .hero-main {
    min-height: 180px;
    padding: 16px;
    border-radius: var(--radius);
  }
  .hero-main h2 { font-size: 1.15rem; line-height: 1.4; }
  .hero-main .meta { font-size: 0.75rem; }
  .hero-side-item { padding: 12px 14px; gap: 10px; }
  .hero-side-item .thumb { width: 56px; height: 42px; font-size: 1.2rem; }
  .hero-side-item h3 { font-size: 0.85rem; }

  /* Section Headers */
  .section-header {
    flex-wrap: wrap; gap: 8px;
    margin-bottom: 14px; padding-bottom: 10px;
  }
  .section-title { font-size: 1.1rem; width: 100%; }
  .sort-tabs { width: 100%; justify-content: flex-start; }
  .sort-tab { padding: 5px 12px; font-size: 0.8rem; }

  /* Card Grid */
  .card-grid { gap: 12px; margin-bottom: 24px; }
  .card-image { height: 160px; }
  .card-body { padding: 12px; }
  .card-body h3 { font-size: 0.95rem; }
  .card-body .card-summary { font-size: 0.8rem; }
  .card-meta { font-size: 0.72rem; gap: 8px; }

  /* Article List */
  .article-list-item {
    padding: 12px 14px;
    gap: 6px;
  }
  .article-list-item .list-title { font-size: 0.95rem; }
  .article-list-item .list-meta { font-size: 0.72rem; }

  /* Article Detail */
  .article-detail { padding: 16px 0; }
  .article-detail h1 { font-size: 1.3rem; line-height: 1.4; }
  .article-detail .article-cover { height: 180px; border-radius: var(--radius); }
  .article-detail .article-content { font-size: 0.95rem; line-height: 1.7; }
  .article-detail .article-content img {
    border-radius: 6px;
    margin: 12px 0;
  }
  .article-detail .article-content table {
    display: block; overflow-x: auto;
    font-size: 0.8rem;
  }
  .article-detail .article-content pre {
    font-size: 0.78rem;
    padding: 12px;
    border-radius: 6px;
  }

  /* Search Page */
  .search-page .search-input { font-size: 1rem; padding: 12px 14px; }
  .search-page .search-btn { padding: 12px 20px; font-size: 0.9rem; }

  /* Pagination */
  .pagination { gap: 4px; }
  .pagination a, .pagination span {
    padding: 6px 10px; font-size: 0.8rem;
    min-width: 32px; min-height: 32px;
  }

  /* Footer */
  .site-footer { padding: 16px 0; font-size: 0.75rem; }

  /* Touch-friendly: ensure all tappable elements >= 44px */
  .nav-links.open a,
  .sort-tab,
  .pagination a,
  .article-list-item a {
    min-height: 44px;
    display: flex; align-items: center;
  }
  .sort-tab { min-height: 36px; }
}

/* ── 平板 + 大屏手机 ────────────────────────── */
@media (min-width: 481px) and (max-width: 768px) {
  .container { padding: 0 16px; }

  .hero-main { min-height: 220px; padding: 20px; }
  .hero-main h2 { font-size: 1.25rem; }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .card-image { height: 160px; }
  .card-body h3 { font-size: 0.95rem; }

  .section-title { font-size: 1.2rem; }

  .article-detail h1 { font-size: 1.5rem; }
  .article-detail .article-content table {
    display: block; overflow-x: auto;
  }
}

/* ── 通用移动规则 (≤768px) ──────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    gap: 12px;
    z-index: 99;
  }

  .nav-toggle { display: block; }

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

  .article-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .article-list-item .list-num { display: none; }
  .article-list-item .list-info { text-align: left; }

  .article-detail .article-cover { height: 200px; }

  .search-mini input { width: 100px; }
  .search-mini input:focus { width: 140px; }

  /* Markdown content responsive */
  .article-detail .article-content img {
    max-width: 100%; height: auto;
  }
  .article-detail .article-content iframe,
  .article-detail .article-content video {
    max-width: 100%; height: auto;
  }
}

/* ── Infinite Scroll Loading ──────────────────── */
.load-more {
  text-align: center;
  padding: 32px 0 48px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.load-end {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ── Utility ──────────────────────────────────── */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
