/**
 * 极客猿 AI brand tokens — 开发方案 v1.0 §九
 */
:root,
[data-bs-theme="light"] {
  --ri-blue: #16c784;
  --ri-primary: #16c784;
  --ri-primary-rgb: 22, 199, 132;
  --ri-primary-text: #0a5c3d;
  --ri-primary-bg-subtle: #e6f9f0;
  --ri-success: #16c784;
  --ri-body-color: #17212b;
  --ri-body-bg: #f3f5f7;
  --ri-secondary-bg: #ffffff;
  --geekape-deep: #081712;
  --geekape-primary: #16c784;
  --geekape-page: #f3f5f7;
  --geekape-card: #ffffff;
  --geekape-text: #17212b;
  --geekape-muted: #5d616e;
  --geekape-glow: rgba(22, 199, 132, 0.45);
}

[data-bs-theme="dark"] {
  --ri-blue: #16c784;
  --ri-primary: #16c784;
  --ri-primary-rgb: 22, 199, 132;
  --ri-primary-text: #7dffc0;
  --ri-primary-bg-subtle: #0d2a1f;
  --ri-body-color: #e6e8ec;
  --ri-body-bg: #1a1d24;
  --ri-secondary-bg: #21242b;
  --geekape-page: #1a1d24;
  --geekape-card: #21242b;
  --geekape-text: #e6e8ec;
  --geekape-muted: #9aa3b2;
  --geekape-glow: rgba(22, 199, 132, 0.35);
}

body {
  color: var(--geekape-text);
  background-color: var(--geekape-page);
}

[data-bs-theme="light"] body,
[data-bs-theme="light"] .site,
[data-bs-theme="light"] #content,
[data-bs-theme="light"] .site-content {
  background-color: var(--geekape-page);
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .site,
[data-bs-theme="dark"] #content,
[data-bs-theme="dark"] .site-content {
  background-color: var(--geekape-page);
  color: var(--geekape-text);
}

/* —— Logo —— */
.logo-wrapper img.logo.regular,
.logo-wrapper .logo.regular {
  min-width: 120px;
  max-height: 44px;
  width: auto;
  height: auto;
}

@media (min-width: 992px) {
  .logo-wrapper img.logo.regular,
  .logo-wrapper .logo.regular {
    max-height: 48px;
    min-width: 140px;
  }
}

/* —— Banner / search hero —— */
.home-search-box .search-bg,
.widget_ri_home_search_widget .search-bg {
  min-height: 380px;
  background-color: var(--geekape-deep);
  overflow: hidden;
}

@media (min-width: 992px) {
  .home-search-box .search-bg,
  .widget_ri_home_search_widget .search-bg {
    min-height: 440px;
  }
}

.home-search-box .search-bg-overlay,
.widget_ri_home_search_widget .search-bg-overlay {
  background:
    radial-gradient(ellipse 80% 60% at 15% 85%, rgba(22, 199, 132, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 90%, rgba(22, 199, 132, 0.14), transparent 50%),
    linear-gradient(135deg, rgba(8, 23, 18, 0.78) 0%, rgba(8, 23, 18, 0.45) 55%, rgba(8, 23, 18, 0.62) 100%);
  pointer-events: none;
}

.home-search-box .search-title,
.widget_ri_home_search_widget .search-title {
  font-weight: 750;
  letter-spacing: 0.03em;
  text-shadow: 0 0 24px rgba(22, 199, 132, 0.35), 0 2px 12px rgba(0, 0, 0, 0.35);
}

.home-search-box .search-desc,
.widget_ri_home_search_widget .search-desc {
  opacity: 0.92;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.home-search-box .search-hots,
.widget_ri_home_search_widget .search-hots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
}

.home-search-box .search-hots a,
.widget_ri_home_search_widget .search-hots a {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  margin: 0 !important;
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  line-height: 1.35;
  background: rgba(22, 199, 132, 0.15);
  color: #fff !important;
  border: 1px solid rgba(22, 199, 132, 0.4);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.home-search-box .search-hots a:hover,
.widget_ri_home_search_widget .search-hots a:hover {
  background: rgba(22, 199, 132, 0.38);
  border-color: rgba(22, 199, 132, 0.85);
  box-shadow: 0 0 16px var(--geekape-glow);
  transform: translateY(-1px) scale(1.03);
}

/* Hero entrance */
@keyframes geekape-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes geekape-glow-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(22, 199, 132, 0);
  }
  50% {
    box-shadow: 0 0 28px rgba(22, 199, 132, 0.18);
  }
}

.geekape-motion .home-search-box .search-title,
.geekape-motion .widget_ri_home_search_widget .search-title,
.geekape-motion .home-search-box .search-desc,
.geekape-motion .widget_ri_home_search_widget .search-desc,
.geekape-motion .home-search-box .search-form,
.geekape-motion .widget_ri_home_search_widget .search-form,
.geekape-motion .home-search-box form,
.geekape-motion .widget_ri_home_search_widget form,
.geekape-motion .home-search-box .search-hots,
.geekape-motion .widget_ri_home_search_widget .search-hots {
  opacity: 0;
  animation: geekape-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.geekape-motion .home-search-box .search-title,
.geekape-motion .widget_ri_home_search_widget .search-title {
  animation-delay: 0.08s;
}

.geekape-motion .home-search-box .search-desc,
.geekape-motion .widget_ri_home_search_widget .search-desc {
  animation-delay: 0.18s;
}

.geekape-motion .home-search-box .search-form,
.geekape-motion .widget_ri_home_search_widget .search-form,
.geekape-motion .home-search-box form,
.geekape-motion .widget_ri_home_search_widget form {
  animation-delay: 0.28s;
}

.geekape-motion .home-search-box .search-hots,
.geekape-motion .widget_ri_home_search_widget .search-hots {
  animation-delay: 0.4s;
}

.geekape-motion .home-search-box .search-bg.geekape-hero-ready,
.geekape-motion .widget_ri_home_search_widget .search-bg.geekape-hero-ready {
  animation: geekape-glow-pulse 5s ease-in-out infinite;
}

/* Section reveal on scroll */
.geekape-motion .geekape-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--geekape-delay, 0s);
}

.geekape-motion .geekape-reveal.is-inview {
  opacity: 1;
  transform: translateY(0);
}

/* —— Cards —— */
.post-item,
.card,
.entry-card,
.home-cat-box .item,
.widget_ri_home_catbox_widget .item {
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.entry-media img,
.post-item .entry-media,
.card-img,
.card-img-top {
  border-radius: 10px;
}

.geekape-motion .post-item:hover,
.geekape-motion .card:hover,
.geekape-motion .entry-card:hover,
.geekape-motion .home-cat-box .item:hover,
.geekape-motion .widget_ri_home_catbox_widget .item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(8, 23, 18, 0.12), 0 0 0 1px rgba(22, 199, 132, 0.28);
}

.geekape-motion .widget_ri_home_division_widget .item,
.geekape-motion .home-division .item {
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.geekape-motion .widget_ri_home_division_widget .item:hover,
.geekape-motion .home-division .item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(22, 199, 132, 0.16);
}

/* —— Links / accents —— */
a:hover {
  color: var(--geekape-primary);
}

.navbar .nav-link.active,
.site-header .current-menu-item > a,
.site-header .current_page_item > a {
  color: var(--geekape-primary) !important;
}

.btn-primary,
.btn-success,
button[type="submit"].btn,
.login-btn,
a.btn-primary {
  --ri-btn-bg: var(--geekape-primary);
  --ri-btn-border-color: var(--geekape-primary);
  --ri-btn-hover-bg: #12a86e;
  --ri-btn-hover-border-color: #12a86e;
  background-color: var(--geekape-primary) !important;
  border-color: var(--geekape-primary) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-success:hover,
a.btn-primary:hover,
.login-btn:hover {
  background-color: #12a86e !important;
  border-color: #12a86e !important;
}

.text-primary,
.link-primary {
  color: var(--geekape-primary) !important;
}

.badge.bg-primary,
.bg-primary {
  background-color: var(--geekape-primary) !important;
}

/* —— Division / business entry —— */
.widget_ri_home_division_widget .icon,
.home-division .icon {
  border-radius: 12px;
}

/* —— Brand intro background block —— */
.widget_ri_home_background_widget .home-background,
.home-background {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(22, 199, 132, 0.22), 0 12px 40px rgba(8, 23, 18, 0.18);
}

/* —— Reduced motion —— */
@media (prefers-reduced-motion: reduce) {
  .geekape-motion .home-search-box .search-title,
  .geekape-motion .widget_ri_home_search_widget .search-title,
  .geekape-motion .home-search-box .search-desc,
  .geekape-motion .widget_ri_home_search_widget .search-desc,
  .geekape-motion .home-search-box .search-form,
  .geekape-motion .widget_ri_home_search_widget .search-form,
  .geekape-motion .home-search-box form,
  .geekape-motion .widget_ri_home_search_widget form,
  .geekape-motion .home-search-box .search-hots,
  .geekape-motion .widget_ri_home_search_widget .search-hots,
  .geekape-motion .home-search-box .search-bg.geekape-hero-ready,
  .geekape-motion .widget_ri_home_search_widget .search-bg.geekape-hero-ready {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .geekape-motion .geekape-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .geekape-motion .post-item:hover,
  .geekape-motion .card:hover,
  .geekape-motion .entry-card:hover,
  .geekape-motion .home-cat-box .item:hover,
  .geekape-motion .widget_ri_home_catbox_widget .item:hover,
  .geekape-motion .widget_ri_home_division_widget .item:hover,
  .geekape-motion .home-division .item:hover,
  .home-search-box .search-hots a:hover,
  .widget_ri_home_search_widget .search-hots a:hover {
    transform: none !important;
  }
}

html.geekape-reduce-motion .geekape-reveal {
  opacity: 1;
  transform: none;
}

/* —— AI 资讯 / 日报归档 —— */
.geekape-news-archive .archive-hero {
  background: linear-gradient(135deg, #081712 0%, #0d3d2c 55%, #12352a 100%);
}

.geekape-news-archive .archive-hero .archive-title {
  color: #fff;
  letter-spacing: 0.02em;
}

.geekape-news-archive .archive-hero .archive-desc {
  color: rgba(255, 255, 255, 0.82);
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

.geekape-news-archive .archive-hero-bg {
  opacity: 0.35;
}

.geekape-daily-archive .entry-content,
.geekape-daily-archive .post-content,
.single-post .entry-content,
.single-post .post-content {
  line-height: 1.75;
}

.single-post .entry-content img.article-image,
.single-post .entry-content img.geekape-cover,
.single-post .post-content img.article-image,
.single-post .post-content img.geekape-cover {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0.75rem 0;
}

.single-post .entry-content .video-container,
.single-post .post-content .video-container {
  position: relative;
  margin: 1rem 0;
}

.single-post .entry-content .article-video,
.single-post .post-content .article-video {
  width: 100%;
  max-height: 480px;
  background: #0a1210;
  border-radius: 8px;
}

/* —— Dark mode: article / meta / category / sidebar / tabs —— */
[data-bs-theme="dark"] .post-content {
  color: var(--geekape-text);
}

[data-bs-theme="dark"] .post-content a:not(.btn) {
  color: var(--geekape-primary);
}

[data-bs-theme="dark"] .post-content a:not(.btn):hover {
  color: var(--ri-primary-text);
}

[data-bs-theme="dark"] .article-header .article-meta a,
[data-bs-theme="dark"] .article-header .article-meta span {
  color: var(--geekape-muted);
}

[data-bs-theme="dark"] .article-header .article-meta a:hover,
[data-bs-theme="dark"] .meta-cat-dot a:hover {
  color: var(--geekape-primary);
}

[data-bs-theme="dark"] .meta-cat-dot a,
[data-bs-theme="dark"] .post-item .entry-cat-dot > a {
  color: var(--geekape-muted);
}

[data-bs-theme="dark"] .post-item .entry-cat-dot > a:hover {
  color: var(--geekape-primary);
}

[data-bs-theme="dark"] .post-item .entry-cat-dot > a:first-child::before {
  background-color: rgba(22, 199, 132, 0.85);
}

[data-bs-theme="dark"] .filter-warp .filter-item .filter-link > a {
  color: var(--geekape-muted);
}

[data-bs-theme="dark"] .filter-warp .filter-item .filter-link > a:hover,
[data-bs-theme="dark"] .filter-warp .filter-item .filter-link > a.active {
  color: var(--geekape-primary);
  background: rgba(22, 199, 132, 0.12);
}

[data-bs-theme="dark"] .sidebar .widget_search input[type="search"],
[data-bs-theme="dark"] .sidebar .widget_search input[type="text"],
[data-bs-theme="dark"] .sidebar .widget_search input {
  color: var(--geekape-text);
  background-color: #161920;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .sidebar .widget_search input:focus {
  background-color: #161920;
  border-color: var(--geekape-primary);
  box-shadow: 0 0 0 3px rgba(22, 199, 132, 0.18);
  outline: 0;
}

[data-bs-theme="dark"] .sidebar .widget_search .search-submit,
[data-bs-theme="dark"] .sidebar .widget_search button[type="submit"],
[data-bs-theme="dark"] .sidebar .search-form .search-fields button {
  color: #fff;
  background-color: var(--geekape-primary);
  border: 1px solid var(--geekape-primary);
  border-radius: 0.5rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  line-height: 1.5;
  cursor: pointer;
}

[data-bs-theme="dark"] .sidebar .widget_search .search-submit:hover,
[data-bs-theme="dark"] .sidebar .widget_search button[type="submit"]:hover,
[data-bs-theme="dark"] .sidebar .search-form .search-fields button:hover {
  background-color: #12a86e;
  border-color: #12a86e;
  color: #fff;
}

[data-bs-theme="dark"] .sidebar .search-form .search-fields input {
  color: var(--geekape-text);
  background-color: #161920;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .sidebar .search-form .search-fields input:focus {
  border-color: var(--geekape-primary);
  box-shadow: 0 0 0 3px rgba(22, 199, 132, 0.18);
  outline: 0;
}

[data-bs-theme="dark"] .sidebar .widget .widget-title {
  color: var(--geekape-text);
}

[data-bs-theme="dark"] .single-content-nav .nav-item .nav-link {
  border-color: rgba(22, 199, 132, 0.28);
  color: #9fd9c0;
}

[data-bs-theme="dark"] .single-content-nav .nav-item .nav-link:hover {
  background-color: rgba(22, 199, 132, 0.12);
  border-color: var(--geekape-primary);
  color: var(--geekape-primary);
}

[data-bs-theme="dark"] .single-content-nav .nav-item .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, #16c784, #12a86e);
  box-shadow: 0 4px 15px rgba(22, 199, 132, 0.35);
}

[data-bs-theme="dark"] .geekape-news-archive .filter-warp,
[data-bs-theme="dark"] .geekape-daily-archive .filter-warp {
  background-color: var(--geekape-card);
}

[data-bs-theme="dark"] .geekape-news-archive .post-item .entry-title a,
[data-bs-theme="dark"] .geekape-daily-archive .post-item .entry-title a {
  color: var(--geekape-text);
}

[data-bs-theme="dark"] .geekape-news-archive .post-item .entry-title a:hover,
[data-bs-theme="dark"] .geekape-daily-archive .post-item .entry-title a:hover {
  color: var(--geekape-primary);
}

/* =========================================================
   Homepage custom sections: 快捷入口 / 自媒体创作 / AI资源（提示词） / AI导航
   ========================================================= */
.ga-quick-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.ga-quick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 112px;
  padding: 1rem 0.75rem;
  border-radius: 12px;
  color: #fff !important;
  text-decoration: none !important;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ga-quick-card::before,
.ga-quick-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.ga-quick-card::before {
  width: 96px;
  height: 96px;
  top: -22px;
  right: 12%;
}

.ga-quick-card::after {
  width: 72px;
  height: 72px;
  bottom: -24px;
  left: 14%;
}

.ga-quick-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.ga-quick-card--emerald {
  background: linear-gradient(135deg, #0d5c3e 0%, #0b3f2c 100%);
}
.ga-quick-card--ocean {
  background: linear-gradient(135deg, #0d3b66 0%, #0a2540 100%);
}
.ga-quick-card--violet {
  background: linear-gradient(135deg, #3b1d70 0%, #241247 100%);
}
.ga-quick-card--amber {
  background: linear-gradient(135deg, #6e450c 0%, #472b07 100%);
}
.ga-quick-card--forest {
  background: linear-gradient(135deg, #0c3b28 0%, #072419 100%);
}

.ga-quick-card__badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 0.16rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.ga-quick-card__title {
  position: relative;
  z-index: 1;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

@media (max-width: 991.98px) {
  .ga-quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .ga-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .ga-quick-card {
    min-height: 86px;
    padding: 0.75rem 0.5rem;
  }
  .ga-quick-card__title {
    font-size: 0.95rem;
  }
}

.ga-home-social-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.ga-home-prompts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.ga-home-prompts-grid .ga-prompt-card {
  margin-bottom: 0;
}

.ga-home-nav-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1199.98px) {
  .ga-home-social-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .ga-home-prompts-grid,
  .ga-home-nav-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .ga-home-social-grid,
  .ga-home-prompts-grid,
  .ga-home-nav-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 479.98px) {
  .ga-home-prompts-grid,
  .ga-home-nav-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Homepage Mobile Optimization (<= 767.98px)
   ========================================================= */
@media (max-width: 767.98px) {
  /* Header: tighter spacing so logo + action icons breathe */
  .site-header .logo-wrapper img,
  .site-header .logo-img {
    max-height: 30px;
    width: auto;
  }

  .site-header .action-btn {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }

  /* Hero search section: compact height, no empty bottom gap */
  .home-search-box .search-bg,
  .widget_ri_home_search_widget .search-bg {
    min-height: 0 !important;
    padding: 2rem 0 1.75rem !important;
  }

  .home-search-box .search-title,
  .widget_ri_home_search_widget .search-title {
    font-size: 1.5rem !important;
    line-height: 1.3;
    margin-bottom: 0.5rem !important;
  }

  .home-search-box .search-desc,
  .widget_ri_home_search_widget .search-desc {
    font-size: 0.85rem !important;
    line-height: 1.55;
    margin-bottom: 1rem !important;
  }

  .home-search-box .search-form,
  .widget_ri_home_search_widget .search-form {
    margin-bottom: 0.85rem !important;
  }

  .home-search-box .search-hots,
  .widget_ri_home_search_widget .search-hots {
    gap: 0.4rem;
    font-size: 0.78rem;
    margin-top: 0.5rem !important;
  }

  .home-search-box .search-hots > span,
  .widget_ri_home_search_widget .search-hots > span {
    font-size: 0.78rem;
    opacity: 0.82;
  }

  .home-search-box .search-hots a,
  .widget_ri_home_search_widget .search-hots a {
    font-size: 0.78rem;
    padding: 0.2rem 0.65rem;
  }

  /* Category quick boxes: compact cards */
  .widget_ri_home_catbox_widget .item {
    border-radius: 12px;
    min-height: 92px;
  }

  .widget_ri_home_catbox_widget .item h4,
  .widget_ri_home_catbox_widget .item .title {
    font-size: 0.95rem;
  }

  /* Four-grid division cards: tighter padding & icon size */
  .widget_ri_home_division_widget .item,
  .home-division .item {
    padding: 0.85rem 0.75rem !important;
    border-radius: 12px;
  }

  .widget_ri_home_division_widget .icon,
  .home-division .icon {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }

  /* Section spacing & titles */
  .home .section-title {
    margin-bottom: 1.1rem !important;
  }

  .home .section-title h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
  }

  .home .section-title p {
    font-size: 0.82rem;
  }

  /* Custom homepage grids on mobile */
  .ga-home-social-grid {
    gap: 10px;
  }

  .ga-home-prompts-grid,
  .ga-home-nav-grid {
    gap: 10px;
  }

  /* Ensure footer content is not covered by fixed mobile bottom bar */
  body.home {
    padding-bottom: 64px;
  }
}
