/* ==========================================================================
   1. 全局初始化与现代变量
   ========================================================================== */
:root {
    --primary-color: #f52a50;         /* 沿用原相亲网站核心红 */
    --primary-hover: #d41f40;
    --dark-color: #212529;
    --text-color: #5a626a;
    --light-bg: #f8f9fa;
    --dark-bg: #1a1a1a;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 现代标准版芯容器 */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* 全局排版及无障碍优化 */
a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}
ul, ol {
    list-style: none;
}
.text-center { text-align: center; }

/* ==========================================================================
   2. 公共组件 (按钮、网格、遮罩、标题)
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 12px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-smooth);
}
.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}
.btn-primary:hover {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.btn-white {
    background-color: #fff;
    color: var(--primary-color);
}
.btn-white:hover {
    background-color: transparent;
    border-color: #fff;
    color: #fff;
}
.btn-outline {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.btn-outline:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* 模块公共内边距 */
.section-padding {
    padding: 80px 0;
}
.section-header {
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.section-title {
    font-size: 36px;
    color: var(--dark-color);
    margin-bottom: 15px;
    font-weight: 700;
}
.section-subtitle {
    font-size: 16px;
    color: #777;
}

/* 全新现代响应式网格系统 (Grid) */
.card-grid {
    display: grid;
    gap: 30px;
}
.col-2 { grid-template-columns: repeat(2, 1fr); }
.col-3 { grid-template-columns: repeat(3, 1fr); }
.col-4 { grid-template-columns: repeat(4, 1fr); }

/* 全局背景图通用遮罩层 */
.slide-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(34, 35, 53, 0.5);
    z-index: 1;
}

/* ==========================================================================
   3. 头部导航区域 (Site Header)
   ========================================================================== */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}
.site-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

/* 导航菜单样式 */
.main-navigation {
    display: flex;
    align-items: center;
}
.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}
.nav-link {
    font-size: 16px;
    font-weight: 500;
    color: var(--dark-color);
    padding: 10px 0;
}
.nav-link:hover {
    color: var(--primary-color);
}

/* 下拉菜单 (Languages) */
.menu-item-has-children {
    position: relative;
}
.menu-item-has-children i {
    font-size: 12px;
    margin-left: 4px;
}
.sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    background-color: #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}
.sub-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--dark-color);
}
.sub-menu li a:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}
.menu-item-has-children:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.menu-toggle { display: none; } /* 默认隐藏移动端按钮 */

/* ==========================================================================
   4. Banner / Hero Slider 区域
   ========================================================================== */
.hero-slider {
    position: relative;
    height: 600px;
}
.slide-item {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}
.slider-content-box {
    position: relative;
    z-index: 2;
    max-width: 650px;
    color: #fff;
}
.slide-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}
.slide-text {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* ==========================================================================
   5. 成功故事模块 (Testimonial Card)
   ========================================================================== */
.story-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: var(--transition-smooth);
}
.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.card-image img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}
.card-body {
    padding: 25px;
}
.card-text {
    font-size: 15px;
    font-style: italic;
    color: var(--text-color);
    margin-bottom: 20px;
    line-height: 1.6;
}
.card-author {
    font-size: 18px;
    color: var(--dark-color);
    font-weight: 600;
}
.card-author::before {
    content: "— ";
    color: var(--primary-color);
}

/* ==========================================================================
   6. 呼吁行动两色横幅 (CTA Banner)
   ========================================================================== */
.cta-banner {
    position: relative;
    padding: 100px 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* 视差滚动效果，质感大增 */
    text-align: center;
}
.cta-container {
    position: relative;
    z-index: 2;
    color: #fff;
}
.cta-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
}
.cta-text {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* ==========================================================================
   7. 核心干货优势模块 (Feature Card)
   ========================================================================== */
#features {
    background-color: var(--light-bg);
}
.feature-card {
    display: flex;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.04);
    transition: var(--transition-smooth);
}
.feature-card:hover {
    transform: translateY(-3px);
}
.feature-image {
    width: 45%;
    background-size: cover;
    background-position: center;
    min-height: 250px;
}
.feature-body {
    width: 55%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}
.feature-title {
    font-size: 22px;
    color: var(--dark-color);
    margin-bottom: 12px;
    font-weight: 600;
}
.feature-text {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ==========================================================================
   8. 社区会员模块 (Member Card)
   ========================================================================== */
.member-card {
    background-color: #fff;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: var(--transition-smooth);
}
.member-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    border-color: transparent;
}
.member-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.member-name {
    font-size: 18px;
    color: var(--dark-color);
    margin-bottom: 4px;
}
.member-location {
    display: block;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 12px;
}
.member-bio {
    font-size: 14px;
    line-height: 1.5;
}

/* ==========================================================================
   9. 深度博客模块 (Blog Card)
   ========================================================================== */
#blog {
    background-color: var(--light-bg);
}
.blog-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}
.blog-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.blog-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.blog-meta {
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
}
.blog-title {
    font-size: 20px;
    color: var(--dark-color);
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.4;
}
.blog-text {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ==========================================================================
   10. 底部区域 (Footer & Back To Top)
   ========================================================================== */
.site-footer {
    background-color: var(--dark-bg);
    color: #b0b3b8;
    padding-top: 60px;
}
.footer-widgets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #2d2d2d;
}
.widget-title {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}
.footer-widget-column ul li {
    margin-bottom: 12px;
}
.footer-widget-column ul li a {
    font-size: 14px;
}
.footer-widget-column ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}
.footer-bottom {
    padding: 30px 0;
    font-size: 13px;
    color: #777;
}

/* 返回顶部 */
.backtotop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    z-index: 99;
}
.backtotop.show {
    opacity: 1;
    visibility: visible;
}
.backtotop:hover {
    background-color: var(--dark-color);
    transform: translateY(-3px);
}

/* ==========================================================================
   11. 📱 完美多终端自适应媒体查询 (Media Queries)
   ========================================================================== */

/* 1. 平板与小屏幕 PC 适配断点 */
@media (max-width: 992px) {
    .col-4 { grid-template-columns: repeat(2, 1fr); }
    .col-3 { grid-template-columns: repeat(2, 1fr); }
    .feature-card { flex-direction: column; }
    .feature-image, .feature-body { width: 100%; }
    .feature-body { padding: 25px; }
    .cta-banner { background-attachment: scroll; } /* 移动端关闭固定背景防止卡顿 */
}

/* 2. 手机端及精细化自适应断点 */
@media (max-width: 768px) {
    .section-padding { padding: 50px 0; }
    .section-title { font-size: 28px; }
    .slide-title { font-size: 32px; }
    .slide-text { font-size: 16px; }
    .hero-slider { height: 500px; }
    
    /* 网格全部平铺成独占单列 */
    .col-2, .col-3, .col-4 { grid-template-columns: 1fr; }
    .footer-widgets-grid { grid-template-columns: 1fr; gap: 30px; }

    /* 移动端汉堡导航菜单重塑 */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1001;
    }
    .menu-toggle .bar {
        width: 100%;
        height: 2px;
        background-color: var(--dark-color);
        transition: var(--transition-smooth);
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: #fff;
        flex-direction: column;
        gap: 0;
        padding: 20px 0;
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
        border-top: 1px solid #eee;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: var(--transition-smooth);
    }
    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .nav-menu li {
        width: 100%;
        text-align: center;
    }
    .nav-menu li .nav-link {
        display: block;
        padding: 15px 0;
        border-bottom: 1px solid #f5f5f5;
    }
    
    /* 移动端语言下拉转变成轻触展现 */
    .sub-menu {
        position: relative;
        top: 0; left: 0;
        transform: none !important;
        box-shadow: none;
        background-color: var(--light-bg);
        display: none;
        width: 100%;
    }
    .menu-item-has-children.open .sub-menu {
        display: block;
        opacity: 1;
        visibility: visible;
    }
    
    /* 动画：汉堡菜单激活变成 “X” 状态 */
    .menu-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}