/* ===== Mermaid Diagram Styles ===== */
.mermaid {
  background: #f8fafc;
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  display: block;
}
.mermaid svg {
  max-width: 100%;
  height: auto;
}
/* ===== TOC Hierarchy ===== */
.post-toc .nav .nav-child {
  display: block;
}
.post-toc .nav-item.nav-level-3 .nav-text {
  padding-left: 8px;
  font-size: 0.9em;
}
.post-toc .nav-item.nav-level-4 .nav-text {
  padding-left: 16px;
  font-size: 0.85em;
}
.mermaid-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 16px;
  color: #dc2626;
  margin: 20px 0;
}
.mermaid-loading {
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
  color: #64748b;
  text-align: center;
}

/* Click-to-Expand Mermaid */
.mermaid-zoom-container {
  position: relative;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin: 20px 0;
  background: #f8fafc;
  cursor: pointer;
  min-height: 100px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mermaid-zoom-container:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}
.mermaid-zoom-container .mermaid {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}
.mermaid-zoom-container .mermaid svg {
  display: block;
}
.mermaid-expand-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: rgba(15,23,42,0.03);
}
.mermaid-zoom-container:hover .mermaid-expand-overlay {
  opacity: 1;
}
.mermaid-expand-overlay span {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(255,255,255,0.95);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #3b82f6;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  backdrop-filter: blur(4px);
  pointer-events: none;
  transition: transform 0.15s ease;
}
.mermaid-zoom-container:hover .mermaid-expand-overlay span {
  transform: translateY(-2px);
}
.mermaid-expand-overlay .expand-icon {
  font-size: 15px;
}

/* Mermaid Modal */
@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-content-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.mermaid-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modal-fade-in 0.2s ease;
}
.mermaid-modal.active {
  display: flex;
}
.mermaid-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 90vw;
  max-height: 90vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modal-content-in 0.2s ease;
}
.mermaid-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  background: #fafbfc;
  gap: 12px;
}
.mermaid-modal-header .modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.mermaid-modal-header .modal-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.mermaid-modal-header .modal-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mermaid-modal-header .modal-hint {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
  margin-left: 4px;
}
.mermaid-modal-header .modal-close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-left: 4px;
}
.mermaid-modal-header .modal-close:hover {
  background: #fee2e2;
  color: #dc2626;
}
.mermaid-modal-body {
  flex: 1;
  overflow: auto;
  position: relative;
  background: #f8fafc
    repeating-linear-gradient(0deg, transparent, transparent 23px, #f1f5f9 23px, #f1f5f9 24px),
    repeating-linear-gradient(90deg, transparent, transparent 23px, #f1f5f9 23px, #f1f5f9 24px);
}
.mermaid-modal-body svg {
  display: block;
}
@media (max-width: 768px) {
  .mermaid-modal { padding: 12px; }
  .mermaid-modal-content { max-width: 100vw; max-height: 100vh; border-radius: 10px; }
  .mermaid-modal-header { padding: 10px 14px; }
}

/* ===== Guide Card Table ===== */
tr.guide-card-header td {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 12px 24px !important;
  font-size: 13px;
  font-weight: 700;
  color: #6366f1;
  letter-spacing: 0.04em;
  background: transparent !important;
  border: none !important;
}
table.guide-card {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  margin: 0 0 24px;
  overflow: hidden;
  display: block;
  width: 100%;
  background: #f8faff;
  border-left: 4px solid #6366f1;
  border-radius: 0 12px 12px 0;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.08);
}
table.guide-card thead {
  display: none;
}
table.guide-card.collapsed tbody tr:not(.guide-card-header) {
  display: none;
}
table.guide-card tbody tr.guide-card-header {
  cursor: pointer;
  user-select: none;
}
table.guide-card tbody tr.guide-card-header:hover {
  background: rgba(99, 102, 241, 0.04);
}
.collapse-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.collapse-icon::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-right: 2px solid #a5b4fc;
  border-bottom: 2px solid #a5b4fc;
  transform: rotate(-45deg);
  margin-top: -3px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
table.guide-card:not(.collapsed) .collapse-icon::before {
  transform: rotate(45deg);
  margin-top: 3px;
  border-color: #6366f1;
}
tr.guide-card-header:hover .collapse-icon::before {
  border-color: #6366f1;
}
.collapse-hint {
  font-size: 11px;
  color: #a5b4fc;
  font-weight: 400;
  transition: color 0.2s ease;
}
table.guide-card:not(.collapsed) .collapse-hint {
  display: none;
}
tr.guide-card-header:hover .collapse-hint {
  color: #6366f1;
}
table.guide-card tbody,
table.guide-card tbody tr {
  display: block;
  width: 100%;
}
table.guide-card tbody td {
  display: block;
  width: 100%;
  padding: 0 24px 14px;
  border: none;
  vertical-align: top;
  line-height: 1.7;
  color: #475569;
}
table.guide-card tbody td:first-child {
  padding: 12px 24px 2px;
  font-weight: 600;
  font-size: 12px;
  color: #6366f1;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 6px;
}
table.guide-card tbody td ul {
  margin: 0;
}

/* ===== Thinking Note ===== */
.thinking-note {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 0 12px 12px 0;
  padding: 20px 24px;
  margin: 24px 0;
}
.thinking-note h3 {
  margin: 0 0 12px;
  padding: 0;
  border: none;
  font-size: 14px;
  font-weight: 700;
  color: #d97706;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.thinking-note p {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.8;
  color: #78350f;
}
.thinking-note strong {
  display: inline-block;
  margin-top: 6px;
  color: #92400e;
}
.thinking-note ul {
  margin: 4px 0 4px 0;
  padding-left: 18px;
  list-style: none;
}
.thinking-note li {
  margin: 4px 0;
  padding-left: 14px;
  position: relative;
  color: #78350f;
  font-size: 14px;
  line-height: 1.7;
}
.thinking-note li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d97706;
  opacity: 0.5;
}
.thinking-note li strong {
  color: #92400e;
}


/* ===== Chapter Nav ===== */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 32px 0 16px;
  padding: 16px 0;
  border-top: 1px solid #e2e8f0;
}
.chapter-nav a {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #3b82f6;
  text-decoration: none;
  transition: all 0.15s ease;
}
.chapter-nav a:hover {
  background: #eff6ff;
  border-color: #3b82f6;
}
/* ===== About Page Modern Styles ===== */
.about-hero {
  text-align: center;
  padding: 48px 32px 40px;
  margin: -20px -20px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px 16px 16px 16px;
  color: #fff;
}
.about-hero .avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3);
  margin-bottom: 16px;
  object-fit: cover;
}
.about-hero h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: #fff !important;
}
.about-hero p {
  margin: 4px 0;
  font-size: 14px;
  opacity: 0.9;
  color: rgba(255,255,255,0.9) !important;
}
.about-hero .tagline {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 12px;
  font-style: italic;
}

.about-section {
  margin: 28px 0;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  transition: box-shadow 0.2s ease;
}
.about-section:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.about-section .section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
  margin-right: 10px;
}
.about-section h3 {
  display: flex;
  align-items: center;
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 600;
  color: #1e293b;
}

.skill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.skill-card {
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
}
.skill-card .label {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.skill-card.lang { background: #eff6ff; color: #1e40af; }
.skill-card.framework { background: #f0fdf4; color: #166534; }
.skill-card.frontend { background: #fefce8; color: #854d0e; }
.skill-card.infra { background: #f5f3ff; color: #5b21b6; }
.skill-card.security { background: #fef2f2; color: #991b1b; }
.skill-card.agent { background: #fdf2f8; color: #9d174d; }
.skill-card.business { background: #ecfdf5; color: #065f46; }
.skill-card.ops { background: #fff7ed; color: #9a3412; }
.skill-card .label { color: inherit; opacity: 0.7; }

.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  transition: all 0.2s ease;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.project-list li:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 12px rgba(59,130,246,0.1);
  transform: translateY(-1px);
}
.project-list .proj-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.project-list .proj-body {
  flex: 1;
  min-width: 0;
}
.project-list .proj-name {
  font-weight: 600;
  color: #0f172a;
  display: block;
  margin-bottom: 2px;
}
.project-list .proj-desc {
  color: #64748b;
  font-size: 13px;
  display: block;
}
.project-list .proj-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.project-list .proj-stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #fefce8;
  color: #ca8a04;
  border: 1px solid #fef9c3;
}
.project-list .proj-lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.project-list .proj-lang .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.series-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.series-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: #eff6ff;
  color: #3b82f6;
  border: 1px solid #dbeafe;
}
.series-tag:nth-child(3n+1) { background: #f0fdf4; color: #16a34a; border-color: #dcfce7; }
.series-tag:nth-child(3n+2) { background: #fefce8; color: #ca8a04; border-color: #fef9c3; }
.series-tag:nth-child(3n+3) { background: #f5f3ff; color: #7c3aed; border-color: #ede9fe; }
.series-tag:nth-child(5n) { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

.stats-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
}
.stat-item {
  text-align: center;
  padding: 8px 20px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
}
.stat-item .num {
  font-size: 20px;
  font-weight: 700;
  display: block;
}
.stat-item .lbl {
  font-size: 11px;
  opacity: 0.7;
  display: block;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .skill-grid { grid-template-columns: 1fr; }
  .about-hero { padding: 32px 20px 28px; }
}

/* ===== Modern Home Page ===== */
body {
  background:
    radial-gradient(circle at 12% 8%, rgba(20, 184, 166, 0.13), transparent 28%),
    radial-gradient(circle at 86% 2%, rgba(37, 99, 235, 0.11), transparent 26%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f8 48%, #f8fafc 100%);
  color: #243044;
}

.headband {
  background: linear-gradient(90deg, #0f766e, #2563eb, #ef4444);
  height: 4px;
}

.header {
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.site-brand-container,
.site-nav {
  background: transparent;
}

.site-title {
  color: #0f172a;
  font-weight: 800;
  letter-spacing: 0;
}

.site-subtitle {
  color: #64748b;
}

.main {
  padding-top: 28px;
}

.content.index.posts-expand {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.home-hero,
.home-topic-grid,
.home-series {
  width: 100%;
}

.home-hero {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  padding: 44px 48px 38px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 64, 175, 0.82)),
    url("/images/home-hero-bg.png") center / cover;
  color: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, #000 0%, transparent 78%);
  pointer-events: none;
}

.home-hero > * {
  position: relative;
  z-index: 1;
}

.home-hero-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.home-hero-avatar {
  width: 56px;
  height: 56px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.home-hero-profile-text {
  min-width: 0;
}

.home-hero-greeting {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.5;
}

.home-hero-greeting strong {
  color: #fff;
  font-weight: 700;
}

.home-hero-kicker {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-hero-title {
  max-width: 720px;
  margin: 0 0 12px;
  color: #fff !important;
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.home-hero-desc {
  max-width: 640px;
  margin: 0 0 24px;
  color: rgba(255,255,255,0.84);
  font-size: 16px;
  line-height: 1.75;
}

.home-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
}

.home-stat {
  min-width: 88px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.home-stat-num {
  display: block;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.home-stat-lbl {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.home-hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.home-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.home-hero-btn.primary {
  background: #fff;
  color: #0f172a;
}

.home-hero-btn:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  transform: translateY(-2px);
}

.home-hero-btn.primary:hover {
  color: #0f172a;
}

.home-hero-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.home-hero-quicklinks a {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.home-hero-quicklinks a:hover {
  color: #fff;
}

.home-hero-quicklinks i {
  margin-right: 5px;
  opacity: 0.85;
}

.home-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-topic-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 22px 22px 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.07);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-topic-card::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -44px;
  width: 142px;
  height: 142px;
  border-radius: 36px;
  transform: rotate(18deg);
  opacity: 0.14;
}

.home-topic-card.topic-agent::after {
  background: #2563eb;
}

.home-topic-card.topic-security::after {
  background: #dc2626;
}

.home-topic-card:hover {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.11);
  transform: translateY(-3px);
}

.home-topic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
}

.topic-agent .home-topic-icon {
  background: linear-gradient(135deg, #2563eb, #14b8a6);
}

.topic-security .home-topic-icon {
  background: linear-gradient(135deg, #dc2626, #f59e0b);
}

.home-topic-label {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.home-topic-card strong {
  display: block;
  margin: 8px 0 8px;
  color: #0f172a;
  font-size: 19px;
  line-height: 1.35;
}

.home-topic-card em {
  display: block;
  flex: 1;
  max-width: 100%;
  color: #64748b;
  font-size: 13px;
  font-style: normal;
  line-height: 1.75;
}

.home-topic-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.home-topic-count {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}

.home-topic-arrow {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.topic-security .home-topic-arrow {
  color: #dc2626;
}

.home-series {
  --series-clr: #2563eb;
  padding: 4px 0 8px;
}

.home-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
  padding: 0 4px;
}

.home-section-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.home-section-label span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-section-label strong {
  color: #0f172a;
  font-size: 24px;
  line-height: 1.2;
}

.home-section-link {
  color: var(--series-clr);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.home-section-link:hover {
  opacity: 0.75;
}

.home-series-desc {
  margin: 0 0 14px;
  padding: 0 4px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.home-chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-chapter-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 108px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-left: 3px solid var(--series-clr);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-chapter-card:hover {
  border-color: color-mix(in srgb, var(--series-clr) 35%, transparent);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.09);
  transform: translateY(-2px);
}

.home-chapter-num {
  color: var(--series-clr);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-chapter-title {
  flex: 1;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.home-chapter-meta {
  color: #94a3b8;
  font-size: 11px;
}

.home-project-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--proj-clr) 28%, transparent);
  border-radius: 18px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--proj-clr) 10%, transparent), rgba(255,255,255,0.88)),
    #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.07);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-project-header:hover {
  color: inherit;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.11);
  transform: translateY(-2px);
}

.home-project-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  color: #fff;
  font-size: 19px;
  box-shadow: 0 14px 26px color-mix(in srgb, var(--proj-clr) 24%, transparent);
}

.home-project-info {
  flex: 1;
  min-width: 0;
}

.home-project-title {
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.home-project-desc {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.home-project-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--proj-clr);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.content.index.posts-expand .post-block {
  position: relative;
  min-height: 192px;
  margin: 0;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.content.index.posts-expand .post-block:hover {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.1);
  transform: translateY(-3px);
}

.content.index.posts-expand .post-header {
  margin: 0;
}

.content.index.posts-expand .post-title {
  margin: 0 0 12px;
  text-align: left;
}

.content.index.posts-expand .post-title-link {
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  border-bottom: none;
}

.content.index.posts-expand .post-title-link:hover {
  color: #2563eb;
}

.content.index.posts-expand .post-meta {
  color: #94a3b8;
  font-size: 12px;
  text-align: left;
}

.content.index.posts-expand .post-body {
  margin-top: 16px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.75;
}

.content.index.posts-expand .post-body p {
  margin-bottom: 16px;
}

.content.index.posts-expand .post-button {
  margin: 0;
  text-align: left;
}

.content.index.posts-expand .post-button .btn {
  padding: 6px 12px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.content.index.posts-expand .post-eof {
  display: none;
}

.home-view-all {
  display: flex;
  justify-content: center;
  margin: 6px 0 0;
}

.home-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid color-mix(in srgb, var(--btn-clr) 28%, transparent);
  border-radius: 999px;
  background: #fff;
  color: var(--btn-clr);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.home-view-btn:hover {
  background: var(--btn-clr);
  color: #fff;
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-btn,
  .home-topic-card,
  .home-chapter-card,
  .home-view-btn {
    transition: none;
  }
}

.sidebar {
  padding-top: 0;
}

.sidebar-inner {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.footer {
  margin-top: 36px;
}

@media (max-width: 991px) {
  .main {
    padding-top: 18px;
  }

  .home-hero {
    min-height: 0;
    padding: 36px 28px 30px;
    border-radius: 20px;
  }

  .home-hero-title {
    font-size: 34px;
  }

  .home-topic-grid {
    grid-template-columns: 1fr;
  }

  .home-chapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .home-hero {
    padding: 28px 20px 24px;
  }

  .home-hero-profile {
    align-items: flex-start;
  }

  .home-hero-title {
    font-size: 28px;
  }

  .home-hero-desc {
    font-size: 14px;
  }

  .home-stat {
    min-width: calc(50% - 6px);
  }

  .home-chapter-grid {
    grid-template-columns: 1fr;
  }

  .home-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-topic-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
