/* SciPen Studio 专用样式 */

/* ==================== Agent 对话演示区域 ==================== */
.agent-demo {
  position: relative;
  background: #1e293b;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 600px;
  margin: 0 auto;
}

.agent-window-header {
  background: #0f172a;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #334155;
}

.window-dots {
  display: flex;
  gap: 8px;
}

.window-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.window-dots span:nth-child(1) { background: #ef4444; }
.window-dots span:nth-child(2) { background: #f59e0b; }
.window-dots span:nth-child(3) { background: #10b981; }

.window-title {
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.95rem;
  flex: 1;
  text-align: center;
  margin-right: 60px;
}

/* 聊天容器 */
.agent-chat-container {
  padding: 1.5rem;
  background: #1e293b;
  overflow: hidden;
  height: 450px;
}

/* 聊天消息 */
.chat-message {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  opacity: 0;
  transform: translateY(10px);
  animation: messageSlideIn 0.4s ease forwards;
}

@keyframes messageSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 消息头像 */
.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 消息内容 */
.message-content {
  flex: 1;
  background: #0f172a;
  padding: 0.75rem 0.875rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid #334155;
  color: #e2e8f0;
}

.user-message .message-content {
  background: #1e3a5f;
  border-color: #2563eb;
  color: #e0f2fe;
}

.message-text {
  line-height: 1.6;
  font-size: 0.95rem;
}

/* 思考指示器 */
.thinking-indicator {
  display: flex;
  gap: 6px;
  padding: 0.5rem 0;
}

.thinking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60a5fa;
  animation: thinkingBounce 1.4s infinite ease-in-out;
}

.thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.thinking-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes thinkingBounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* 工具调用框 */
.tool-box {
  background: #0c1929;
  border: 1px solid #1e3a5f;
  border-radius: 8px;
  padding: 0.625rem;
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #60a5fa;
  margin-bottom: 0.375rem;
}

.tool-icon {
  font-size: 1.1rem;
}

.tool-name {
  font-size: 0.9rem;
}

.tool-status {
  color: #10b981;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* 输出框 */
.output-box {
  background: #0c1929;
  border: 1px solid #065f46;
  border-radius: 8px;
  padding: 0.625rem;
}

.output-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #34d399;
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.output-text {
  color: #a7f3d0;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* 打字机效果 */
.typing-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid #3b82f6;
  animation: typing 2s steps(40, end), blinkCursor 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blinkCursor {
  50% { border-color: transparent; }
}

/* ==================== 新增：Hero 区域代码动画效果 ==================== */
.hero-code-demo {
  position: relative;
  background: #1e293b;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.hero-code-demo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: #0f172a;
  border-bottom: 1px solid #334155;
}

.code-window-dots {
  position: absolute;
  top: 10px;
  left: 15px;
  display: flex;
  gap: 8px;
  z-index: 1;
}

.code-window-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-window-dots span:nth-child(1) { background: #ef4444; }
.code-window-dots span:nth-child(2) { background: #f59e0b; }
.code-window-dots span:nth-child(3) { background: #10b981; }

.code-content {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.8;
  color: #e2e8f0;
  margin-top: 30px;
}

.code-line {
  display: flex;
  align-items: center;
  min-height: 1.8em;
}

.line-number {
  color: #64748b;
  margin-right: 1.5rem;
  -webkit-user-select: none;
  user-select: none;
  min-width: 30px;
  text-align: right;
}

.code-keyword { color: #c792ea; }
.code-string { color: #c3e88d; }
.code-comment { color: #546e7a; font-style: italic; }
.code-function { color: #82aaff; }
.code-variable { color: #f07178; }

/* 打字机光标效果 */
.typing-cursor {
  display: inline-block;
  width: 8px;
  height: 1.2em;
  background: #60a5fa;
  animation: blink 1s infinite;
  margin-left: 2px;
}

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

/* ==================== 工作流程展示 ==================== */
.workflow-section {
  padding: 5rem 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-top: 3rem;
  position: relative;
}

.workflow-steps::before {
  content: '';
  position: absolute;
  top: 60px;
  left: 16.66%;
  right: 16.66%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  z-index: 0;
}

.workflow-step {
  position: relative;
  text-align: center;
  z-index: 1;
}

.step-number {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  box-shadow: 0 10px 25px rgba(30, 64, 175, 0.3);
  position: relative;
}

.step-number::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  opacity: 0.3;
}

.workflow-step h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.workflow-step p {
  color: var(--gray-color);
  line-height: 1.6;
}

/* ==================== 特性对比表格 ==================== */
.comparison-section {
  padding: 5rem 0;
  background-color: #f8fafc;
}

.comparison-table {
  max-width: 1000px;
  margin: 3rem auto;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table thead {
  background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
  color: white;
}

.comparison-table th {
  padding: 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 1.1rem;
}

.comparison-table td {
  padding: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.comparison-table tbody tr:hover {
  background-color: #f9fafb;
}

.comparison-table .feature-name {
  font-weight: 600;
  color: var(--dark-color);
}

.check-icon {
  color: var(--secondary-color);
  font-size: 1.5rem;
  font-weight: bold;
}

.cross-icon {
  color: #ef4444;
  font-size: 1.5rem;
  font-weight: bold;
}

.partial-icon {
  color: #f59e0b;
  font-size: 1.5rem;
  font-weight: bold;
}

/* ==================== 功能图标 ==================== */
.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 10px 25px rgba(30, 64, 175, 0.2);
  transition: var(--transition);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
}

/* ==================== 数据统计动画 ==================== */
.stats-section {
  padding: 4rem 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
  color: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-top: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: block;
}

.stat-label {
  font-size: 1.1rem;
  opacity: 0.9;
}

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

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Section 滚动动画 */
.section-animate {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* 从左侧滑入 */
.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* 从右侧滑入 */
.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* 缩放进入动画 */
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* ==================== 更多动画效果 ==================== */

/* 卡片悬停效果 */
.feature-card {
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* 按钮动画 */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* 导航链接悬停效果 */
.nav a {
  position: relative;
  transition: color 0.3s ease;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.nav a:hover::after,
.nav a.active::after {
  width: 100%;
}

/* 图片悬停缩放 */
.partner-logo-img {
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: grayscale(100%);
}

.partner-logo-img:hover {
  transform: scale(1.1);
  filter: grayscale(0%);
}

/* 渐变背景动画 */
@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animated-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 15s ease infinite;
}

/* 脉冲动画 */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

/* 浮动动画 */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.float-animation {
  animation: float 3s ease-in-out infinite;
}

/* 旋转动画 */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotate-animation {
  animation: rotate 20s linear infinite;
}

/* 淡入从左 */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in-left {
  animation: fadeInLeft 0.6s ease;
}

/* 淡入从右 */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in-right {
  animation: fadeInRight 0.6s ease;
}

/* 缩放进入 */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.zoom-in {
  animation: zoomIn 0.5s ease;
}

/* 加载动画 */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

/* 进度条动画 */
@keyframes progress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.progress-bar {
  height: 4px;
  background: var(--primary-color);
  animation: progress 2s ease;
}

/* 打字效果增强 */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typing-effect {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--primary-color);
  animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* 波纹效果 */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.6s ease-out;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 页面加载动画 */
@keyframes pageLoad {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  animation: pageLoad 0.5s ease;
}

/* ==================== 响应式调整 ==================== */

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content .subtitle {
    font-size: 1.1rem;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-details {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .partners-logos {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==================== Docs 实用类 ==================== */
.section-pad { padding: 5rem 0; }
.section-pad-sm { padding: 3rem 0; }
.bg-white { background-color: var(--white); }
.bg-tertiary { background-color: var(--bg-tertiary); }

.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.card-link { text-decoration: none; }

.quick-card {
  color: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.3s ease;
}

.quick-card:hover { transform: translateY(-3px); }
.quick-card .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.quick-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.quick-card p { opacity: 0.9; font-size: 0.9rem; }

.gradient-primary { background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%); }
.gradient-secondary { background: linear-gradient(135deg, var(--secondary-color) 0%, #10b981 100%); }
.gradient-purple { background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); }
.gradient-orange { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }

/* 快速入门 Steps */
.bg-alt { background-color: #f8fafc; }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 1rem; color: var(--dark-color); }
.section-subtitle { text-align: center; font-size: 1.25rem; color: var(--gray-color); margin-bottom: 3rem; }
.max-w-800 { max-width: 800px; margin: 0 auto; }
.max-w-1000 { max-width: 1000px; margin: 0 auto; }

.doc-step-card { background: white; border-radius: 12px; padding: 2rem; margin-bottom: 2rem; box-shadow: var(--shadow); }
.doc-step { display: flex; align-items: flex-start; gap: 2rem; }
.doc-step-number { flex-shrink: 0; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 800; color: #fff; }
.badge-gradient-primary { background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%); }
.badge-gradient-secondary { background: linear-gradient(135deg, var(--secondary-color) 0%, #10b981 100%); }
.badge-gradient-purple { background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); }
.doc-step h3 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--dark-color); }
.doc-step p { color: var(--gray-color); line-height: 1.6; margin-bottom: 1rem; }
.doc-list { color: var(--gray-color); line-height: 1.8; padding-left: 1.5rem; text-align: left; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.tip-box { padding: 1rem; border-radius: 8px; }
.tip-blue { background: #f0f9ff; }
.tip-green { background: #f0fdf4; }
.tip-title { font-weight: 600; color: var(--dark-color); margin-bottom: 0.5rem; }

.code-box-dark { background: #1e293b; border-radius: 8px; padding: 1rem; font-family: 'JetBrains Mono', monospace; color: #e2e8f0; font-size: 0.9rem; }
.code-muted { color: #64748b; }
.mt-05 { margin-top: 0.5rem; }

/* 标题块复用（使用指南/FAQ/API） */
.section-header { text-align: center; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 1rem; color: var(--dark-color); }
.section-header p { font-size: 1.25rem; color: var(--gray-color); margin-bottom: 3rem; }

/* 通用卡片与文本 */
.doc-card { background: #ffffff; border-radius: 12px; padding: 2rem; box-shadow: var(--shadow); }
.doc-h3 { font-size: 1.25rem; color: var(--dark-color); margin-bottom: 1rem; }
.doc-h3-lg { font-size: 1.5rem; color: var(--dark-color); margin-bottom: 1rem; }
.doc-h4 { color: var(--dark-color); margin-bottom: 0.75rem; font-size: 1.1rem; }
.doc-p { color: var(--gray-color); line-height: 1.6; }
.doc-p-sm { color: var(--gray-color); line-height: 1.6; font-size: 0.95rem; }

/* 辅助间距 */
.mb-2 { margin-bottom: 2rem; }
.mb-15 { margin-bottom: 1.5rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-075 { margin-bottom: 0.75rem; }
.mb-05 { margin-bottom: 0.5rem; }
.mt-075 { margin-top: 0.75rem; }

/* 代码块细粒度样式 */
.code-sm { font-size: 0.85rem; padding: 1.25rem; }
.code-green { color: #10b981; }
/* 文本对齐 */
.text-left { text-align: left; }

/* 手机设备 (最大 768px) */
@media (max-width: 768px) {
  /* 导航栏响应式 */
  .header .container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav ul {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  /* Hero 区域 */
  .hero {
    padding: 3rem 0;
  }

  .hero .container {
    flex-direction: column;
  }

  .hero-content {
    text-align: center;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content .subtitle {
    font-size: 1rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .hero-image {
    margin-top: 2rem;
  }

  /* 工作流程 */
  .workflow-steps {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .workflow-steps::before {
    display: none;
  }

  /* 功能卡片 */
  .features-grid {
    grid-template-columns: 1fr;
  }

  /* 对比表格 */
  .comparison-table {
    overflow-x: auto;
  }

  .comparison-table table {
    min-width: 600px;
  }

  /* 统计数据 */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* 合作伙伴 */
  .partners-logos {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 用户评价 */
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  /* 页脚 */
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 2rem;
  }
}

/* 小屏手机 (最大 480px) */
@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.75rem;
  }

  .step-number {
    width: 80px;
    height: 80px;
    font-size: 1.75rem;
  }

  .feature-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .partners-logos {
    grid-template-columns: 1fr;
  }

  .code-content {
    font-size: 0.75rem;
  }
}
