/* ============================================
   反诈骗知识库 — 样式表
   Anti-Fraud Knowledge Base — Stylesheet
   ============================================ */

/* --- CSS Variables --- */
:root {
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-800: #991b1b;
  --red-900: #7f1d1d;

  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  --green-50: #f0fdf4;
  --green-500: #22c55e;
  --green-600: #16a34a;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --max-width: 1200px;
  --radius: 8px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  line-height: 1.7;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--blue-700); text-decoration: underline; }

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

/* --- Typography --- */
h1 { font-size: 2.25rem; font-weight: 800; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.4; margin-bottom: 0.75rem; }
h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }

blockquote {
  border-left: 4px solid var(--red-500);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: var(--red-50);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--red-800);
  font-weight: 500;
}

code {
  background: var(--gray-100);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

pre {
  background: var(--gray-800);
  color: #e5e7eb;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1rem 0;
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header / Navigation --- */
.site-header {
  background: linear-gradient(135deg, var(--red-800), var(--red-600));
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-title:hover { color: white; text-decoration: none; }

.site-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }

.site-nav a {
  color: rgba(255,255,255,0.85);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover {
  background: rgba(255,255,255,0.15);
  color: white;
  text-decoration: none;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(160deg, var(--red-700) 0%, var(--red-900) 100%);
  color: white;
  padding: 3.5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite;
}

@keyframes heroGlow {
  0%, 100% { transform: translate(0%, 0%); }
  50% { transform: translate(10%, 10%); }
}

.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.3rem 1rem;
  border-radius: 99px;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(4px);
}

.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto 1.5rem; }

/* --- Alert Bar --- */
.alert-bar {
  background: var(--amber-500);
  color: #1a1a1a;
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.alert-bar .alert-phone {
  display: inline-block;
  background: white;
  padding: 0.2rem 0.75rem;
  border-radius: 99px;
  color: var(--red-700);
  font-weight: 700;
  font-size: 1.05rem;
}

/* --- Emergency Contacts Strip --- */
.emergency-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1.5rem 0;
}

.emergency-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  border-top: 3px solid var(--red-500);
  transition: transform 0.15s, box-shadow 0.15s;
}

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

.emergency-card .ec-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--red-600);
  display: block;
  margin-bottom: 0.25rem;
}

.emergency-card .ec-label { color: var(--gray-600); font-size: 0.9rem; }

/* --- Section Titles --- */
.section-title {
  text-align: center;
  margin: 2.5rem 0 1.5rem;
  position: relative;
}

.section-title h2 {
  font-size: 1.7rem;
  color: var(--gray-900);
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--red-500);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* --- Category Sections --- */
.category-section { margin-bottom: 2.5rem; }

.category-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.category-heading .cat-icon { font-size: 1.4rem; }

.category-heading h3 { margin-bottom: 0; color: var(--gray-900); }

/* --- Cards Grid --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  padding: 1.5rem;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  display: block;
  color: inherit;
  text-decoration: none;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--red-300);
  text-decoration: none;
  color: inherit;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.card-header h4 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--gray-900);
}

.card-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.badge-danger  { background: var(--red-100); color: var(--red-700); }
.badge-warning { background: var(--amber-100); color: var(--amber-600); }
.badge-info    { background: var(--blue-100); color: var(--blue-700); }
.badge-green   { background: var(--green-50); color: var(--green-600); }

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.card-tags span {
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 500;
}

.card-meta {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Stats Section --- */
.stats-section {
  background: var(--gray-800);
  color: white;
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin: 3rem 0 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.stat-item .stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--red-400);
  display: block;
}

.stat-item .stat-label {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
}

.stats-source {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-top: 1.5rem;
}

/* --- Comparison Table --- */
.table-wrapper {
  overflow-x: auto;
  margin: 1rem 0 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.9rem;
}

thead { background: var(--red-600); color: white; }

th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}

tbody tr:hover { background: var(--gray-50); }

tbody tr:last-child td { border-bottom: none; }

/* --- Principles Section --- */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.principle-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}

.principle-card .principle-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.principle-card strong {
  display: block;
  font-size: 1.05rem;
  color: var(--red-700);
  margin-bottom: 0.25rem;
}

.principle-card p {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin: 0;
}

/* --- Guide Section --- */
.guide-flow {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.flow-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.flow-step:last-child { margin-bottom: 0; }

.flow-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--red-600);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.flow-content { padding-top: 0.35rem; }

.flow-content strong { display: block; color: var(--gray-900); margin-bottom: 0.15rem; }
.flow-content p { color: var(--gray-600); margin: 0; font-size: 0.9rem; }

/* --- Detail Page --- */
.detail-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--gray-600); }
.breadcrumb a:hover { color: var(--blue-600); }

.detail-page h1 {
  font-size: 2rem;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.detail-meta span {
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.82rem;
}

.detail-body h2 {
  color: var(--gray-900);
  margin-top: 2rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--gray-200);
}

.detail-body h3 {
  color: var(--gray-800);
  margin-top: 1.25rem;
}

.detail-body h4 {
  color: var(--gray-700);
  margin-top: 0.75rem;
}

.detail-body ul, .detail-body ol {
  margin: 0.75rem 0 1rem 1.5rem;
}

.detail-body li { margin-bottom: 0.35rem; }

/* Highlighted case box */
.case-box {
  background: var(--red-50);
  border: 1px solid var(--red-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
}

.case-box h4 { color: var(--red-800); }

/* Warning box */
.warning-box {
  background: var(--amber-50);
  border: 1px solid var(--amber-100);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
}

.warning-box::before { content: '⚠️ '; }

/* Pattern flow */
.pattern-flow {
  background: var(--gray-900);
  color: #a5f3fc;
  font-family: "SFMono-Regular", Consolas, monospace;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.83rem;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  margin: 1rem 0;
}

/* Tags cloud */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tags-cloud .tag {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

/* --- Back to top --- */
.back-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 42px;
  height: 42px;
  background: var(--red-600);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: background 0.15s, transform 0.15s;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-top:hover { background: var(--red-700); transform: scale(1.1); }

/* --- Footer --- */
.site-footer {
  background: var(--gray-900);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  margin-top: 3rem;
}

.site-footer strong { color: rgba(255,255,255,0.9); }

/* --- Responsive --- */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  .hero h1 { font-size: 2rem; }
  .hero { padding: 2.5rem 1rem; }

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

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav { width: 100%; }

  .emergency-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .emergency-card .ec-number { font-size: 1.5rem; }

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

  table { font-size: 0.8rem; }
  th, td { padding: 0.5rem 0.6rem; }
}

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

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

  .hero h1 { font-size: 1.6rem; }
}

/* --- Print --- */
@media print {
  .site-header, .back-top, .site-footer, .site-nav { display: none; }
  body { background: white; color: black; }
  .hero { background: none; color: black; padding: 1rem 0; }
}
