/* 基础变量定义 - 便于统一调整 */
:root {
  --primary: #165DFF; /* 主色调：专业蓝 */
  --gray-light: #f1f5f9;
  --gray-mid: #cbd5e1;
  --gray-dark: #334155;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 面包屑导航样式 */
nav[aria-label="Breadcrumb"] {
  max-width: 1200px;
  margin: 0 auto;
  transition: var(--transition);
}

nav[aria-label="Breadcrumb"] a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 500;
  display: inline-block;
  transition: var(--transition);
}

nav[aria-label="Breadcrumb"] a:hover {
  color: #0E42D2; /* 加深主色 */
  transform: translateY(-1px); /* 轻微上浮 */
}

nav[aria-label="Breadcrumb"] li:not(:last-child):after {
  content: ''; /* 保持结构完整性 */
}

nav[aria-label="Breadcrumb"] li[aria-current="page"] {
  font-weight: 600;
  transition: var(--transition);
}

@media (max-width: 640px) {
  nav[aria-label="Breadcrumb"] {
    padding: 0.75rem 1rem;
  }
  
  nav[aria-label="Breadcrumb"] a,
  nav[aria-label="Breadcrumb"] li[aria-current="page"] {
    padding: 0.25rem 0.75rem;
    font-size: 13px;
  }
  
  .mx-2 {
    margin: 0 0.25rem;
  }
}

/* 主图展示区样式 */
.main-preview-container {
  background-color: #f9fafb;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.main-preview-container:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

#main-preview {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  object-fit: cover;
  cursor: zoom-in;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: transform 0.5s ease;
}

/* 手机端主图适配（竖屏长方形） */
@media (max-width: 768px) {
  #main-preview {
    aspect-ratio: 9/16 !important; /* 手机竖屏比例（9:16） */
    object-position: top center; /* 优先显示顶部内容 */
  }
  
  /* 手机端缩略图改为2列 */
  #thumb-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  /* 手机端缩略图高度按屏幕比例适配 */
  .gallery-thumb {
    height: 18vw !important;
  }
}

/* 平板端微调（平衡显示比例） */
@media (min-width: 769px) and (max-width: 1024px) {
  #main-preview {
    aspect-ratio: 16/10;
  }
}

/* 强制手机端隐藏的样式 */
@media (max-width: 768px) {
  .main-preview-container {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }
}

/* 预览缩略图区样式 */
#thumb-container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  #thumb-container {
    gap: 1rem;
  }
}

#thumb-container > div {
  background-color: #f9fafb;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

#thumb-container > div:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.gallery-thumb {
  width: 100%;
  height: 6rem;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

@media (min-width: 768px) {
  .gallery-thumb {
    height: 6rem;
  }
}

.gallery-thumb:hover {
  transform: scale(1.05);
}

.gallery-thumb.active {
  outline: 2px solid var(--primary);
}

/* 图片查看大图模态框样式 */
#image-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#image-modal > div {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

/* 关闭按钮优化 */
#close-modal {
  position: absolute;
  top: -3rem;
  right: 0;
  color: white;
  font-size: 1.25rem;
  background-color: rgba(0, 0, 0, 0.2);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

#close-modal:hover {
  background-color: rgba(0, 0, 0, 0.4);
}

#modal-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.375rem;
}

/* 模板介绍部分样式 */
.custom-prose {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  font-size: 1rem;
  color: #4b5563;
  line-height: 1.75;
}

/* 标题字体层级 */
.custom-prose h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

.custom-prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

.custom-prose h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.custom-prose h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

/* 正文与段落 */
.custom-prose p {
  margin-bottom: 1.5rem;
  line-height: 1.75;
}

.custom-prose ul, .custom-prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  margin-left: 0.5rem;
}

.custom-prose li {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

/* 图片自适应 */
.custom-prose img {
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.custom-prose img:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 链接样式 */
.custom-prose a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(22, 93, 255, 0.3);
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.custom-prose a:hover {
  color: rgba(22, 93, 255, 0.8);
}

/* 其他元素调整 */
.custom-prose blockquote {
  border-left-width: 4px;
  border-left-color: var(--primary);
  padding-left: 1rem;
  font-style: italic;
  color: #6b7280;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.custom-prose strong {
  color: #111827;
  font-weight: 600;
}

.custom-prose em {
  color: #6b7280;
}

/* 模板特点部分样式 */
.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  background-color: rgba(22, 93, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-right: 1rem;
  flex-shrink: 0;
}

.feature-icon i {
  font-size: 1.25rem;
}

/* 技术细节部分样式 */
.bg-gray-light {
  background-color: #f9fafb;
}

/* 高级彩色标签云样式 */
.tag-cloud-container {
  position: relative;
  max-width: 1000px;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.tag-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 15px;
  border-radius: 30px;
  text-decoration: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.tag-text {
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  z-index: 2;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.tag-count {
  font-size: 10px;
  opacity: 0.7;
  transition: all 0.3s ease;
  z-index: 2;
  position: relative;
  padding-left: 4px;
}

/* 彩色背景方案 - 循环应用不同颜色 */
.tag-item:nth-child(8n+1) {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.tag-item:nth-child(8n+2) {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
}

.tag-item:nth-child(8n+3) {
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  color: #8b2131;
}

.tag-item:nth-child(8n+4) {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #15803d;
}

.tag-item:nth-child(8n+5) {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: #5b21b6;
}

.tag-item:nth-child(8n+6) {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #b91c1c;
}

.tag-item:nth-child(8n+7) {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0369a1;
}

.tag-item:nth-child(8n+8) {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #059669;
}

.tag-item:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.tag-item:hover .tag-text {
  font-weight: 600;
}

.tag-item:hover .tag-count {
  opacity: 1;
  transform: translateX(2px);
}

.tag-item:active {
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .tag-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }
  
  .tag-item {
    padding: 6px 12px;
  }
  
  .tag-text {
    font-size: 12px;
  }
}

/* 按钮样式 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  background-color: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  background-color: #6c757d;
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-secondary.w-full {
  width: 100%;
}

/* 模态框通用样式 */
.fixed-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-content {
  background-color: white;
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 28rem;
  width: 100%;
  margin-left: 1rem;
  margin-right: 1rem;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

/* 登录提示模态框样式 */
#demoLoginModal, #loginModal {
  background-color: rgba(0, 0, 0, 0.7);
}

#demoLoginModal .rounded-2xl,
#loginModal .rounded-2xl,
#paymentModal .rounded-2xl,
#successModal .rounded-2xl,
#riskModal .rounded-2xl {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* 付款模态框样式 */
#paymentModal, #successModal, #riskModal {
  background-color: rgba(0, 0, 0, 0.7);
}

#paymentModal .relative {
  position: relative;
}

#closePaymentModal, #closeRiskModal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #6b7280;
  transition: color 0.3s ease;
}

#closePaymentModal:hover, #closeRiskModal:hover {
  color: var(--primary);
}

/* 联系入口样式 */
.custom-icon {
  object-fit: contain;
}
