/* 基础重置与变量 */
:root {
    --primary-color: #0066cc;
    --secondary-color: #003366;
    --accent-color: #ff6600;
    --light-bg: #f4f7fc;
    --dark-text: #333;
    --light-text: #fff;
    --border-radius: 16px; /* 圆润过渡的关键 */
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: #fff;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.header {
    background: var(--secondary-color);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--light-text);
}

.logo span {
    color: var(--accent-color);
}

.nav a {
    color: var(--light-text);
    margin-left: 1.5rem;
    text-decoration: none;
    transition: var(--transition);
    font-size: 1rem;
}

.nav a:hover {
    color: var(--accent-color);
}

.auth .btn-login {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    margin-right: 1rem;
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
}

.auth .btn-register {
    background: var(--accent-color);
    color: var(--light-text);
    padding: 0.5rem 1.2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
}

.auth .btn-register:hover {
    background: #e65c00;
    transform: translateY(-2px);
}

/* 首屏大图 */
.hero {
    /* 1. 设置背景图片路径。center center 表示居中，cover 表示等比缩放填满整个区域，no-repeat 防止重复 */
    background: url('https://mt4-ex.com/wp-content/uploads/2025/12/exness-web-terminal.png') center center / cover no-repeat;
    
    color: var(--light-text);
    text-align: center;
    padding: 10rem 0 6rem;
    margin-top: 70px;
    
    /* 保持底部的圆润过渡效果 */
    border-radius: 0 0 30px 30px / 0 0 10px 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    
    /* 相对定位，确保内部的遮罩层和文字能正确叠放 */
    position: relative; 
    overflow: hidden; 
}

/* 强烈建议保留遮罩层，否则如果背景图太亮或颜色杂乱，会导致白色文字看不清 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 使用深蓝色半透明渐变，既贴合金融主题，又能压暗背景图 */
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.85) 0%, rgba(0, 102, 204, 0.75) 100%);
    z-index: 1;
}

/* 确保文字内容在遮罩层之上 */
.hero-content {
    position: relative;
    z-index: 2;
}

/* 新增遮罩层样式 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 使用深蓝色半透明渐变，既贴合金融主题，又能压暗背景图 */
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.85) 0%, rgba(0, 102, 204, 0.75) 100%);
    z-index: 1;
}

/* 确保文字内容在遮罩层之上 */
.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--light-text);
    padding: 0.8rem 2rem;
    border-radius: 50px; /* 极度圆润 */
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(255,102,0,0.4);
}

.btn-primary:hover {
    background: #e65c00;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255,102,0,0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--light-text);
    border: 2px solid var(--light-text);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-3px);
}

/* 核心优势 */
.features {
    padding: 5rem 0;
    background: var(--light-bg);
}

.features h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 3rem;
    color: var(--secondary-color);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
    border-top: 4px solid var(--primary-color);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.feature-card h3 {
    color: var(--primary-color);
    margin: 1rem 0;
}

/* 产品服务 */
.products {
    padding: 5rem 0;
}

.products h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 3rem;
    color: var(--secondary-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: linear-gradient(145deg, #e0e6ef, #d1d9e6);
    border-radius: 20px;
    padding: 1.8rem;
    text-align: center;
    box-shadow:  8px 8px 16px #b8c0cc, -8px -8px 16px #ffffff;
    transition: var(--transition);
}

.product-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.product-card h3 {
    color: var(--secondary-color);
    margin: 1rem 0;
    font-size: 1.3rem;
}

/* 评价模块 */
.testimonials {
    padding: 5rem 0;
    background: var(--light-bg);
    text-align: center;
}

.testimonials h2 {
    margin-bottom: 3rem;
    color: var(--secondary-color);
}

/* 两行两列网格布局核心代码 */
.testimonial-grid {
    display: grid;
    /* 自动适配两列，每列最小宽度为300px */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 2rem; /* 行列之间的间距 */
    max-width: 1000px; /* 限制整体最大宽度，保持美观 */
    margin: 0 auto;
}

/* 单个评价卡片样式 */
.testimonial-card {
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    text-align: left; /* 文字左对齐更符合阅读习惯 */
    
    /* 圆润过渡与悬浮动效 */
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* 引用符号装饰 */
.testimonial-card::before {
    content: '"';
    font-size: 5rem;
    position: absolute;
    top: -10px;
    right: 20px;
    color: var(--primary-color);
    opacity: 0.15;
    line-height: 1;
}

.testimonial-card p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.testimonial-author {
    font-style: italic;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 0.95rem;
}

/* 响应式处理：当屏幕较小时，自动变为单列 */
@media (max-width: 768px) {
    .testimonial-grid {
        grid-template-columns: 1fr; /* 手机端强制单列显示 */
    }
}
.testimonial-slider {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
}

.testimonial-item {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.testimonial-item.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.testimonial-content {
    background: #fff;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    margin: 2rem auto;
    max-width: 600px;
}

.testimonial-content::before {
    content: '"';
    font-size: 5rem;
    position: absolute;
    top: -20px;
    left: 20px;
    color: var(--primary-color);
    opacity: 0.2;
}

.testimonial-author {
    font-style: italic;
    margin-top: 1.5rem;
    color: var(--secondary-color);
    font-weight: bold;
}

.slider-controls {
    margin-top: 2rem;
}

.slider-btn {
    background: var(--primary-color);
    color: var(--light-text);
    border: none;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.slider-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

/* 新闻中心 */
.news {
    padding: 5rem 0;
}

.news h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 3rem;
    color: var(--secondary-color);
}

/* 核心：3x3 网格布局 */
.news-grid {
    display: grid;
    /* 强制分为3等分列 */
    grid-template-columns: repeat(3, 1fr); 
    gap: 2rem; /* 行列之间的间距 */
}

/* 单个新闻卡片样式 */
.news-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
    display: flex;
    flex-direction: column; /* 保证内部元素垂直堆叠 */
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* 上方图片样式 */
.news-card img {
    width: 100%;
    height: 180px;       /* 统一设定固定高度，使网格对齐更美观 */
    object-fit: cover;   /* 核心属性：图片等比缩放填满容器，多余部分裁剪居中 */
    display: block;      /* 消除图片底部可能出现的几像素空白缝隙 */
}

/* 下方文字区域样式 */
.news-text {
    padding: 1.5rem;
    flex: 1;             /* 让文字区域占据剩余空间，保持卡片等高 */
}

.news-text h3 {
    font-size: 1.1rem;
    color: var(--dark-text);
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.news-text p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
}

/* 响应式处理：小屏幕自动降级 */
@media (max-width: 992px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr); /* 平板端变为两列 */
    }
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr; /* 手机端变为单列 */
    }
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.news-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.news-card h3 {
    background: var(--primary-color);
    color: var(--light-text);
    padding: 1rem;
    margin: 0;
}

.news-card p {
    padding: 1.2rem;
    color: #666;
}

.read-more {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: var(--light-text);
    text-decoration: none;
    border-radius: var(--border-radius);
    margin: 0.5rem 1rem 1rem;
    transition: var(--transition);
}

.read-more:hover {
    background: #e65c00;
}

/* 页脚 */
.footer {
    background: var(--secondary-color);
    color: var(--light-text);
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer ul {
    list-style: none;
    margin: 1rem 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer a {
    color: #ddd;
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--accent-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    .nav a {
        display: block;
        margin: 0.5rem 0;
    }
    .auth {
        display: none; /* 移动端隐藏登录注册，可替换为汉堡菜单 */
    }
}
/* 标题下方图片容器 */
.hero-image-wrapper {
    margin: 2rem auto; /* 上下留出间距，并水平居中 */
    max-width: 800px;  /* 限制最大宽度，避免在宽屏下过大 */
    
    /* 圆润过渡与立体感 */
    border-radius: var(--border-radius); 
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3); /* 较深的阴影让图片有悬浮感 */
    
    /* 鼠标悬停时的微动效 */
    transition: transform 0.3s ease;
}

.hero-image-wrapper:hover {
    transform: translateY(-5px); /* 鼠标移上去时轻微上浮 */
}

/* 图片自适应 */
.hero-image-wrapper img {
    width: 100%;
    height: auto;
    display: block; /* 消除底部可能出现的几像素空白 */
}
/* Logo 容器 */
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none; /* 去掉默认的蓝色下划线 */
}

/* Logo 图片样式 */
#site-logo {
    height: 40px;       /* 控制高度，保持导航栏整洁 */
    width: auto;        /* 宽度自适应，防止变形 */
    transition: var(--transition); /* 增加平滑过渡效果 */
}

/* 鼠标悬停时的微动效 */
.logo-link:hover #site-logo {
    opacity: 0.85;      /* 悬停时稍微变暗或改变透明度 */
    transform: scale(1.05); /* 轻微放大 */
}
/* ================= 分类页样式 ================= */
.category-page {
    padding: 6rem 0 4rem; /* 留出固定头部的空间 */
    background: var(--light-bg);
}

.category-layout {
    display: grid;
    grid-template-columns: 250px 1fr; /* 左侧固定宽度，右侧自适应 */
    gap: 2.5rem;
    align-items: start;
}

/* 侧边栏 */
.sidebar {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 100px; /* 滚动时吸顶 */
}

.sidebar h3 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.category-list {
    list-style: none;
}

.category-list li a {
    display: block;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: #555;
    border-radius: 8px;
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.category-list li a:hover, .category-list li a.active {
    background: var(--primary-color);
    color: #fff;
}

/* 分页器 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 3rem;
}

.page-btn {
    padding: 0.6rem 1.2rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50px; /* 极度圆润的按钮 */
    text-decoration: none;
    color: var(--dark-text);
    transition: var(--transition);
}

.page-btn:hover, .page-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}


/* ================= 内容详情页样式 ================= */
.content-page {
    padding: 6rem 0 4rem;
}

.article-container {
    max-width: 850px; /* 限制最大宽度，保证长文阅读舒适度 */
    margin: 0 auto;
}

/* 面包屑 */
.breadcrumb {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 2rem;
}
.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 文章头部 */
.article-header {
    margin-bottom: 2rem;
}

.article-header h1 {
    font-size: 2.5rem;
    line-height: 1.3;
    color: var(--secondary-color);
    margin: 1rem 0;
}

.meta-info.large {
    font-size: 0.95rem;
    color: #777;
}

/* 封面大图 */
.article-cover {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.article-cover img {
    width: 100%;
    height: auto;
    display: block;
}

/* 正文排版 */
.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.article-body h2 {
    font-size: 1.6rem;
    color: var(--secondary-color);
    margin: 2.5rem 0 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--primary-color); /* 标题装饰线 */
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body blockquote {
    background: var(--light-bg);
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: #555;
}

/* 标签样式 */
.tag {
    display: inline-block;
    background: rgba(0, 102, 204, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* 相关推荐 */
.related-posts {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid #eee;
}

.related-posts h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.related-grid {
    grid-template-columns: repeat(2, 1fr); /* 底部推荐强制两列 */
}


/* ================= 响应式降级处理 ================= */
@media (max-width: 992px) {
    /* 平板端：隐藏侧边栏，分类页变单列 */
    .category-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none; 
    }
    /* 分类页新闻卡片变为两列 */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* 手机端：分类页新闻卡片变单列 */
    .category-grid, .related-grid {
        grid-template-columns: 1fr;
    }
    .article-header h1 {
        font-size: 1.8rem;
    }
}