/* ============================================================
   Network Identity Authentication Architecture Design Guide
   Solution Mall - Shared Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #0D6EFD;
  --secondary: #198754;
  --bg: #FFFFFF;
  --dark: #212529;
  --gray: #6C757D;
  --light: #F8F9FA;
  --border: #DEE2E6;
  --sidebar-w: 280px;
}

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

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.sidebar-logo {
  padding: 12px 16px;
  background: var(--light);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-align: center;
}

.sidebar-logo img { max-width: 160px; height: auto; display: block; margin: 0 auto 6px; }
.sidebar-logo a { color: var(--primary); font-size: 0.8rem; text-decoration: none; }
.sidebar-logo a:hover { text-decoration: underline; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  height: 80px; /* 5rem */
  padding: 12px 16px;
  text-decoration: none;
  color: var(--dark);
  font-size: 1rem;
  border-left: 4px solid transparent;
  transition: background 0.15s;
  gap: 16px;
  position: relative;
}

.nav-item:hover { background: var(--light); cursor: pointer; }
.nav-item.active { border-left-color: var(--primary); background: var(--light); }
.nav-item svg { flex-shrink: 0; color: var(--primary); }
.nav-item span { line-height: 1.3; font-size: 0.9rem; }

/* ---- Main Content ---- */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg);
}

.content-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 50px;
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, #0D6EFD 0%, #1a5fc8 60%, #0a4db0 100%);
  border-radius: 16px;
  padding: 60px 50px;
  margin-bottom: 40px;
  max-width: 1000px;
  color: #fff;
}

.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff !important;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.92;
  margin-bottom: 28px;
  max-width: 700px;
}

.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }

.btn-white {
  background: #fff;
  color: var(--primary);
  border: none;
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-white:hover { opacity: 0.9; }

.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-outline-white:hover { background: rgba(255,255,255,0.15); }

/* ---- Chapter Navigation Cards ---- */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}

.chapter-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 15px;
  height: 130px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--dark);
  box-shadow: 0 2px 4px rgba(0,0,0,0.075);
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.chapter-card:hover { box-shadow: 0 4px 12px rgba(13,110,253,0.15); transform: translateY(-2px); }

.chapter-card-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}

.chapter-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chapter-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---- Section headings ---- */
h1 { font-size: 2.5rem; font-weight: 700; color: var(--primary); }
h2 { font-size: 2rem; font-weight: 700; color: var(--primary); margin: 2rem 0 1rem; }
h3 { font-size: 1.5rem; font-weight: 600; color: var(--primary); margin: 1.5rem 0 0.75rem; }
h4 { font-size: 1.25rem; font-weight: 600; color: var(--primary); margin: 1.25rem 0 0.5rem; }

p { margin-bottom: 1.5rem; line-height: 1.6; }

/* ---- Page title area ---- */
.page-title { margin-bottom: 2rem; }
.page-title h1 { font-size: 2.5rem; }
.page-title .subtitle { color: var(--gray); font-size: 0.875rem; margin-top: 4px; }
.page-title hr { border: none; border-top: 1px solid var(--border); margin-top: 16px; }

/* ---- Images ---- */
.img-block {
  margin: 2rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--light);
}
.img-block img { width: 100%; height: auto; display: block; }
.img-caption {
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--gray);
  background: var(--light);
  border-top: 1px solid var(--border);
  text-align: center;
}

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
thead th {
  background: var(--light);
  color: var(--dark);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #fafafa; }

/* ---- Lists ---- */
ul.bullet-list, ol.num-list {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
ul.bullet-list li, ol.num-list li {
  line-height: 1.6;
  margin-bottom: 6px;
}
ul.bullet-list { list-style: disc; }

/* ---- Info / Alert boxes ---- */
.info-box {
  background: #e7f1ff;
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.warn-box {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

/* ---- Scenario cards ---- */
.scenario-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 2rem 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.scenario-header {
  background: var(--primary);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.scenario-header h3 { color: #fff; margin: 0; font-size: 1.1rem; }
.scenario-body { padding: 24px; }

/* ---- Metric badges ---- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 1rem 0;
}
.metric-item {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
}
.metric-label { font-size: 0.8rem; color: var(--gray); margin-bottom: 4px; }
.metric-value { font-size: 1rem; font-weight: 600; color: var(--primary); }

/* ---- Section divider ---- */
.section-divider {
  border: none;
  border-top: 2px solid var(--border);
  margin: 3rem 0;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--light);
  border-top: 1px solid var(--border);
  padding: 24px 50px;
  text-align: center;
  color: var(--gray);
  font-size: 0.875rem;
  margin-top: 4rem;
}
