/* 全局样式重置与变量 */
:root {
    --primary-color: #0783e2; /* 拉帮捷派品牌主色调，蓝色 */
    --accent-color: #ff7e00; /* 特殊强调色，橙色，仅用于"捷"字 */
    --text-color: #333333;
    --light-text: #666666;
    --background-color: #ffffff;
    --light-gray: #f5f5f5;
    --border-color: #dddddd;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --sidebar-width: 280px; /* 侧边栏宽度 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 16px;
}

.btn:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-color);
    filter: brightness(0.85);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 12px 24px;
    font-size: 18px;
}

.btn-text {
    background: none;
    color: var(--primary-color);
    padding: 0;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-text i {
    transition: var(--transition);
}

.btn-text:hover i {
    transform: translateX(5px);
}

/* 表单控件 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.form-actions {
    margin-top: 30px;
}

.form-actions .btn {
    width: 100%;
}

/* 头部样式 */
header {
    background-color: var(--background-color);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: #777777; /* 中等灰色 */
}

.logo span {
    color: var(--text-color);
}

nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin-right: 30px;
}

.nav-menu li {
    margin: 0 15px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

/* 移动端菜单按钮样式 */
.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: var(--transition);
    background-color: transparent;
    color: var(--text-color);
    margin-left: auto; /* 确保按钮靠右对齐 */
}

.menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 英雄区域样式 */
.hero {
    padding: 80px 0;
    background-color: var(--light-gray);
    overflow: hidden; /* 防止内容溢出 */
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; /* 允许内容在必要时换行 */
}

.hero-content {
    flex: 1;
    padding-right: 40px;
}

.hero-content h2 {
    font-size: 40px;
    margin-bottom: 20px;
    line-height: 1.2;
    color: var(--text-color);
}

.hero-content p {
    font-size: 18px;
    color: var(--light-text);
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.hero-image {
    flex: 1;
}

.hero-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

/* 响应式调整 */
@media screen and (max-width: 991px) {
    .hero {
        height: auto; /* 使用自动高度适应内容 */
        min-height: unset; /* 移除最小高度限制 */
        padding: 60px 0; /* 使用内边距控制间距 */
    }
}

/* 功能特点区域 */
.features {
    padding: 80px 0;
    background-color: var(--background-color);
    position: relative; /* 确保正确的堆叠顺序 */
    z-index: 1; /* 确保功能区域在hero区域上方 */
}

.section-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 60px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

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

.feature-card {
    background-color: var(--light-gray);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--box-shadow);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.feature-icon i {
    font-size: 30px;
    color: white;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--light-text);
}

/* 解决方案区域 */
.solutions {
    padding: 80px 0;
    background-color: var(--light-gray);
}

.solutions-content {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.solution-item {
    display: flex;
    align-items: center;
    gap: 40px;
}

.solution-item.reverse {
    flex-direction: row-reverse;
}

.solution-text {
    flex: 1;
}

.solution-text h3 {
    font-size: 28px;
    margin-bottom: 20px;
}

.solution-text p {
    margin-bottom: 20px;
    color: var(--light-text);
}

.solution-text ul {
    list-style-position: inside;
    margin-bottom: 20px;
}

.solution-text li {
    margin-bottom: 10px;
    color: var (--light-text);
}

.solution-image {
    flex: 1;
}

.solution-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

/* 关于我们区域 */
.about {
    padding: 80px 0;
    background-color: var(--background-color);
}

.about .container {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-content {
    flex: 1;
}

.about-content .section-title {
    text-align: left;
}

.about-content .section-title::after {
    left: 0;
    transform: none;
}

.about-content p {
    margin-bottom: 20px;
    color: var(--light-text);
}

.about-image {
    flex: 1;
}

.about-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

/* 联系我们区域 */
.contact {
    padding: 80px 0;
    background-color: var(--light-gray);
}

.contact-content {
    display: flex;
    gap: 40px;
}

.contact-info {
    flex: 1;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.contact-item i {
    font-size: 24px;
    color: var(--primary-color);
    margin-right: 15px;
    margin-top: 3px;
}

.contact-form {
    flex: 2;
}

/* 页脚区域 */
footer {
    background-color: #222;
    color: #fff;
    padding: 60px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.footer-logo h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #777777; /* 中等灰色 */
}

.footer-logo span {
    color: #777777; /* 中等灰色 */
}

.footer-links h4,
.footer-contact h4 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
}

.footer-links h4::after,
.footer-contact h4::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    bottom: -10px;
    left: 0;
}

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

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-contact p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;  /* 改为居中对齐 */
}

.footer-contact i {
    margin-right: 10px;
    color: var(--primary-color);
    /* 移除之前可能存在的margin-top */
    line-height: 1;  /* 确保图标行高一致 */
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: 30px;
    width: 100%;
    max-width: 450px;
    position: relative;
    animation: fadeIn 0.3s;
}

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
}

.modal h2 {
    margin-bottom: 30px;
    font-size: 24px;
    text-align: center;
}

.phone-input-group {
    display: flex;
    gap: 10px;
}

.phone-input-group input {
    flex: 1;
}

.btn-code {
    white-space: nowrap;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-code:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.other-login {
    margin-top: 30px;
    text-align: center;
}

.other-login p {
    margin-bottom: 15px;
    color: var(--light-text);
    position: relative;
}

.other-login p::before,
.other-login p::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 80px;
    height: 1px;
    background-color: var(--border-color);
}

.other-login p::before {
    left: 20px;
}

.other-login p::after {
    right: 20px;
}

.login-icons {
    display: flex;
    justify-content: center;
}

.wechat-login {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #07C160;
    font-size: 16px;
    gap: 8px;
}

.wechat-login i {
    font-size: 24px;
}

/* 响应式设计 */
@media screen and (max-width: 991px) {
    .hero .container,
    .about .container {
        flex-direction: column;
    }

    .hero-content,
    .about-content {
        padding-right: 0;
        text-align: center;
        margin-bottom: 40px;
    }

    /* 确保移动端下按钮水平居中 */
    .hero-buttons {
        justify-content: center;
    }

    .about-content .section-title {
        text-align: center;
    }

    .about-content .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .contact-content {
        flex-direction: column;
    }
}

@media screen and (max-width: 768px) {
    /* 在移动端隐藏导航菜单和认证按钮 */
    nav {
        display: none;
    }

    /* 在移动端显示菜单按钮 */
    .menu-toggle {
        display: block;
        z-index: 101; /* 确保按钮显示在最上层 */
    }

    .solution-item,
    .solution-item.reverse {
        flex-direction: column;
    }

    .solution-text {
        order: 1;
    }

    .solution-image {
        order: 0;
        margin-bottom: 30px;
    }

    .footer-content {
        flex-direction: column;
    }

    .hero-content h2 {
        font-size: 32px;
    }

    /* 移除冲突的样式，侧滑菜单的可见性应该由active类控制 */

    .hero {
        height: auto; /* 移除固定高度，使用自动高度适应内容 */
        min-height: unset; /* 移除最小高度限制 */
        padding: 40px 0; /* 添加合适的内边距 */
    }
}

/* 触摸设备优化 */
@media (hover: none) {
    .feature-card:hover {
        transform: none;
    }
}

/* 侧滑菜单样式 */
.sidebar-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background-color: white;
    box-shadow: var(--box-shadow);
    z-index: 1000;
    transform: translateX(-100%); /* 初始位置在屏幕左侧外 */
    overflow-y: auto;
    /* 使用复合过渡效果，处理所有属性 */
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    pointer-events: none; /* 防止隐藏时仍然可交互 */
}

.sidebar-menu.active {
    transform: translateX(0); /* 激活时移动到屏幕内 */
    opacity: 1;
    pointer-events: auto;
    /* 活跃状态下应用相同的过渡效果，但没有延迟 */
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
}

.sidebar-header .logo-img {
    height: 24px;
    margin-right: 8px;
}

.sidebar-header .logo h1 {
    font-size: 24px;
}

.close-sidebar {
    font-size: 28px;
    cursor: pointer;
    color: var(--light-text);
    transition: var(--transition);
}

.close-sidebar:hover {
    color: var(--text-color);
}

.sidebar-nav {
    list-style: none;
    padding: 20px;
}

.sidebar-nav li {
    margin-bottom: 15px;
}

.sidebar-nav a {
    display: block;
    text-decoration: none;
    color: var(--text-color);
    font-size: 18px;
    padding: 10px 0;
    transition: var(--transition);
}

.sidebar-nav a:hover {
    color: var(--primary-color);
}

.sidebar-auth-buttons {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-auth-buttons button {
    width: 100%;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden; /* 隐藏但仍占用空间 */
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible; /* 显示时可见 */
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 移动端菜单按钮样式修改 */
/* 菜单按钮样式已在上面定义，此处删除重复定义 */

/* 删除旧的顶部下拉菜单样式 */
.nav-menu.active,
.auth-buttons.active {
    display: none;
}

/* 添加动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 品牌标志样式 */
.logo h1, .footer-logo h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color); /* 拉帮派使用主题色（蓝色） */
}

/* Logo图片样式 */
.logo-img {
    height: 32px;
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
}

/* Header中的logo布局 */
.logo {
    display: flex;
    align-items: center;
}

/* Footer中的logo图片样式 */
.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo .logo-img {
    height: 28px;
    margin-right: 8px;
    margin-bottom: 8px;
}

.footer-logo h3 {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* 捷字的特殊强调色 */
.logo span.accent, .footer-logo span.accent {
    color: var(--accent-color); /* 捷字使用橙色 */
}

/* 底部页脚的品牌标志特殊样式 */
.footer-logo h3 {
    color: var(--primary-color);
}

/* 多端接入区域样式 */
.platform-access {
    padding: 80px 0;
    background-color: var(--background-color);
}

.platforms-container {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 40px;
}

.platform-item.reverse {
    flex-direction: row-reverse;
}

.platform-image {
    flex: 1;
}

.platform-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.platform-content {
    flex: 1;
}

.platform-content h3 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.platform-content p {
    margin-bottom: 20px;
    color: var(--light-text);
}

.platform-content ul {
    list-style-type: none;
}

.platform-content li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 12px;
    color: var(--light-text);
}

.platform-content li:before {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

@media screen and (max-width: 768px) {
    .platform-item,
    .platform-item.reverse {
        flex-direction: column;
    }

    .platform-content {
        order: 1;
    }

    .platform-image {
        order: 0;
        margin-bottom: 30px;
    }
}

/* 错误消息样式 - 预留固定空间 */
.error-message-container {
    height: 20px; /* 固定高度，预留足够的空间 */
    margin: 10px 0;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.error-message {
    color: #f44336;
    font-size: 14px;
    opacity: 0; /* 默认透明，但占据空间 */
    transition: opacity 0.3s ease;
    width: 100%;
    line-height: 1.4;
}

.error-message.visible {
    opacity: 1;
}

/* 错误消息抖动动画应用到容器 */
.error-message-container.shake-animation {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}
