/*
* 文件名称: common.css
* 功能说明: AI炒股学习网通用样式表 - 定义全站基础样式和布局
* 创建日期: 2025年1月
* 作者: AI炒股学习网开发团队
* 说明: 使用红色系配色方案，符合炒股文化，响应式设计适配各种设备
*/

/* 全局重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* 盒模型统一为border-box */
}

/* 基础HTML元素样式 */
body {
  font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif; /* 中文字体优先 */
  line-height: 1.6;
  color: #333;
  background-color: #ffffff; /* 白色背景 */
  font-size: 16px;
}

/* 容器布局 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  color: #d32f2f; /* 红色系主色调 */
  margin-bottom: 15px;
  font-weight: 600;
}

h1 {
  font-size: 2.5em;
}

h2 {
  font-size: 2em;
  border-bottom: 2px solid #e53935; /* 红色下划线 */
  padding-bottom: 10px;
}

h3 {
  font-size: 1.5em;
}

h4 {
  font-size: 1.3em;
}

/* 段落和文本样式 */
p {
  margin-bottom: 15px;
  text-align: justify; /* 两端对齐 */
}

/* 链接样式 */
a {
  color: #d32f2f; /* 红色链接 */
  text-decoration: none;
  transition: color 0.3s ease; /* 平滑过渡效果 */
}

a:hover {
  color: #b71c1c; /* 悬停时深红色 */
  text-decoration: underline;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  text-align: center;
  transition: all 0.3s ease; /* 所有属性平滑过渡 */
  text-decoration: none;
}

.btn-primary {
  background-color: #d32f2f; /* 主要按钮红色背景 */
  color: white;
}

.btn-primary:hover {
  background-color: #b71c1c; /* 悬停时深红色 */
  transform: translateY(-2px); /* 悬停时轻微上移 */
}

.btn-secondary {
  background-color: transparent;
  color: #d32f2f;
  border: 2px solid #d32f2f; /* 红色边框 */
}

.btn-secondary:hover {
  background-color: #d32f2f;
  color: white;
}

/* ==================== 页面头部样式 ==================== */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    min-height: 60px;
    flex-wrap: nowrap;
}

.logo {
    flex-shrink: 0;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    gap: 0.8rem;
}

.logo h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #e74c3c; /* 红色LOGO文字 */
    background-clip: text;
    white-space: nowrap;
    color: #e74c3c; /* 红色LOGO标题 */
}

.logo .tagline {
    font-size: 0.8rem;
    color: #b0bec5;
    font-weight: 400;
    white-space: nowrap;
}

.nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* ==================== 导航菜单样式 ==================== */
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: nowrap;
}

.nav-list > li {
    position: relative;
    flex-shrink: 0;
}

.nav-list > li > a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    font-size: 0.85rem;
}

.nav-list > li > a:hover,
.nav-list > li > a.active {
    background: rgba(255,255,255,0.1);
    color: #e3f2fd;
    transform: translateY(-2px);
}

.nav-list > li > a.active {
    background: rgba(211,47,47,0.2);
    color: #ffcdd2;
}

/* 二级菜单样式 */
.dropdown {
    position: relative;
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 180px;
    z-index: 1001;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    color: #333;
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    display: block;
    transition: all 0.3s ease;
    font-weight: 400;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
    color: #d32f2f;
    transform: translateX(5px);
}

/* 主要内容区域 */
.main {
  min-height: calc(100vh - 200px); /* 最小高度确保页脚在底部 */
  padding: 20px 0;
}

/* 页面底部样式 */
.footer {
  background-color: #f5f5f5;
  border-top: 3px solid #d32f2f; /* 红色顶部边框 */
  margin-top: 50px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 响应式网格 */
  gap: 30px;
  padding: 40px 0 20px;
}

.footer-section h3,
.footer-section h4 {
  color: #d32f2f;
  margin-bottom: 15px;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  color: #666;
  font-size: 14px;
}

.footer-section ul li a:hover {
  color: #d32f2f;
}

.footer-bottom {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid #ddd;
  color: #666;
  font-size: 14px;
}

/* 数据统计展示样式 */
.stats {
  padding: 80px 0;
  margin: 0; /* 确保没有额外边距 */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: relative; /* 确保正常文档流 */
  z-index: 1; /* 设置层级 */
}

.stats h2 {
  text-align: center;
  margin-bottom: 50px;
  font-size: 2.5rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  max-width: 800px;
  margin: 0 auto;
}

.stat-item {
  text-align: center;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-10px);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
}

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

/* 用户评价样式 */
.testimonials {
  padding: 80px 0;
  margin: 0; /* 确保没有额外边距 */
  background: #f8f9fa;
  position: relative; /* 确保正常文档流 */
  z-index: 1; /* 设置层级 */
}

.testimonials h2 {
  text-align: center;
  margin-bottom: 50px;
  font-size: 2.5rem;
  color: #333;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.testimonial-item {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.testimonial-content {
  margin-bottom: 20px;
}

.testimonial-content p {
  font-style: italic;
  line-height: 1.6;
  color: #555;
  margin: 0;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 15px;
}

.author-avatar {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 50%;
}

.author-info h4 {
  margin: 0 0 5px 0;
  color: #333;
  font-size: 1.1rem;
}

.author-info span {
  color: #666;
  font-size: 0.9rem;
}

/* 常见问题快速解答样式 */
.quick-faq {
  padding: 80px 0;
  margin: 0; /* 确保没有额外边距 */
  background: white;
  position: relative; /* 确保正常文档流 */
  z-index: 1; /* 设置层级 */
}

.quick-faq h2 {
  text-align: center;
  margin-bottom: 50px;
  font-size: 2.5rem;
  color: #333;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.faq-item {
  padding: 30px;
  border: 2px solid #e9ecef;
  border-radius: 15px;
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: #007bff;
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 123, 255, 0.1);
}

.faq-item h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.faq-item p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.faq-link {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.faq-link:hover {
  color: #0056b3;
}

/* 技术趋势样式 */
.tech-trends {
  padding: 80px 0;
  margin: 0; /* 确保没有额外边距 */
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  position: relative; /* 确保正常文档流 */
  z-index: 1; /* 设置层级 */
}

.tech-trends h2 {
  text-align: center;
  margin-bottom: 50px;
  font-size: 2.5rem;
  color: white;
}

.trends-timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.trends-timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #007bff;
  transform: translateX(-50%);
}

.trend-item {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
  position: relative;
}

.trend-item:nth-child(odd) {
  flex-direction: row;
}

.trend-item:nth-child(even) {
  flex-direction: row-reverse;
}

.trend-year {
  width: 80px;
  height: 80px;
  background: #007bff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  position: relative;
  z-index: 2;
}

.trend-content {
  flex: 1;
  padding: 20px 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  margin: 0 30px;
  backdrop-filter: blur(10px);
}

.trend-content h3 {
  margin-bottom: 10px;
  color: #fff;
}

.trend-content p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  margin: 0;
}

/* 合作伙伴样式 */
.partners {
  padding: 80px 0;
  margin: 0; /* 确保没有额外边距 */
  background: #f8f9fa;
  position: relative; /* 确保正常文档流 */
  z-index: 1; /* 设置层级 */
}

.partners h2 {
  text-align: center;
  margin-bottom: 50px;
  font-size: 2.5rem;
  color: #333;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.partner-item {
  text-align: center;
  padding: 40px 30px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.partner-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.partner-logo {
  font-size: 3rem;
  margin-bottom: 20px;
}

.partner-item h4 {
  margin-bottom: 15px;
  color: #333;
  font-size: 1.3rem;
}

.partner-item p {
  color: #666;
  line-height: 1.6;
  margin: 0;
}

/* 最新动态增强样式 */
.news-more {
  text-align: center;
  margin-top: 30px;
}

/* ==================== 响应式设计 ==================== */
/* 中等屏幕设备 */
@media (max-width: 1024px) {
    .header-content {
        padding: 0 1rem;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .logo .tagline {
        font-size: 0.75rem;
    }
    
    .nav-list {
        gap: 0.6rem;
    }
    
    .nav-list > li > a {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .stats-grid,
    .testimonials-grid,
    .faq-grid,
    .partners-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .trends-timeline::before {
        left: 30px;
    }
    
    .trend-item {
        flex-direction: row !important;
        padding-left: 80px;
    }
    
    .trend-year {
        position: absolute;
        left: 0;
        width: 60px;
        height: 60px;
        font-size: 0.9rem;
    }
    
    .trend-content {
        margin: 0;
    }
}

/* 平板设备 */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .header-content {
        padding: 0 1rem;
        position: relative;
    }
    
    .logo a {
        gap: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .logo .tagline {
        font-size: 0.75rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-list {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1a1a2e;
        flex-direction: column;
        gap: 0;
        padding: 1rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        flex-wrap: wrap;
    }
    
    .nav-list.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-list > li {
        width: 100%;
        flex-shrink: 1;
    }
    
    .nav-list > li > a {
        padding: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        border-radius: 0;
        font-size: 1rem;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255,255,255,0.1);
        margin-left: 1rem;
        display: none;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu a {
        color: #e3f2fd;
        padding: 0.8rem 1rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
  h1 {
    font-size: 2em;
  }
  
  h2 {
    font-size: 1.6em;
  }
}

/* ==================== 移动端菜单 ==================== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* 响应式设计 - 手机设备 */
@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header-content {
        padding: 0 0.5rem;
    }
    
    .logo a {
        gap: 0.3rem;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .logo .tagline {
        font-size: 0.7rem;
    }
    
    .nav-list > li > a {
        font-size: 0.9rem;
        padding: 0.8rem;
    }
    
    .dropdown-menu a {
        font-size: 0.85rem;
        padding: 0.7rem 0.8rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        padding: 8px 16px;
        font-size: 12px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    h2 {
        font-size: 1.3em;
    }
}

/* 通用工具类 */
.text-center {
  text-align: center;
}

.text-red {
  color: #d32f2f;
}

.bg-red {
  background-color: #d32f2f;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.hidden {
  display: none;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #d32f2f;
  border-radius: 50%;
  animation: spin 1s linear infinite; /* 旋转动画 */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}