/* ============================================
   防骗指南网 v2 - Professional Theme
   Inspired by chapan.cc design patterns
   ============================================ */

/* ===== CSS Variables / Themes ===== */
:root {
  --primary: #1a73e8;
  --primary-hover: #1557b0;
  --primary-light: #e8f0fe;
  --danger: #dc3545;
  --danger-bg: #fff5f5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --safe: #10b981;
  --safe-bg: #ecfdf5;
  --info: #3b82f6;
  --info-bg: #eff6ff;

  --bg: #ffffff;
  --bg-secondary: #f5f6fa;
  --bg-card: #ffffff;
  --bg-header: rgba(255,255,255,0.95);
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-hover: 0 8px 25px rgba(0,0,0,.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all .25s ease;
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", system-ui, sans-serif;
  --max-width: 1200px;
  --header-height: 64px;

  /* Swiper pagination */
  --swiper-pagination-color: var(--primary);
  --swiper-pagination-bullet-inactive-color: #fff;
  --swiper-pagination-bullet-inactive-opacity: .6;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-header: rgba(15,23,42,0.95);
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --border-light: #1e293b;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-hover: 0 8px 25px rgba(0,0,0,.4);
  --primary-light: #1e3a5f;
  --danger-bg: #2d1b1e;
  --warning-bg: #2d2815;
  --safe-bg: #132b20;
  --info-bg: #1a2d4a;
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  transition: background .3s, color .3s;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

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

/* ===== Header ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex; align-items: center;
  font-size: 22px; font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
}
.logo:hover { color: var(--text); text-decoration: none; }
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-right: 10px; color: #fff; font-size: 18px; font-weight: 700;
}
.logo span { color: var(--primary); }

/* Navigation */
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-menu a {
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 15px; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-menu a:hover, .nav-menu a.active {
  color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
}

/* Header Actions */
.header-actions {
  display: flex; align-items: center; gap: 8px;
}
.header-actions button {
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: var(--transition);
}
.header-actions button:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

/* Search Bar */
.search-form {
  display: none;
  position: absolute; left: 0; right: 0; top: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  z-index: 999;
}
.search-form.active { display: block; }
.search-inner { max-width: var(--max-width); margin: 0 auto; display: flex; gap: 8px; }
.search-inner input {
  flex: 1;
  padding: 12px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: var(--transition);
}
.search-inner input:focus { border-color: var(--primary); }
.search-inner button {
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 15px; font-weight: 600;
  transition: var(--transition);
}
.search-inner button:hover { background: var(--primary-hover); }

/* Mobile Toggle */
.mobile-toggle { display: none; }

/* ===== Hero Section ===== */
.hero-section {
  margin-top: var(--header-height);
  padding: 30px 0 20px;
  background: var(--bg);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
}

/* Carousel */
.hero-carousel { position: relative; border-radius: var(--radius); overflow: hidden; }
.swiper-container { width: 100%; height: 100%; min-height: 380px; }
.swiper-slide { position: relative; }
.swiper-slide img { width: 100%; height: 380px; object-fit: cover; }
.swiper-slide .slide-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 60px 30px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  color: #fff;
}
.swiper-slide .slide-overlay h3 {
  font-size: 20px; font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
}
.swiper-slide .slide-overlay p {
  font-size: 14px; opacity: .85;
}
.swiper-button-next, .swiper-button-prev {
  color: #fff !important;
  width: 40px !important; height: 40px !important;
  background: rgba(0,0,0,.4);
  border-radius: 50%;
  transition: var(--transition);
}
.swiper-button-next:hover, .swiper-button-prev:hover { background: rgba(0,0,0,.7); }
.swiper-button-next::after, .swiper-button-prev::after { font-size: 16px !important; }
.swiper-pagination-bullet { width: 10px; height: 10px; }

/* Headline Sidebar */
.headline-sidebar {
  display: flex; flex-direction: column; gap: 12px;
}
.headline-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.headline-item:first-child { flex: 2; }
.headline-item img { width: 100%; height: 100%; object-fit: cover; position: absolute; }
.headline-item .headline-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 30px 16px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  color: #fff;
}
.headline-item .headline-overlay h4 {
  font-size: 14px; font-weight: 600; line-height: 1.4;
}

/* ===== Notice Bar ===== */
.notice-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  margin-bottom: 24px;
  display: flex; align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}
.notice-bar i { color: var(--primary); }

/* ===== Main Content Layout ===== */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  padding: 0 0 40px;
}

/* ===== Article List ===== */
.section-title {
  font-size: 20px; font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.section-title .more {
  font-size: 14px; font-weight: 400; color: var(--text-secondary);
}
.section-title .more:hover { color: var(--primary); }
.section-title .badge {
  display: inline-block;
  width: 4px; height: 20px;
  background: var(--primary);
  border-radius: 2px;
  margin-right: 10px;
  vertical-align: middle;
}

/* Article Card */
.post-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  transition: var(--transition);
  overflow: hidden;
}
.post-item:hover {
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}
.post-inner { display: flex; gap: 0; }
.post-thumb {
  width: 240px; min-height: 160px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.post-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.post-item:hover .post-thumb img { transform: scale(1.05); }
.post-body { flex: 1; padding: 20px 24px; display: flex; flex-direction: column; }
.post-header { margin-bottom: 10px; }
.post-badge {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 20px;
  margin-bottom: 8px;
}
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: #b45309; }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-safe { background: var(--safe-bg); color: var(--safe); }
.pin-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}
.post-title {
  font-size: 18px; font-weight: 700;
  line-height: 1.45;
}
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--primary); text-decoration: none; }
.post-excerpt {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex; align-items: center;
  gap: 16px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.post-meta .author {
  display: flex; align-items: center; gap: 6px;
}
.post-meta .author img {
  width: 24px; height: 24px; border-radius: 50%;
  object-fit: cover;
}
.post-meta i { margin-right: 3px; }

/* No-thumb layout */
.post-item.no-thumb .post-body { padding: 24px; }

/* ===== Sidebar ===== */
.sidebar { position: sticky; top: calc(var(--header-height) + 20px); }
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.sidebar-title {
  font-size: 16px; font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.sidebar-title .badge {
  display: inline-block;
  width: 4px; height: 18px;
  background: var(--primary);
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
}

/* Hot Posts */
.hot-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  display: flex; gap: 12px;
}
.hot-list li:last-child { border-bottom: none; }
.hot-num {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.hot-list li:nth-child(1) .hot-num,
.hot-list li:nth-child(2) .hot-num,
.hot-list li:nth-child(3) .hot-num {
  background: var(--danger);
  color: #fff;
}
.hot-list a {
  color: var(--text);
  font-size: 14px; line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hot-list a:hover { color: var(--primary); text-decoration: none; }

/* Category Tags */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  padding: 6px 14px;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: var(--transition);
}
.tag-cloud a:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* ===== Article Detail Page ===== */
.article-detail { margin-top: var(--header-height); padding: 30px 0 50px; }
.article-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
}
.article-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}
.article-header { margin-bottom: 30px; }
.article-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.article-breadcrumb a { color: var(--text-muted); }
.article-breadcrumb a:hover { color: var(--primary); }
.article-header h1 {
  font-size: 28px; font-weight: 800;
  line-height: 1.35;
  margin-bottom: 14px;
}
.article-header .meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
  font-size: 14px; color: var(--text-muted);
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.article-body { font-size: 16px; line-height: 1.85; color: var(--text); }
.article-body h2 {
  font-size: 22px; font-weight: 700;
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.article-body h3 {
  font-size: 18px; font-weight: 600;
  margin: 28px 0 10px;
}
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { margin: 0 0 16px 0; }
.article-body li {
  margin-bottom: 6px;
  padding-left: 20px;
  position: relative;
}
.article-body ul li::before {
  content: '';
  position: absolute; left: 2px; top: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}
.article-body ol { counter-reset: list-counter; }
.article-body ol li { counter-increment: list-counter; }
.article-body ol li::before {
  content: counter(list-counter) '.';
  position: absolute; left: 0;
  font-weight: 600;
  color: var(--primary);
}
.article-body table {
  width: 100%; border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.article-body th {
  background: var(--bg-secondary);
  font-weight: 600;
  text-align: left;
}
.article-body th, .article-body td {
  padding: 10px 14px;
  border: 1px solid var(--border);
}
.article-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 14px 20px;
  background: var(--bg-secondary);
  margin: 20px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}
.article-body .alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
  font-size: 15px;
  line-height: 1.6;
}
.article-body .alert.alert-danger { background: var(--danger-bg); border-left: 4px solid var(--danger); }
.article-body .alert.alert-warning { background: var(--warning-bg); border-left: 4px solid var(--warning); }
.article-body .alert.alert-info { background: var(--info-bg); border-left: 4px solid var(--info); }
.article-body .alert.alert-safe { background: var(--safe-bg); border-left: 4px solid var(--safe); }

/* Article Navigation */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.article-nav a {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-size: 14px;
}
.article-nav a:hover {
  border-color: var(--primary);
  text-decoration: none;
}
.article-nav .nav-prev { text-align: left; }
.article-nav .nav-next { text-align: right; }
.article-nav .nav-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.article-nav .nav-title { color: var(--text); font-weight: 600; }

/* ===== Categories Page ===== */
.cat-page { margin-top: var(--header-height); padding: 30px 0; }
.cat-header {
  text-align: center;
  padding: 30px 0;
  margin-bottom: 30px;
}
.cat-header h1 { font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.cat-header p { color: var(--text-secondary); }
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: var(--transition);
}
.cat-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.cat-card .icon { font-size: 40px; margin-bottom: 12px; }
.cat-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.cat-card h3 a { color: var(--text); }
.cat-card p { font-size: 14px; color: var(--text-secondary); }
.cat-card .count {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px; color: var(--primary); font-weight: 600;
}

/* ===== About Page ===== */
.about-page { margin-top: var(--header-height); padding: 30px 0 50px; }
.about-container { max-width: 800px; margin: 0 auto; }
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
}
.about-card h1 { font-size: 28px; font-weight: 800; margin-bottom: 24px; }
.about-card h2 { font-size: 20px; font-weight: 700; margin: 28px 0 12px; }
.about-card p { margin-bottom: 14px; line-height: 1.8; }
.about-card ul { margin-bottom: 14px; }
.about-card li { padding-left: 20px; position: relative; margin-bottom: 6px; }
.about-card li::before {
  content: '•'; position: absolute; left: 4px;
  color: var(--primary); font-weight: 700;
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 40px 20px 30px;
  margin-top: 40px;
  text-align: center;
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.footer-links a { color: var(--text-secondary); font-size: 14px; }
.footer-links a:hover { color: var(--primary); }
.footer p { color: var(--text-muted); font-size: 13px; line-height: 1.8; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .hero-layout { grid-template-columns: 1fr; }
  .headline-sidebar { display: grid; grid-template-columns: 1fr 1fr 1fr; }
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .article-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --header-height: 56px; }
  .nav-menu { display: none; }
  .mobile-toggle { display: flex; }
  .hero-section { padding: 16px 0; }
  .swiper-container { min-height: 220px; }
  .swiper-slide img { height: 220px; }
  .swiper-slide .slide-overlay { padding: 30px 16px 14px; }
  .swiper-slide .slide-overlay h3 { font-size: 16px; }
  .headline-sidebar { grid-template-columns: 1fr; }
  .headline-item { min-height: 120px; }

  .post-inner { flex-direction: column; }
  .post-thumb { width: 100%; min-height: 180px; }
  .post-body { padding: 16px; }
  .post-title { font-size: 16px; }

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

  .article-nav { grid-template-columns: 1fr; }
  .article-nav .nav-next { text-align: left; }

  .about-card { padding: 24px; }
  .cat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .post-meta { flex-wrap: wrap; gap: 8px; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
}
