/* 自定义CSS样式文件 */

/* 颜色变量 */
:root {
    --primary: #4CAF50;
    --primary-dark: #2E7D32;
    --secondary: #FF9800;
    --secondary-dark: #F57C00;
    --accent: #2196F3;
    --accent-dark: #1976D2;
    --dark: #2E7D32;
    --dark-800: #1B5E20;
    --light: #F1F8E9;
    --background: #E8F5E9;
}

/* 基础样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 防止大屏下内容过度拉伸 */
@media (min-width: 1024px) {
    .container {
        max-width: 1280px !important;
    }
}

/* 恢复Font Awesome默认样式，移除全局圆形背景 */
.bg-primary, .bg-secondary, .bg-accent, .bg-dark {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 导航栏样式 */
.nav-link {
    color: rgb(27, 94, 32);
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-dark);
}

/* 测试按钮样式 */
.test-btn {
    color: rgb(247, 240, 240);
    line-height: 20px;
    font-size: 16px;
}

.test-btn-mobile {
    color: rgb(247, 245, 245);
}

.test-btn-hero {
    color: rgb(250, 245, 245);
    font-weight: normal;
}

/* 英雄区域样式 */
#hero-container {
    transition: transform 0.3s ease;
}

#hero-container:hover {
    transform: translateY(-5px);
}

/* 卡片悬停效果 */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.03);
}

/* 特点卡片样式 */
.feature-card {
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 认知功能卡片样式 */
.cognitive-card {
    transition: all 0.3s ease;
}

.cognitive-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 压力源卡片样式 */
.stress-card {
    transition: all 0.8s ease-in-out;
}

.stress-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 职业卡片样式 */
.career-card {
    transition: all 0.3s ease;
}

.career-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 优势劣势卡片样式 */
.strength-card {
    background-color: #f0fdf4;
    border-left: 4px solid var(--primary);
}

.weakness-card {
    background-color: #fefce8;
    border-left: 4px solid var(--secondary);
}

/* 人际关系卡片样式 */
.relationship-card {
    transition: all 0.3s ease;
}

.relationship-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 日常生活卡片样式 */
.daily-life-card {
    transition: all 0.3s ease;
}

.daily-life-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 兴趣爱好卡片样式 */
.hobby-card {
    transition: all 0.3s ease;
}

.hobby-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 性格匹配卡片样式 */
.compatibility-card {
    transition: all 0.3s ease;
}

.compatibility-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 名人卡片样式 */
.celebrity-card {
    transition: all 0.3s ease;
}

.celebrity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.celebrity-card img {
    transition: transform 0.3s ease;
}

.celebrity-card:hover img {
    transform: scale(1.05);
}

/* 文章卡片样式 */
.article-card {
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.article-card img {
    transition: transform 0.5s ease;
}

.article-card:hover img {
    transform: scale(1.05);
}

/* 页脚样式 */
footer p {
    color: rgb(242, 250, 243);
}

/* 模态框样式 */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* 测试进度条样式 */
.progress-bar {
    transition: width 0.3s ease;
}

/* 答案按钮样式 */
.answer-btn {
    transition: all 0.2s ease;
}

.answer-btn:hover {
    background-color: #f9fafb;
}

.answer-btn:focus {
    outline: none;
    ring: 2px;
    ring-color: var(--primary);
}

/* AI聊天样式 */
.chat-container {
    max-height: 300px;
    overflow-y: auto;
}

.message-bubble {
    max-width: 80%;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.user-message {
    background-color: #e5e7eb;
    color: #1f2937;
    margin-left: auto;
}

.ai-message {
    background-color: var(--primary);
    color: white;
    margin-right: auto;
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
    margin: 0 2px;
    animation: pulse 1.4s infinite ease-in-out both;
}

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

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

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

/* 响应式调整 */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 90%;
    }
    
    .test-btn {
        font-size: 14px;
        padding: 0.5rem 1rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* 确保所有内容默认可见，避免AOS初始隐藏 */
[data-aos] {
  opacity: 1 !important;
  transform: translate(0) !important;
  transition-duration: 600ms !important;
}

/* 仅对非首屏内容在滚动时应用动画效果 */
.not-first-screen[data-aos].aos-animate {
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}

/* 首屏内容始终可见 */
.first-screen {
  opacity: 1 !important;
  transform: translate(0) !important;
}

/* 文章容器样式 */
.article-container {
  color: #4a5568;
  line-height: 1.7;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.article-container * {
  box-sizing: border-box;
}

/* 文章内容区域样式 */
.article-container .article-content {
  color: inherit;
  line-height: inherit;
  font-family: inherit;
}

.article-container > * + * {
  margin-top: 1.5rem;
}

/* 标题样式 */
.article-container h1,
.article-container h2,
.article-container h3,
.article-container h4,
.article-container h5,
.article-container h6 {
  color: #1a202c;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-container h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.article-container h3 {
  font-size: 1.25rem;
}

/* 段落样式 */
.article-container p {
  margin-bottom: 1rem;
}

/* 列表样式 */
.article-container ul,
.article-container ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-container li {
  margin-bottom: 0.5rem;
}

.article-container li > p {
  margin-bottom: 0.5rem;
}

/* 图片样式 */
.article-container img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 600px;
}

/* 表格样式 */
.article-container table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.article-container th,
.article-container td {
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.article-container th {
  background-color: #f7fafc;
  font-weight: 600;
}

/* 引用样式 */
.article-container blockquote {
  border-left: 4px solid #4299e1;
  padding-left: 1rem;
  color: #718096;
  font-style: italic;
  margin-left: 0;
  margin-right: 0;
}

/* 代码样式 */
.article-container code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background-color: #f7fafc;
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.875em;
}

.article-container pre {
  background-color: #2d3748;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.25rem;
  overflow-x: auto;
}

.article-container pre code {
  background-color: transparent;
  padding: 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .article-container > * + * {
    margin-top: 1.25rem;
  }
  
  .article-container img {
    margin: 1.5rem auto;
    border-radius: 0.375rem;
  }
}

/* 列表页标题区域样式 */
.list-page-title {
  transition: all 800ms ease 0ms;
  margin-bottom: 1em;
}

/* 图片宽高比工具类 */
.aspect-w-16 {
  position: relative;
  padding-bottom: 56.25%;
  overflow: hidden;
  background-color: #f3f4f6; /* 灰色背景，在图片加载前显示 */
}

.aspect-h-9 {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 文章卡片图片优化 */
.article-card-image {
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

.article-card-image:hover {
  transform: scale(1.05); /* 稍微放大，避免过度拉伸 */
}