/* AllStepByStep allstepbystep.com — practical step-by-step how-to guides
   Blue as the base colour, yellow for highlights. System fonts only, so the site loads fast in mainland China. */

:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-dark: #0f172a;
  --primary-soft: #eaf1ff;
  --primary-rgb: 29, 78, 216;
  --accent: #facc15;
  --accent-soft: #fef9c3;
  --rose: #e11d48;
  --done: #16a34a;

  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f7fb;
  --paper: #ffffff;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 14px 36px rgba(15, 23, 42, 0.13);
  --header-h: 68px;

  --bs-body-font-family: var(--font);
  --bs-link-color-rgb: var(--primary-rgb);
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

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

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
}

.container {
  max-width: 1200px;
}

:focus-visible {
  outline: 3px solid rgba(var(--primary-rgb), 0.4);
  outline-offset: 2px;
}

/* ——— Buttons ——— */
.btn-brand {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--primary-hover);
  --bs-btn-hover-border-color: var(--primary-hover);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #1e3a8a;
  --bs-btn-active-border-color: #1e3a8a;
  font-weight: 600;
  border-radius: 999px;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}

.btn-accent {
  --bs-btn-color: #1f2937;
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #1f2937;
  --bs-btn-hover-bg: #fde047;
  --bs-btn-hover-border-color: #fde047;
  --bs-btn-active-color: #1f2937;
  --bs-btn-active-bg: #eab308;
  --bs-btn-active-border-color: #eab308;
  font-weight: 700;
  border-radius: 999px;
}

.btn-ghost {
  --bs-btn-color: var(--primary);
  --bs-btn-bg: var(--primary-soft);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  font-weight: 600;
  border-radius: 999px;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.site-header .navbar {
  min-height: var(--header-h);
  padding: 0.5rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-name b {
  color: var(--primary);
  font-weight: 800;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--muted);
}

.site-header .nav-link {
  position: relative;
  color: var(--ink-2);
  font-weight: 500;
  padding: 0.5rem 0.8rem !important;
  border-radius: var(--r-sm);
  white-space: nowrap;
}

.site-header .nav-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.site-header .nav-link.active {
  color: var(--primary);
  font-weight: 700;
}

@media (min-width: 992px) {
  .site-header .nav-link.active::after {
    content: "";
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: -0.65rem;
    height: 3px;
    border-radius: 3px;
    background: var(--primary);
  }
}

.header-search {
  position: relative;
}

.header-search .form-control {
  width: 14rem;
  padding: 0.45rem 1rem 0.45rem 2.3rem;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}

.header-search .form-control:focus,
.big-search .form-control:focus,
.side-search .form-control:focus,
.sub-form .form-control:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
}

.header-search svg,
.side-search svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.site-header .navbar-toggler {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
}

.site-header .navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.2);
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .site-header .nav-link {
    padding: 0.5rem 0.5rem !important;
    font-size: 0.95rem;
  }

  .site-header .nav-link.active::after {
    left: 0.5rem;
    right: 0.5rem;
  }

  .brand-tag {
    display: none;
  }

  .header-search .form-control {
    width: 9rem;
  }
}

@media (max-width: 359.98px) {
  .site-header .brand-tag {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .site-header .navbar-collapse {
    padding: 0.75rem 0 0.5rem;
  }

  .header-search .form-control {
    width: 100%;
  }
}

/* ——— Hero ——— */
.hero {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 0 3.25rem;
  background:
    radial-gradient(circle at 86% 18%, rgba(250, 204, 21, 0.22), transparent 40%),
    linear-gradient(160deg, #eaf1ff 0%, #f6f7fb 72%);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.hero-kicker .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--done);
}

.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  font-weight: 800;
  margin: 1rem 0 0.9rem;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.hero h1 em {
  font-style: normal;
  color: var(--primary);
  background: linear-gradient(transparent 64%, var(--accent-soft) 64%);
}

.hero .lead {
  color: var(--ink-2);
  font-size: 1.1rem;
  max-width: 34rem;
}

.big-search {
  display: flex;
  gap: 0.5rem;
  max-width: 34rem;
  margin-top: 1.5rem;
  padding: 0.4rem;
  background: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
}

.big-search .form-control {
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  background: transparent;
}

.big-search .form-control:focus {
  box-shadow: none;
}

.big-search .btn {
  flex-shrink: 0;
  padding: 0.55rem 1.5rem;
}

.hot-words {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.6rem;
  margin-top: 1rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.hot-words a {
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.hot-words a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-top: 2rem;
}

.hero-stats strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}

.hero-stats span {
  font-size: 0.85rem;
  color: var(--muted);
}

.hero-art {
  width: 100%;
  max-width: 470px;
  height: auto;
  margin: 0 auto;
}

/* ——— Sections ——— */
.section {
  padding: 3.25rem 0;
}

.section-white {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.6rem;
  margin: 0;
}

.section-title::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 4px;
  margin-top: 0.45rem;
  border-radius: 4px;
  background: var(--accent);
}

.section-sub {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.link-more {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 0.92rem;
}

/* ——— How it works ——— */
.how-card {
  position: relative;
  height: 100%;
  padding: 1.5rem 1.4rem;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--line);
}

.how-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 0.9rem;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.how-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.how-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (min-width: 768px) {
  .how-card::after {
    content: "";
    position: absolute;
    top: 2.7rem;
    right: -1.05rem;
    width: 1.1rem;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--primary) 0 4px, transparent 4px 8px);
  }

  .col-md-4:last-child .how-card::after {
    display: none;
  }
}

/* ——— Categories ——— */
.cat-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  height: 100%;
  padding: 1.1rem 1.2rem;
  border-radius: var(--r);
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cat-item:hover {
  color: var(--ink);
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow: var(--shadow-lg);
}

.cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 14px;
}

.cat-item strong {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
}

.cat-item small {
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 575.98px) {
  .cat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 1rem;
  }

  .cat-icon {
    width: 2.6rem;
    height: 2.6rem;
  }
}

/* Soft colour themes shared by covers, icons and tags */
.c1 { background: #dbeafe; color: #1d4ed8; }
.c2 { background: #ffe4e6; color: #be123c; }
.c3 { background: #fef3c7; color: #b45309; }
.c4 { background: #e0f2fe; color: #0369a1; }
.c5 { background: #ede9fe; color: #6d28d9; }
.c6 { background: #dcfce7; color: #15803d; }
.c7 { background: #ffedd5; color: #c2410c; }
.c8 { background: #ccfbf1; color: #0f766e; }

/* ——— Guide cards ——— */
.cover {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.step-badge {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.7;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.post-card:hover .cover img,
.post-row:hover .cover img,
.post-feature:hover .cover img {
  transform: scale(1.05);
}

.post-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.1rem 1.25rem 1.25rem;
}

.post-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.cat-tag {
  display: inline-block;
  padding: 0.12rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
}

.level {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
}

.level::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--done);
}

.level-medium::before {
  background: #f59e0b;
}

.level-hard::before {
  background: var(--rose);
}

.post-title {
  font-size: 1.1rem;
  line-height: 1.4;
  margin: 0 0 0.5rem;
}

.post-title a {
  color: var(--ink);
}

.post-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.post-title a:hover,
.post-card:hover .post-title a,
.post-row:hover .post-title a {
  color: var(--primary);
}

.post-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.8rem;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.avatar.a2 { background: #db2777; }
.avatar.a3 { background: #0d9488; }
.avatar.a4 { background: #ea580c; }

.avatar-lg {
  width: 4rem;
  height: 4rem;
  font-size: 1.3rem;
}

/* Featured guide on the home page */
.post-feature {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
  height: 100%;
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.post-feature .cover {
  aspect-ratio: auto;
  min-height: 100%;
}

.post-feature .post-body {
  padding: 1.75rem;
  justify-content: center;
}

.post-feature .post-title {
  font-size: 1.5rem;
}

.post-feature .post-excerpt {
  -webkit-line-clamp: 3;
  font-size: 0.96rem;
}

.badge-hot {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.55rem;
  border-radius: 6px;
  background: var(--accent);
  color: #1f2937;
  font-size: 0.74rem;
  font-weight: 800;
}

@media (max-width: 767.98px) {
  .post-feature {
    grid-template-columns: 1fr;
  }

  .post-feature .cover {
    aspect-ratio: 16 / 9;
  }

  .post-feature .post-body {
    padding: 1.25rem;
  }

  .post-feature .post-title {
    font-size: 1.25rem;
  }
}

/* Compact text list next to the featured guide */
.mini-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 1.25rem;
  height: 100%;
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.mini-list li + li {
  border-top: 1px dashed var(--line);
}

.mini-list a {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 0.85rem 0;
  color: var(--ink);
}

.mini-list a:hover strong {
  color: var(--primary);
}

.mini-thumb {
  width: 5.5rem;
  flex-shrink: 0;
  border-radius: 10px;
  aspect-ratio: 16 / 10;
}

.mini-list strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.45;
}

.mini-list small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ——— Quick skills ——— */
.quick-card {
  height: 100%;
  padding: 1.2rem 1.3rem;
  border-radius: var(--r);
  background: var(--paper);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quick-card:hover {
  border-color: rgba(var(--primary-rgb), 0.35);
  box-shadow: var(--shadow);
}

.quick-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
}

.quick-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.time-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #854d0e;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ——— Sidebar ——— */
.side-card {
  padding: 1.25rem 1.3rem;
  margin-bottom: 1.25rem;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.side-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.side-card h3::before {
  content: "";
  width: 4px;
  height: 1em;
  border-radius: 4px;
  background: var(--primary);
}

.side-search {
  position: relative;
}

.side-search .form-control {
  padding: 0.55rem 1rem 0.55rem 2.3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rank;
}

.rank-list li {
  counter-increment: rank;
}

.rank-list li + li {
  border-top: 1px dashed var(--line);
}

.rank-list a {
  display: flex;
  gap: 0.75rem;
  padding: 0.7rem 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.5;
}

.rank-list a::before {
  content: counter(rank);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
  border-radius: 6px;
  background: #eef0f4;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.rank-list li:nth-child(1) a::before { background: var(--primary); color: #fff; }
.rank-list li:nth-child(2) a::before { background: #3b82f6; color: #fff; }
.rank-list li:nth-child(3) a::before { background: #93c5fd; color: #1e3a8a; }

.rank-list a:hover {
  color: var(--primary);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-cloud a {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.84rem;
}

.tag-cloud a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.cat-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cat-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.2rem;
  color: var(--ink-2);
  font-size: 0.93rem;
}

.cat-links li + li {
  border-top: 1px solid var(--line);
}

.cat-links a:hover {
  color: var(--primary);
}

.cat-links em {
  font-style: normal;
  min-width: 2rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.sub-card {
  background: linear-gradient(150deg, var(--primary) 0%, #1e3a8a 100%);
  color: rgba(255, 255, 255, 0.88);
}

.sub-card h3 {
  color: #fff;
}

.sub-card h3::before {
  background: var(--accent);
}

.sub-card p {
  font-size: 0.9rem;
}

.sub-form {
  display: flex;
  gap: 0.5rem;
}

.sub-form .form-control {
  min-width: 0;
  border: 0;
  border-radius: 999px;
  font-size: 0.9rem;
}

.sub-form .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ——— CTA band ——— */
.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 2rem 2.25rem;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 92% 10%, rgba(250, 204, 21, 0.35), transparent 45%),
    linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: rgba(255, 255, 255, 0.86);
}

.cta-band h2 {
  margin: 0 0 0.35rem;
  color: #fff;
  font-size: 1.5rem;
}

.cta-band p {
  margin: 0;
}

.cta-band .sub-form {
  width: 100%;
  max-width: 26rem;
}

.cta-band .sub-form .form-control {
  padding: 0.6rem 1.1rem;
}

/* ——— Page banner ——— */
.page-banner {
  padding: 2.25rem 0 2rem;
  background:
    radial-gradient(circle at 90% 0%, rgba(250, 204, 21, 0.18), transparent 40%),
    linear-gradient(160deg, #eaf1ff 0%, #f6f7fb 80%);
  border-bottom: 1px solid var(--line);
}

.page-banner h1 {
  margin: 0.4rem 0 0.4rem;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 800;
}

.page-banner p {
  margin: 0;
  color: var(--ink-2);
}

.breadcrumb {
  margin: 0;
  font-size: 0.85rem;
  --bs-breadcrumb-divider-color: var(--muted);
  --bs-breadcrumb-item-active-color: var(--muted);
}

.breadcrumb a {
  color: var(--ink-2);
}

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

/* ——— List page ——— */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.38rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.sort-tabs {
  display: flex;
  gap: 1rem;
  font-size: 0.88rem;
}

.sort-tabs a {
  color: var(--muted);
}

.sort-tabs a.active {
  color: var(--primary);
  font-weight: 700;
}

.post-row {
  position: relative;
  display: grid;
  grid-template-columns: 15.5rem 1fr;
  gap: 1.4rem;
  padding: 1.1rem;
  margin-bottom: 1.1rem;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-row:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.post-row .cover {
  border-radius: 10px;
}

.post-row .post-body {
  padding: 0.2rem 0.25rem 0.1rem 0;
}

.post-row .post-title {
  font-size: 1.18rem;
}

@media (max-width: 575.98px) {
  .post-row {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding: 0.9rem;
  }

  .post-row .post-body {
    padding: 0;
  }
}

.empty-state {
  padding: 3rem 1rem;
  border-radius: var(--r);
  background: var(--paper);
  color: var(--muted);
  text-align: center;
  box-shadow: var(--shadow);
}

.pagination {
  --bs-pagination-color: var(--ink-2);
  --bs-pagination-hover-color: var(--primary);
  --bs-pagination-hover-bg: var(--primary-soft);
  --bs-pagination-active-bg: var(--primary);
  --bs-pagination-active-border-color: var(--primary);
  --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.2);
  --bs-pagination-border-color: var(--line);
  gap: 0.35rem;
}

.pagination .page-link {
  min-width: 2.4rem;
  border-radius: 10px !important;
  text-align: center;
}

/* ——— Article ——— */
.article-head {
  padding: 2rem 0 0;
}

.article-head h1 {
  margin: 0.75rem 0 0.9rem;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.article-meta .author {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 600;
}

.article-paper {
  padding: 2rem 2.25rem;
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}

@media (max-width: 575.98px) {
  .article-paper {
    padding: 1.25rem 1.1rem;
    border-radius: var(--r);
  }
}

.article-hero {
  margin: 0 0 1.5rem;
  border-radius: var(--r);
  aspect-ratio: 16 / 8;
}

/* Difficulty / time / steps / cost overview */
.guide-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.guide-summary div {
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.guide-summary small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.guide-summary strong {
  display: block;
  font-size: 1.02rem;
}

@media (max-width: 575.98px) {
  .guide-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

.article-body {
  font-size: 1.05rem;
  color: var(--ink-2);
}

.article-body > p {
  margin-bottom: 1.15rem;
}

.article-body > h2 {
  margin: 2.4rem 0 1rem;
  font-size: 1.5rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.article-body > ul,
.article-body > ol {
  margin-bottom: 1.2rem;
  padding-left: 1.4rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body li::marker {
  color: var(--primary);
  font-weight: 700;
}

.article-body strong {
  color: var(--ink);
}

.article-body mark {
  padding: 0 0.15em;
  background: var(--accent-soft);
  color: inherit;
}

/* What you'll need */
.needs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.needs > div {
  padding: 1.1rem 1.2rem;
  border-radius: var(--r);
  background: var(--primary-soft);
}

.needs h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: #1e3a8a;
}

.needs ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.95rem;
}

.needs li {
  margin-bottom: 0.3rem;
}

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

/* Numbered step */
.step {
  position: relative;
  margin: 0 0 1.25rem;
  padding: 1.25rem 1.3rem 1.25rem 4.4rem;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--paper);
  scroll-margin-top: calc(var(--header-h) + 1rem);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.step-no {
  position: absolute;
  left: 1.2rem;
  top: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.step h3 {
  margin: 0.2rem 0 0.5rem;
  font-size: 1.15rem;
}

.step p {
  margin: 0 0 0.75rem;
}

.step-figure {
  margin: 0.25rem 0 0.9rem;
}

.step-figure .cover {
  border-radius: 12px;
  aspect-ratio: 16 / 7;
}

.step-tip {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #713f12;
  font-size: 0.92rem;
}

.step-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.step-check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--done);
  cursor: pointer;
}

.step.done {
  border-color: rgba(22, 163, 74, 0.45);
  background: #f6fdf8;
}

.step.done .step-no {
  background: var(--done);
}

.step.done .step-check {
  color: var(--done);
}

@media (max-width: 575.98px) {
  .step {
    padding: 1.1rem 1rem 1.1rem 1rem;
  }

  .step-no {
    position: static;
    margin-bottom: 0.5rem;
  }
}

/* Progress tracker in the sidebar */
.progress-card .progress {
  height: 0.6rem;
  margin: 0.25rem 0 0.6rem;
  border-radius: 999px;
  background: #e5e7eb;
}

.progress-card .progress-bar {
  border-radius: 999px;
  background: var(--done);
  transition: width 0.3s ease;
}

.progress-card p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.progress-card button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.table-wrap {
  margin: 1.25rem 0 1.5rem;
  overflow-x: auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}

.article-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.article-table th,
.article-table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-table thead th {
  background: var(--primary-soft);
  color: #1e3a8a;
  font-weight: 700;
  white-space: nowrap;
}

.article-table tbody tr:last-child td {
  border-bottom: 0;
}

.article-table tbody tr:nth-child(even) {
  background: #fafbfd;
}

.callout {
  display: flex;
  gap: 0.85rem;
  margin: 1.4rem 0;
  padding: 1rem 1.2rem;
  border-radius: var(--r);
  font-size: 0.96rem;
}

.callout p {
  margin: 0;
}

.callout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  flex-shrink: 0;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}

.callout-tip {
  background: var(--primary-soft);
}

.callout-tip .callout-icon {
  background: var(--primary);
}

.callout-warn {
  background: #fff1f2;
}

.callout-warn .callout-icon {
  background: var(--rose);
}

.mistakes {
  list-style: none;
  padding-left: 0 !important;
}

.mistakes li {
  position: relative;
  padding-left: 1.9rem;
}

.mistakes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--rose) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6.5 6.5l7 7M13.5 6.5l-7 7' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.faq-item {
  padding: 1rem 0;
  border-top: 1px dashed var(--line);
}

.faq-item h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.faq-item h3::before {
  content: "Q";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  margin-right: 0.5rem;
  border-radius: 6px;
  background: var(--accent);
  color: #1f2937;
  font-size: 0.8rem;
}

.faq-item p {
  margin: 0;
}

.disclaimer {
  margin-top: 2rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.86rem;
}

.article-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.share-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 0.85rem;
}

.share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.copy-tip {
  color: var(--done);
  font-weight: 600;
}

.author-box {
  display: flex;
  gap: 1.1rem;
  margin-top: 1.5rem;
  padding: 1.4rem 1.5rem;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.author-box h3 {
  margin: 0 0 0.25rem;
  font-size: 1.08rem;
}

.author-box h3 small {
  margin-left: 0.4rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
}

.author-box p {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.prev-next a {
  display: block;
  padding: 1rem 1.2rem;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.prev-next a:hover {
  color: var(--primary);
}

.prev-next small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.prev-next strong {
  display: block;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.45;
}

.prev-next .next {
  text-align: right;
}

@media (max-width: 575.98px) {
  .prev-next {
    grid-template-columns: 1fr;
  }

  .prev-next .next {
    text-align: left;
  }
}

.article-aside {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}

.toc a {
  display: block;
  margin-left: -2px;
  padding: 0.3rem 0 0.3rem 0.95rem;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.45;
}

.toc .toc-step a {
  padding-left: 1.6rem;
  font-size: 0.86rem;
}

.toc a:hover {
  color: var(--primary);
}

.toc a.active {
  border-left-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

/* ——— Footer ——— */
.site-footer {
  margin-top: 3rem;
  padding: 3rem 0 1.25rem;
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.site-footer .brand,
.site-footer .brand:hover {
  color: #fff;
}

.site-footer .brand-name b {
  color: var(--accent);
}

.site-footer .brand-tag {
  display: block;
  color: rgba(255, 255, 255, 0.6);
}

.site-footer h5 {
  margin-bottom: 0.9rem;
  color: #fff;
  font-size: 1rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 0.45rem;
  overflow-wrap: anywhere;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.72);
}

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 2rem;
  padding: 1rem 3.5rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
}

/* ——— Back to top ——— */
.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1020;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
}

.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  background: var(--primary-hover);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .article-aside,
  .to-top,
  .share-row,
  .prev-next,
  .step-check {
    display: none !important;
  }
}
