﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

main {
    padding-bottom:30px;
}

/* 卡片白色背景，避免透出灰色 */
.card,
.article-card {
  background: #fff;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ===== Header / Navbar ===== */
/* Active nav link: 加粗 + 下划线指示器 */
.navbar-dark .navbar-nav .nav-link.active {
  font-weight: 600;
  position: relative;
}

@media (min-width: 576px) {
  .navbar-dark .navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 8px;
    right: 8px;
    height: 2px;
    background-color: rgba(255,255,255,.7);
    border-radius: 1px;
  }
}

/* 移动端：active 项左侧标记 */
@media (max-width: 575.98px) {
  .navbar-dark .navbar-nav .nav-link.active {
    padding-left: 1.25rem;
  }
  .navbar-dark .navbar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background-color: rgba(255,255,255,.8);
    border-radius: 2px;
  }
  .navbar-dark .navbar-nav .nav-link {
    padding-left: 1.25rem;
    position: relative;
  }
}

/* 导航项 hover 微交互 */
.navbar-dark .navbar-nav .nav-link {
    transition: opacity .15s ease;
    position: relative;
    color: #ffffff;
}

.navbar-dark .navbar-nav .nav-link:hover {
  opacity: .85;
}

/* 用户头像圆形 */
.navbar .user-avatar {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

/* ===== Hero Section ===== */
.hero-section {
  background: linear-gradient(135deg, #2163e8 0%, #4a22a3 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before,
.hero-section::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-section::before {
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,.06);
  top: -80px;
  right: -60px;
}

.hero-section::after {
  width: 180px;
  height: 180px;
  background: rgba(255,255,255,.08);
  bottom: -40px;
  left: -40px;
}

/* ===== Article Card Hover ===== */
.article-card {
  transition: transform .3s ease, box-shadow .3s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 .5rem 1.5rem rgba(33,99,232,.12);
}

/* ===== Category Card Hover ===== */
.category-card {
  transition: transform .2s ease, box-shadow .2s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .25rem .75rem rgba(33,99,232,.15);
}

/* ===== Responsive: Mobile (<576px) ===== */
@media (max-width: 575.98px) {
  .hero-section {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  .hero-section h1 {
    font-size: calc(1.425rem + 2.1vw);
  }

  .hero-section .btn-lg {
    padding: .375rem .75rem;
    font-size: 1rem;
    border-radius: .25rem;
  }

  .hero-section .lead {
    font-size: 1rem;
  }

  .article-card .card-body {
    padding: 1rem;
  }
}

/* ===== CSS 变量主题系统 ===== */
:root {
  --bs-primary: #2163e8;
  --primary-gradient: linear-gradient(135deg, #2163e8 0%, #4a22a3 100%);
  --card-radius: 12px;
  --card-shadow: 0 2px 12px rgba(0,0,0,.08);
  --card-shadow-hover: 0 8px 24px rgba(33,99,232,.15);
  --transition-speed: .3s;
  --glass-bg: rgba(255,255,255,.85);
  --glass-blur: blur(12px);
  --code-bg: #1e1e1e;
  --file-list-bg: #f8f9fa;
}

/* ===== 毛玻璃导航栏 ===== */
.navbar-glass {
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 1px 8px rgba(0,0,0,.08);
  border-bottom: 1px solid rgba(0,0,0,.05);
}

.navbar-glass .navbar-brand,
.navbar-glass .nav-link {
  color: #333 !important;
}

.navbar-glass .nav-link.active {
  color: var(--bs-primary, #2163e8) !important;
  font-weight: 600;
}

.navbar-glass .navbar-brand {
  color: var(--bs-primary, #2163e8) !important;
  font-weight: 700;
}

/* ===== 动画关键帧 ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes countUp {
  from { opacity: 0; transform: scale(.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

/* ===== 动画工具类 ===== */
.fade-in-up {
  animation: fadeInUp .6s ease forwards;
}

.fade-in-up-delay-1 {
  animation: fadeInUp .6s ease .1s forwards;
  opacity: 0;
}

.fade-in-up-delay-2 {
  animation: fadeInUp .6s ease .2s forwards;
  opacity: 0;
}

.fade-in-up-delay-3 {
  animation: fadeInUp .6s ease .3s forwards;
  opacity: 0;
}

/* ===== 毛玻璃卡片 ===== */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.card-glass:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover);
}

/* ===== 文章卡片增强 ===== */
.article-card {
  border-radius: var(--card-radius) !important;
  overflow: hidden;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover);
}

.article-card:hover .card-img-top {
  transform: scale(1.05);
}



.file-list {
  background: var(--file-list-bg);
}

.file-item {
  cursor: pointer;
  transition: background-color .15s ease;
}

.file-item:hover {
  background-color: #e9ecef;
}

.file-item.active {
  background-color: #e2e6f0;
  border-left: 3px solid var(--bs-primary, #2163e8);
}

.file-icon {
  margin-right: 4px;
  font-size: 14px;
}

.code-preview {
  background: var(--code-bg);
}

.code-preview pre {
  margin: 0 !important;
  padding: 16px !important;
  background: transparent !important;
}

.code-preview code {
  font-size: 13px;
  line-height: 1.5;
}

/* ===== 分页美化 ===== */
.pagination .page-link {
  border-radius: 50px !important;
  margin: 0 2px;
  padding: .375rem .75rem;
  border: 1px solid #dee2e6;
  transition: all .2s ease;
}

.pagination .page-link:hover {
  background-color: var(--bs-primary, #2163e8);
  color: #fff;
  border-color: var(--bs-primary, #2163e8);
}

.pagination .page-item.active .page-link {
  background-color: var(--bs-primary, #2163e8);
  border-color: var(--bs-primary, #2163e8);
  border-radius: 50px !important;
}

/* ===== 产品列表页隔离 ===== */
.products-page .card {
  border-radius: var(--card-radius) !important;
  overflow: hidden;
  background: #fff;
}

.products-page .card-img-top {
  aspect-ratio: 3/2;
  object-fit: cover;
}

/* ===== 卡片图片统一 3:2 比例 ===== */
.article-card .card-img-top {
  aspect-ratio: 3/2;
  object-fit: cover;
  transition: transform .4s ease;
}

/* ===== 导航栏紫色悬停效果 ===== */
.navbar-glass .nav-link:hover {
  color: #8224e3 !important;
}

/* ===== 响应式字号缩放 (参考 ecloub vw 方案) ===== */
h1 { font-size: calc(1.375rem + 1.5vw); }
h2 { font-size: calc(1.275rem + 1.2vw); }
h3 { font-size: calc(1.2rem + 0.9vw); }
h4 { font-size: calc(1.1rem + 0.6vw); }

@media (max-width: 575.98px) {
  h1 { font-size: calc(1.275rem + 1.2vw); }
  h2 { font-size: calc(1.175rem + 0.9vw); }
  h3 { font-size: calc(1.1rem + 0.6vw); }
  h4 { font-size: calc(1.05rem + 0.3vw); }
}

/* ===== 分类 Badge 色彩系统 ===== */
.badge-category-产品 { background-color: #2163e8; }
.badge-category-网站源码 { background-color: #dc3545; }
.badge-category-小程序源码 { background-color: #0d6efd; }
.badge-category-游戏源码 { background-color: #198754; }
.badge-category-开发教程 { background-color: #0dcaf0; color: #000; }
.badge-category-default { background-color: #6c757d; }

/* ===== 全局过渡 ===== */
.hero-section {
  transition: all .3s ease;
/* ===== 全局过渡 ===== */
.hero-section {
  transition: all .3s ease;
}

/* ===== 产品详情页 ===== */
.product-detail-page .post-title {
  font-size: calc(1.3rem + 1.2vw);
  line-height: 1.3;
  color: #1a1a2e;
}
.product-detail-page .article-meta {
  color: #6c757d;
  font-size: 0.875rem;
}
.product-detail-page .article-meta .meta-cat-dot a {
  color: #2163e8;
  text-decoration: none;
  font-weight: 500;
}
.product-detail-page .post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
}
.product-detail-page .post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}
.product-detail-page .post-content p {
  margin-bottom: 1rem;
}
.product-detail-page .post-content h2,
.product-detail-page .post-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.product-detail-page .entry-copyright {
  background: #f8f9fa;
  border-left: 3px solid #2163e8;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.6;
}
.product-detail-page .entry-social .btn {
  transition: all 0.2s ease;
}
.product-detail-page .entry-social .btn:hover {
  transform: translateY(-1px);
}
.product-detail-page .sidebar .widget-title {
  color: #1a1a2e;
  font-size: 0.95rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f0f0f0;
}
.product-detail-page .related-posts-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a2e;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f0f0f0;
}
.product-detail-page .related-posts .entry-title {
  font-size: 0.85rem;
  line-height: 1.4;
}
.product-detail-page .related-posts .entry-title a {
  color: #333;
  transition: color 0.2s ease;
}
.product-detail-page .related-posts .entry-title a:hover {
  color: #2163e8;
}

/* ===== 社交按钮柔色变体 ===== */
.btn-info-soft {
  color: #0dcaf0;
  background-color: rgba(13, 202, 240, 0.1);
  border-color: transparent;
}
.btn-info-soft:hover {
  color: #fff;
  background-color: #0dcaf0;
}
.btn-success-soft {
  color: #198754;
  background-color: rgba(25, 135, 84, 0.1);
  border-color: transparent;
}
.btn-success-soft:hover {
  color: #fff;
  background-color: #198754;
}
.btn-danger-soft {
  color: #dc3545;
  background-color: rgba(220, 53, 69, 0.1);
  border-color: transparent;
}
.btn-danger-soft:hover {
  color: #fff;
  background-color: #dc3545;
}

/* ===== 侧边栏粘性 ===== */
@media (min-width: 992px) {
  .sidebar-wrapper {
    position: sticky;
    top: 1rem;
    align-self: flex-start;
  }
}

/* ===== 文章内容动画 ===== */
.product-detail-page .card {
  animation: fadeInUp 0.5s ease forwards;
}
.product-detail-page .card:nth-child(2) {
  animation-delay: 0.1s;
}
.product-detail-page .card:nth-child(3) {
  animation-delay: 0.2s;
}

/* ===== Product Detail - Hero Banner (AI模版2) ===== */
.product-detail-page .product-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}

.product-detail-page .product-hero .hero-bg {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 320px;
  display: flex;
  align-items: center;
  padding: 50px 40px;
}

.product-detail-page .product-hero .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.product-detail-page .product-hero .hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.product-detail-page .product-hero .hero-badge {
  margin-bottom: 16px;
}

.product-detail-page .product-hero .hero-badge .badge {
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
}

.product-detail-page .product-hero .hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.3;
}

.product-detail-page .product-hero .hero-desc {
  font-size: 1rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 600px;
}

.product-detail-page .product-hero .hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 8px;
}

.product-detail-page .product-hero .hero-meta .meta-item {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
}

.product-detail-page .product-hero .hero-actions .btn-outline-light {
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.9);
}

.product-detail-page .product-hero .hero-actions .btn-outline-light:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

/* ===== Product Detail - Section Header ===== */
.product-detail-page .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.product-detail-page .section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
  padding: 0;
  position: relative;
}

.product-detail-page .section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: #2163e8;
  border-radius: 2px;
  margin-top: 6px;
}

/* ===== Product Detail - Sidebar Title ===== */
.product-detail-page .sidebar-wrapper .sidebar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a2e;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f0f0f0;
}

/* ===== Features Section (AI模版2 style) ===== */
.product-detail-page .features-section {
  padding: 0;
}

.product-detail-page .feature-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px;
  padding: 28px 24px;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.product-detail-page .feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2163e8, #0dcaf0);
  opacity: 0.6;
}

.product-detail-page .feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.product-detail-page .feature-card .feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(33, 99, 232, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.3rem;
  color: #6ea8fe;
}

.product-detail-page .feature-card .feature-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.product-detail-page .feature-card .feature-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin-bottom: 0;
}

@media (max-width: 767.98px) {
  .product-detail-page .product-hero .hero-bg {
    min-height: 240px;
    padding: 30px 24px;
  }
  .product-detail-page .product-hero .hero-title {
    font-size: 1.5rem;
  }
  .product-detail-page .product-hero .hero-desc {
    font-size: 0.9rem;
  }
  .product-detail-page .product-hero .hero-meta {
    gap: 12px;
  }
  .product-detail-page .product-hero .hero-actions .btn {
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
  }
}