/* ==========================================================================
   components-butterfly.css
   Butterfly Theme Layout (U7's Blog Style) for Homepage
   (Full-page Hero, Alternating Post Stream, Profile/OSS/Shelf Widgets, Pagination)
   ========================================================================== */



/* 0. Global Full-Screen Live Wallpaper & Dynamic Particle Canvas */
#web_bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -999;
  pointer-events: none;
  background-image: linear-gradient(135deg, rgba(10, 15, 29, 0.42) 0%, rgba(10, 15, 29, 0.68) 100%),
                    url('/img/home-bg.jpg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  animation: webBgBreathing 24s ease-in-out infinite alternate;
  will-change: transform;
  transform-origin: center center;
}

@keyframes webBgBreathing {
  0% {
    transform: scale(1) translate(0, 0);
  }
  50% {
    transform: scale(1.05) translate(-1%, -0.7%);
  }
  100% {
    transform: scale(1.02) translate(0.7%, -1%);
  }
}

#web_leaves_canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* 1. Full-Screen Immersive Hero Header (Seamless blend with global #web_bg) */
#page-header.full_page {
  position: relative;
  width: 100%;
  height: 72vh;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-align: center;
  overflow: hidden;
  margin-bottom: 0;
  background: transparent !important;
}

#page-header.full_page::before {
  display: none !important;
}

/* 1.1 Canvas for Dynamic Falling Autumn Leaves / Floating Light Particles */
#hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* 1.2 Compact Header for Pagination Pages (Page 2, 3...) */
#page-header.not-home-page {
  position: relative;
  width: 100%;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-align: center;
  overflow: hidden;
  margin-bottom: 0;
  background-color: #0f172a;
}

#page-header.not-home-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.65) 0%, rgba(30, 27, 75, 0.75) 100%),
              url('/img/home-bg.jpg') center center / cover no-repeat;
  z-index: 1;
}

@media (max-width: 768px) {
  #page-header.full_page {
    height: 90vh;
    min-height: 480px;
  }
  #page-header.full_page::before {
    animation-duration: 36s;
  }
  #page-header.not-home-page {
    height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-header.full_page::before {
    animation: none;
  }
  #hero-particles {
    display: none;
  }
}

#page-header.full_page #site-info,
#page-header.not-home-page #site-info {
  position: relative;
  z-index: 3;
  padding: 0 20px;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#page-header.not-home-page #site-title {
  font-family: var(--title-font);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 12px 0;
  text-shadow: 0 3px 15px rgba(0, 0, 0, 0.45);
  line-height: 1.2;
}

#page-header.not-home-page .page-num-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #f1f5f9;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#page-header.full_page #site-info {
  position: relative;
  z-index: 2;
  padding: 0 20px;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#page-header .hero-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #f1f5f9;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 18px;
}

#page-header .status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

#page-header #site-title {
  font-family: var(--title-font);
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 16px 0;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 0 30px rgba(168, 85, 247, 0.35);
  line-height: 1.15;
}

#page-header #site-subtitle {
  font-family: var(--global-font);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: rgba(255, 255, 255, 0.92);
  min-height: 2em;
  margin-bottom: 24px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  font-weight: 500;
  line-height: 1.6;
}

#page-header .typed-cursor {
  opacity: 1;
  font-weight: 200;
  margin-left: 2px;
  animation: cursor-blink 0.85s infinite;
  color: #38bdf8;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

#page-header #site_social_icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
}

#page-header .social-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 19px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

#page-header .social-icon:hover {
  background: #ffffff;
  color: #7c3aed;
  transform: translateY(-4px) scale(1.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

/* Scroll Down Bouncing Arrow */
#page-header #scroll-down {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  z-index: 5;
  color: rgba(255, 255, 255, 0.85);
  font-size: 32px;
  padding: 8px;
  transition: color 0.2s ease;
}

#page-header #scroll-down:hover {
  color: #ffffff;
}

.scroll-down-effects {
  display: inline-block;
  animation: scroll-down-anim 1.8s infinite ease-in-out;
}

@keyframes scroll-down-anim {
  0% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-12px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.5; }
}

/* 2. Main Content Container (Left: 3-Column Articles Feed | Right: Original Aside Widgets) */
#content-inner.butterfly-container {
  max-width: 1480px;
  width: 95%;
  margin: 0 auto;
  padding: 42px 20px 80px 20px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
  box-sizing: border-box;
  background: transparent !important;
}

@media (max-width: 1100px) {
  #content-inner.butterfly-container {
    flex-direction: column;
    padding: 24px 14px 60px 14px;
    gap: 24px;
    width: 100%;
  }
}

/* 3. Feed Column (Recent Posts Stream) */
.butterfly-recent-posts {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.butterfly-feed-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
}

.butterfly-feed-title {
  font-family: var(--title-font);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.butterfly-feed-title i {
  color: var(--primary-color);
  font-size: 19px;
}

.butterfly-feed-count {
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}

/* 4. Butterfly Alternating Recent Post Cards */
.recent-post-item {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--card-border);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s ease,
              border-color 0.35s ease;
}

html[data-theme="dark"] .recent-post-item {
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}

.recent-post-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
  border-color: var(--card-hover-border);
}

html[data-theme="dark"] .recent-post-item:hover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 25px -4px rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.4);
}

.recent-post-content {
  display: flex;
  min-height: 240px;
  position: relative;
}

/* Alternating Left / Right Directions */
.recent-post-content.left {
  flex-direction: row;
}

.recent-post-content.right {
  flex-direction: row-reverse;
}

@media (max-width: 768px) {
  .recent-post-content.left,
  .recent-post-content.right {
    flex-direction: column !important;
  }
}

/* Post Cover */
.recent-post-cover {
  width: 44%;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background: #0f172a;
}

@media (max-width: 768px) {
  .recent-post-cover {
    width: 100% !important;
    height: 200px !important;
    min-height: 200px !important;
  }
}

.recent-post-cover a {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.article-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
  display: block;
}

.recent-post-item:hover .article-cover {
  transform: scale(1.08);
}

/* Sticky Tag */
.post-sticky-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.45);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.02em;
}

/* Post Info Area */
.recent-post-info {
  width: 56%;
  padding: 26px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .recent-post-info {
    width: 100% !important;
    padding: 20px 22px !important;
  }
}

.article-title {
  font-family: var(--title-font);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-main);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.015em;
}

.article-title:hover {
  color: var(--primary-color) !important;
  text-decoration: none;
}

.recent-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.recent-post-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.recent-post-meta .meta-separator {
  color: var(--card-border);
}

.recent-post-meta i {
  color: var(--primary-color);
  font-size: 13px;
}

.article-content-text {
  margin-bottom: 14px;
}

.post-desc-subtitle {
  font-family: var(--title-font);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 6px;
  line-height: 1.45;
}

.post-desc-excerpt {
  font-family: var(--global-font);
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
}

.read-more-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.25s ease, color 0.2s ease;
}

.read-more-link:hover {
  color: var(--accent-cyan);
  gap: 10px;
  text-decoration: none;
}

.recent-post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.post-tag-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.08);
  color: var(--primary-color);
  border: 1px solid rgba(124, 58, 237, 0.18);
  text-decoration: none;
  transition: all 0.2s ease;
}

.post-tag-pill:hover {
  background: var(--primary-color);
  color: #ffffff;
  text-decoration: none;
}

/* 5. Butterfly Aside Sidebar */
.butterfly-aside {
  width: 310px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 1100px) {
  .butterfly-aside {
    width: 100% !important;
  }
}

.butterfly-aside .card-widget {
  background: rgba(18, 22, 34, 0.82) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-sizing: border-box;
  color: #f1f5f9;
}

.butterfly-aside .card-widget:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 20px rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
}

.butterfly-aside .sticky_layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

html[data-theme="dark"] .butterfly-aside .card-widget {
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}

.butterfly-aside .card-widget:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  border-color: var(--card-hover-border);
}

.butterfly-aside .item-headline {
  font-family: var(--title-font);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--card-border);
  letter-spacing: -0.01em;
}

.butterfly-aside .item-headline i {
  color: var(--primary-color);
  font-size: 16px;
}

/* Profile Widget (card-info) */
.card-info {
  text-align: center;
}

.card-info-avatar {
  position: relative;
  display: inline-block;
  margin-bottom: 14px;
}

.card-info-avatar .avatar-img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(124, 58, 237, 0.25);
  margin: 0 auto;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.2);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-info-avatar:hover .avatar-img {
  transform: rotate(360deg);
}

.card-info-avatar .avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Status Badge inside Avatar (Butterfly signature) */
.card-info-avatar .author-status-box {
  position: absolute;
  bottom: 2px;
  right: -4px;
  height: 30px;
  min-width: 30px;
  border-radius: 15px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  white-space: nowrap;
  max-width: 32px;
}

.card-info-avatar:hover .author-status-box,
.card-info-avatar .author-status-box:hover {
  max-width: 260px;
  padding: 0 10px;
}

.author-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.author-status .status-emoji {
  font-size: 14px;
}

.author-status .status-text {
  font-size: 11.5px;
  color: var(--text-main);
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
}

.card-info-avatar:hover .status-text,
.card-info-avatar .author-status-box:hover .status-text {
  opacity: 1;
}

.author-info__name {
  font-family: var(--title-font);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.015em;
}

.author-info__description {
  font-family: var(--global-font);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* 3-Column Stats Grid */
.card-info-data {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  padding: 12px 6px;
  background: var(--bg-page);
  border-radius: 12px;
  border: 1px solid var(--card-border);
}

.card-info-data a {
  flex: 1;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.card-info-data a:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.card-info-data .headline {
  font-family: var(--global-font);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.card-info-data .length-num {
  font-family: 'Quicksand', var(--title-font);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
}

/* Card Button */
#card-info-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 18px;
  background: linear-gradient(135deg, #7c3aed 0%, #38bdf8 100%);
  color: #ffffff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  transition: all 0.25s ease;
  box-sizing: border-box;
  margin-bottom: 16px;
}

#card-info-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5);
  color: #ffffff;
  text-decoration: none;
}

.card-info-social-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.card-info-social-icons .social-icon-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-page);
  border: 1px solid var(--card-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.card-info-social-icons .social-icon-sm:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* Announcement Widget (card-announcement) */
.announcement_content {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-muted);
}

.announcement-highlight {
  font-weight: 600;
  color: var(--primary-color);
}

.announcement-tags-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.announcement-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

/* Open Source PRs Widget (card-oss) */
.oss-widget-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.oss-widget-item {
  display: block;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-page);
  border: 1px solid var(--card-border);
  text-decoration: none;
  transition: all 0.25s ease;
}

.oss-widget-item:hover {
  border-color: var(--card-hover-border);
  transform: translateX(4px);
  text-decoration: none;
}

.oss-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.oss-repo-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-star {
  font-size: 11px;
  color: #f59e0b;
  font-weight: 600;
}

.oss-item-brief {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 6px 0;
}

.oss-item-bottom {
  display: flex;
  align-items: center;
}

.badge-merged {
  font-size: 10.5px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.card-more-footer {
  margin-top: 14px;
  text-align: right;
  padding-top: 8px;
  border-top: 1px dashed var(--card-border);
}

.card-more-footer a {
  font-size: 12px;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease;
}

.card-more-footer a:hover {
  gap: 7px;
  text-decoration: none;
}

/* Reading Shelf Widget (card-reading) */
.mini-books-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mini-book-card,
.mini-book-card:visited {
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  background: var(--bg-page);
  border-radius: 10px;
  padding: 10px 8px 12px 8px;
  border: 1px solid var(--card-border);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
  overflow: hidden;
}

.mini-book-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-hover-border);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  text-decoration: none !important;
}

html[data-theme="dark"] .mini-book-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.mini-book-cover-wrap {
  width: 100%;
  aspect-ratio: 1 / 1.45;
  border-radius: 3px 6px 6px 3px;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
  box-shadow: -2px 4px 12px rgba(0, 0, 0, 0.22), 0 1px 3px rgba(0, 0, 0, 0.08);
  border-left: 2px solid rgba(255, 255, 255, 0.35);
  background: #0f172a;
}

.mini-book-cover-wrap::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.45), transparent);
  z-index: 2;
  pointer-events: none;
}

.mini-cover-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.mini-book-card:hover .mini-cover-thumb {
  transform: scale(1.04);
}

.mini-title,
.mini-book-card:visited .mini-title {
  font-family: var(--title-font);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main) !important;
  line-height: 1.35;
  margin: 0 0 4px 0;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.mini-book-card:hover .mini-title {
  color: var(--primary-color) !important;
}

.mini-author {
  font-family: var(--global-font);
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sticky Sidebar Wrapper */
.sticky_layout {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* 6. Butterfly Style Modern Pagination */
.butterfly-pagination {
  margin-top: 36px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.butterfly-pagination .pagination-track {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.butterfly-pagination .page-number,
.butterfly-pagination .page-prev-btn,
.butterfly-pagination .page-next-btn {
  font-family: 'Quicksand', var(--title-font);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.25s ease;
}

.butterfly-pagination .page-number:hover,
.butterfly-pagination .page-prev-btn:hover:not(.disabled),
.butterfly-pagination .page-next-btn:hover:not(.disabled) {
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary-color);
  text-decoration: none;
  transform: translateY(-2px);
}

.butterfly-pagination .page-number.current {
  background: linear-gradient(135deg, #7c3aed 0%, #38bdf8 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.butterfly-pagination .disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.butterfly-pagination .pagination-info {
  font-size: 12px;
  color: var(--text-muted);
}



/* ==========================================================================
   3-Column Article Card Grid (Target Layout from Reference Image)
   ========================================================================== */
.articles-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  margin-bottom: 32px;
}

@media (max-width: 1320px) and (min-width: 1050px) {
  .articles-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 1049px) and (min-width: 680px) {
  .articles-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 679px) {
  .articles-card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.article-grid-card {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  background: rgba(18, 22, 34, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.35s ease;
  display: flex;
  flex-direction: column;
}

.article-grid-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 42px -10px rgba(0, 0, 0, 0.65), 0 0 24px rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.38);
}

/* Card Cover Container with Chevron Point Notch */
.card-cover-container {
  position: relative;
  width: 100%;
  height: 195px;
  overflow: hidden;
  background-color: #0b0f19;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 50% 100%, 0 calc(100% - 14px));
  -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 50% 100%, 0 calc(100% - 14px));
}

.card-cover-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  text-decoration: none;
}

.card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.article-grid-card:hover .card-cover-img {
  transform: scale(1.08);
}

.card-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 15, 25, 0.45) 0%, rgba(11, 15, 25, 0.72) 60%, rgba(11, 15, 25, 0.94) 100%);
  pointer-events: none;
  transition: background 0.3s ease;
}

.article-grid-card:hover .card-cover-overlay {
  background: linear-gradient(180deg, rgba(11, 15, 25, 0.35) 0%, rgba(11, 15, 25, 0.65) 60%, rgba(11, 15, 25, 0.90) 100%);
}

/* Downward Caret Indicator */
.card-quote-indicator {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #38bdf8;
  font-size: 15px;
  z-index: 3;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
  pointer-events: none;
  animation: floatIndicator 2.4s ease-in-out infinite;
}

@keyframes floatIndicator {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(3px); }
}

/* Quote in 「...」 */
.card-quote-content {
  position: absolute;
  top: 28px;
  left: 16px;
  right: 16px;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #f8fafc;
  font-size: 13.5px;
  line-height: 1.65;
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
  z-index: 3;
  padding: 0 8px;
  pointer-events: none;
  overflow: hidden;
}

/* Bottom Body */
.card-body-content {
  padding: 16px 18px 18px 18px;
  background: rgba(18, 22, 34, 0.88);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-article-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.015em;
}

.card-article-title a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.article-grid-card:hover .card-article-title a {
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.card-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(203, 213, 225, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta-line i {
  color: #38bdf8;
  font-size: 11px;
}

.meta-tag-pin {
  color: #f87171;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.meta-tag-pin i {
  color: #ef4444;
}

.meta-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.meta-tag-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #a78bfa;
  font-weight: 500;
}

.meta-tag-category i {
  color: #c084fc;
}

.meta-tag-tags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-separator {
  color: rgba(255, 255, 255, 0.2);
  margin: 0 1px;
}

/* Homepage Bottom Acrylic Dashboard Widgets */
.homepage-widgets-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 1200px) {
  .homepage-widgets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .homepage-widgets-grid {
    grid-template-columns: 1fr;
  }
}

.homepage-widgets-grid .card-widget {
  background: rgba(18, 22, 34, 0.82) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
  margin-bottom: 0 !important;
  color: #f1f5f9;
}

