/* ============================================================
   官网自定义样式
   ============================================================ */

/* ========== 滚动动画 ========== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 延迟变体 */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

/* ========== 轮播（背景图+文字叠加） ========== */
.carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: 1rem;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-slide {
  min-width: 100%;
  flex-shrink: 0;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  aspect-ratio: 896 / 412;
  display: flex;
  align-items: center;
}

/* 轮播文字叠加层 */
.slide-overlay {
  position: relative;
  z-index: 2;
  padding: 40px 48px;
  max-width: 60%;
}

.slide-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  margin-bottom: 12px;
}

.slide-title {
  font-size: 36px;
  font-weight: 800;
  color: white;
  line-height: 1.2;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.slide-subtitle {
  font-size: 20px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

@media (max-width: 640px) {
  .slide-overlay {
    padding: 20px 24px;
    max-width: 80%;
  }
  .slide-title {
    font-size: 24px;
  }
  .slide-subtitle {
    font-size: 15px;
  }
  .slide-badge {
    font-size: 11px;
    padding: 3px 10px;
  }
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.carousel-btn:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.carousel-dot.active {
  background: #3B82F6;
  width: 28px;
  border-radius: 5px;
}

/* ========== 宣传海报（shanju.app 排版：img + 全遮罩 + 居中文字）========== */
.poster-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 16px auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.poster-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1320 / 2868;
  overflow: hidden;
  background-color: #1a1a2e;
}

/* 背景图 - 铺满容器 */
.poster-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 全图半透明遮罩 + 模糊玻璃效果（对齐 shanju.app） */
.poster-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 32, 0.42);
  backdrop-filter: saturate(2.1) blur(10px) brightness(1.04);
  -webkit-backdrop-filter: saturate(2.1) blur(10px) brightness(1.04);
  z-index: 1;
}

/* 文字内容容器 - 覆盖全图，padding 让文字内缩 */
.poster-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 10%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

/* 文字行通用 */
.poster-content > div {
  width: 100%;
}

/* 日期 */
.poster-row-date {
  font-size: clamp(18px, 4.8vw, 32px);
  opacity: 0.85;
  line-height: 1.15;
  margin-bottom: 0;
}

/* 时间 */
.poster-row-time {
  font-size: clamp(18px, 4.8vw, 32px);
  opacity: 0.85;
  line-height: 1.15;
  margin-top: 0.6em;
  margin-bottom: 1.2em;
}

/* 标题 App Name */
.poster-row-title {
  font-size: clamp(36px, 10vw, 66px);
  font-weight: 700;
  opacity: 1;
  line-height: 1.05;
  margin-bottom: 0.6em;
}

/* 副标题 */
.poster-row-subtitle {
  font-size: clamp(22px, 6.2vw, 42px);
  font-weight: 600;
  opacity: 1;
  line-height: 1.15;
  margin-bottom: 0.7em;
}

/* 特性 */
.poster-row-feature {
  font-size: clamp(18px, 4.8vw, 32px);
  opacity: 0.95;
  line-height: 1.2;
  margin-bottom: 1.1em;
}

/* 官网网址 */
.poster-row-site {
  font-size: clamp(20px, 5.6vw, 38px);
  font-weight: 600;
  opacity: 1;
  line-height: 1.15;
}

/* ========== 关键词标签 ========== */
.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 16px 0;
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: white;
  border: 1.5px solid #e5e7eb;
  border-radius: 999px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.keyword-chip:hover {
  border-color: #3B82F6;
  color: #3B82F6;
  background: #eff6ff;
  box-shadow: 0 2px 8px rgba(59,130,246,0.15);
}

.keyword-chip.copied {
  border-color: #10B981;
  color: #10B981;
  background: #ecfdf5;
}

.dark .keyword-chip {
  background: #1f2937;
  border-color: #374151;
  color: #d1d5db;
}

.dark .keyword-chip:hover {
  border-color: #60a5fa;
  color: #60a5fa;
  background: #1e3a5f;
}

.dark .keyword-chip.copied {
  border-color: #34d399;
  color: #34d399;
  background: #064e3b;
}

/* ========== FAQ 折叠面板 ========== */
.faq-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
}

.dark .faq-item {
  border-color: #374151;
}

.faq-item.active {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: #1f2937;
  text-align: left;
  transition: background 0.2s;
}

.dark .faq-question {
  color: #f3f4f6;
}

.faq-question:hover {
  background: rgba(59,130,246,0.05);
}

.faq-question .faq-icon {
  transition: transform 0.3s;
  flex-shrink: 0;
}

.faq-item.active .faq-question .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 20px;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.7;
}

.dark .faq-answer {
  color: #9ca3af;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 20px 20px;
}

/* ========== AI 助手浮窗 ========== */
/* 触发按钮 */
.chatbot-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  z-index: 1000;
  transition: all 0.3s ease;
}

.chatbot-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
}

.chatbot-btn:active {
  transform: scale(0.95);
}

.chatbot-btn svg {
  width: 24px;
  height: 24px;
}

/* 未读消息红点 */
.chatbot-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid white;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 聊天面板 */
.chatbot-panel {
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 352px;
  height: 480px;
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chatbot-panel.open {
  display: flex;
  animation: chatbotSlideUp 0.3s ease;
}

@keyframes chatbotSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dark .chatbot-panel {
  background: #1f2937;
}

/* 头部 */
.chatbot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: white;
  flex-shrink: 0;
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.chatbot-header-info {
  flex: 1;
  min-width: 0;
}

.chatbot-name {
  font-size: 14px;
  font-weight: 600;
}

.chatbot-status {
  font-size: 11px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chatbot-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.chatbot-close:hover {
  background: rgba(255,255,255,0.3);
}

.chatbot-close svg {
  width: 18px;
  height: 18px;
}

/* 消息区域 */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.dark .chatbot-messages {
  background: #111827;
}

.chatbot-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
  animation: msgIn 0.3s ease;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-msg.from-bot {
  align-self: flex-start;
  background: white;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

.dark .chatbot-msg.from-bot {
  background: #1f2937;
  color: #f3f4f6;
  border-color: #374151;
}

.chatbot-msg.from-user {
  align-self: flex-end;
  background: #3B82F6;
  color: white;
  border-bottom-right-radius: 4px;
}

/* 图片预览气泡 */
.chatbot-msg .msg-image {
  max-width: 200px;
  border-radius: 8px;
  margin-top: 6px;
  display: block;
}

/* 审核中加载动画 */
.chatbot-msg .review-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.chatbot-msg .review-loading .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #3B82F6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 小号加载旋转器 */
.spinner-sm {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 审核成功消息 */
.chatbot-msg .success-text {
  color: #059669;
  font-weight: 500;
}

/* 下载按钮容器 - 上下排列 */
.chatbot-msg .download-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.chatbot-msg .download-btns .download-link {
  flex: 1;
  justify-content: center;
  margin-top: 0;
}

.chatbot-msg .download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.chatbot-msg .download-link:hover {
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
  transform: translateY(-1px);
}

.chatbot-msg .download-link:last-child {
  background: linear-gradient(135deg, #10B981, #059669);
}

.chatbot-msg .download-link:last-child:hover {
  box-shadow: 0 4px 12px rgba(16,185,129,0.4);
}

.chatbot-msg .fail-text {
  color: #dc2626;
  font-weight: 500;
}

.chatbot-msg .retry-btn {
  margin-top: 8px;
  padding: 8px 16px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.chatbot-msg .retry-btn:hover {
  background: #e5e7eb;
}

.dark .chatbot-msg .retry-btn {
  background: #374151;
  color: #d1d5db;
  border-color: #4b5563;
}

.dark .chatbot-msg .retry-btn:hover {
  background: #4b5563;
}

/* 底部操作区 */
.chatbot-footer {
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: white;
  flex-shrink: 0;
}

.dark .chatbot-footer {
  background: #1f2937;
  border-top-color: #374151;
}

.chatbot-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: #eff6ff;
  border: 1.5px dashed #93c5fd;
  border-radius: 10px;
  color: #2563EB;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chatbot-upload-btn:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

.chatbot-upload-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chatbot-upload-btn svg {
  width: 18px;
  height: 18px;
}

.dark .chatbot-upload-btn {
  background: #1e3a5f;
  border-color: #3b82f6;
  color: #93c5fd;
}

.dark .chatbot-upload-btn:hover {
  background: #1e40af;
}

/* 已上传图片预览 */
.chatbot-uploads {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.chatbot-uploads .upload-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #dbeafe;
}

/* 缩略图容器 */
.upload-thumb-wrap {
  position: relative;
  display: inline-block;
}

/* 删除按钮（右上角红叉） */
.upload-thumb-del {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  border: 2px solid white;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: transform 0.15s;
}

.upload-thumb-del:hover {
  transform: scale(1.15);
}

.dark .upload-thumb-del {
  border-color: #1f2937;
}

.dark .chatbot-uploads .upload-thumb {
  border-color: #374151;
}

/* ========== 响应式适配 ========== */
@media (max-width: 480px) {
  .chatbot-panel {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 80px;
    height: 60vh;
  }

  .chatbot-btn {
    right: 12px;
    bottom: 12px;
    width: 50px;
    height: 50px;
  }

  .carousel-btn {
    width: 32px;
    height: 32px;
  }

  .poster-wrap {
    max-width: 260px;
  }

  .keyword-chip {
    font-size: 13px;
    padding: 6px 14px;
  }
}

/* ========== 深色模式滚动条 ========== */
.dark ::-webkit-scrollbar {
  width: 6px;
}

.dark ::-webkit-scrollbar-track {
  background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 3px;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}
