/* 组件样式 */
/* 头部组件 */
.header {
    position: fixed; /* 固定定位，滚动时始终显示 */
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem; /* 调整导航栏高度到70px */
    max-width: 1400px;
    margin: 0 auto;
    height: 70px; /* 明确设置高度为70px */
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
    height: 100%;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    width: 5.5rem; /* 进一步增大logo尺寸 */
    height: 5.5rem;
    margin-right: 1.5rem;
    border-radius: 0.8rem;
    /* 使用flexbox垂直居中 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 3.2rem; /* 进一步加大logo文字 */
    font-weight: 700;
    color: var(--primary);
    /* 使用flexbox垂直居中 */
    display: flex;
    align-items: center;
    line-height: 1;
    height: 100%;
}

/* 桌面端导航链接 */
.nav-links.desktop-nav {
    display: flex;
    align-items: center;
    gap: 3rem; /* 增加导航链接间距 */
}

/* 大屏幕端确保导航链接显示 */
@media (min-width: 1025px) {
    .nav-links.desktop-nav {
        display: flex !important;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
}

.nav-link {
    text-decoration: none;
    color: var(--text);
    font-size: 2.0rem; /* 增大导航链接字体大小 */
    font-weight: 500;
    padding: 1rem 1.5rem; /* 调整padding以适应70px高度 */
    border-radius: 0.8rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(236, 72, 153, 0.1);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(236, 72, 153, 0.15);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* 移动端菜单按钮 */
.mobile-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu span {
    width: 2.5rem;
    height: 3px;
    background: var(--text);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

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

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

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

/* 移动端菜单包装器 */
.mobile-menu-wrapper {
    position: relative;
    display: none; /* 默认隐藏，移动端显示 */
}

/* 移动端汉堡菜单按钮 */
.mobile-menu-btn {
    display: none; /* 默认隐藏 */
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px 8px; /* 增大触摸区域 */
    width: 48px; /* 增大触摸区域，确保易点击 */
    height: 48px;
    position: relative;
    z-index: 1002;
    /* 确保按钮样式正确 */
    text-decoration: none;
    color: inherit;
    /* 移动端触摸优化 */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: rgba(236, 72, 153, 0.1);
}

.mobile-menu-btn:active {
    background: rgba(236, 72, 153, 0.2);
    transform: scale(0.95);
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 3px;
    background-color: var(--primary);
    margin: 4px auto;
    transition: all 0.3s ease;
    border-radius: 2px;
    /* 移动端触摸优化 */
    -webkit-tap-highlight-color: transparent;
}

/* 汉堡菜单激活状态 */
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 移动端导航菜单 - 简化版本 */
.mobile-menu {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* iOS Safari支持 */
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 确保菜单不会超出视口 */
    box-sizing: border-box;
    overflow: hidden;
}

/* 移动端菜单显示状态 - 灯箱式展开 */
.mobile-menu.show,
.mobile-menu[x-show="true"] {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
    align-items: center;
    justify-content: center;
}

/* 菜单内容显示时的动画 */
.mobile-menu.show .mobile-menu-content,
.mobile-menu[x-show="true"] .mobile-menu-content {
    transform: translateY(0) !important;
}

/* Alpine.js过渡效果支持 */
.mobile-menu[x-cloak] {
    display: none !important;
}

/* 确保Alpine.js控制的移动端菜单正确显示 */
.mobile-menu[x-show="false"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
}

.mobile-menu[x-show="true"] {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* 修复Alpine.js菜单显示问题 - 简化逻辑 */
.mobile-menu {
    display: none !important;
    transform: translateY(-10px);
}

.mobile-menu.show,
.mobile-menu[x-show="true"],
.mobile-menu[style*="display: block"] {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* 过渡动画类 */
.transition {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.ease-out {
    transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

.ease-in {
    transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.duration-300 {
    transition-duration: 300ms;
}

.duration-200 {
    transition-duration: 200ms;
}

.opacity-0 {
    opacity: 0;
}

.opacity-100 {
    opacity: 1;
}

.transform {
    transform: translateX(0) translateY(0) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1);
}

.translate-y-2 {
    transform: translateY(0.5rem);
}

.translate-y-0 {
    transform: translateY(0);
}

/* 移动端菜单头部 - 灯箱式设计 */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 15px 0;
    border-bottom: 1px solid rgba(236, 72, 153, 0.2);
    background: transparent;
    margin-bottom: 10px;
}

.mobile-menu-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    flex: 1;
}

.mobile-menu-close {
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    background: rgba(236, 72, 153, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
    border: 1px solid rgba(236, 72, 153, 0.2);
    color: var(--primary);
}

.mobile-menu-close:hover {
    background: rgba(236, 72, 153, 0.2);
    transform: scale(1.1);
}

.close-icon {
    font-size: 1.5rem;
    line-height: 1;
}

/* 移动端菜单内容样式 - 灯箱式居中 */
.mobile-menu-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-sizing: border-box;
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    padding: 20px 25px; /* 增大触摸区域 */
    color: var(--text);
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 500;
    border-radius: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(236, 72, 153, 0.2);
    /* 移动端触摸优化 */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    min-height: 60px; /* 增大最小触摸区域 */
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.mobile-menu-link:hover,
.mobile-menu-link:active {
    background: rgba(236, 72, 153, 0.1);
    transform: translateY(-2px);
    border-color: rgba(236, 72, 153, 0.4);
    box-shadow: 0 5px 15px rgba(236, 72, 153, 0.2);
}

.link-icon {
    margin-right: 12px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.link-text {
    flex: 1;
}

/* 确保移动端菜单在移动设备上正确显示 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important; /* 强制显示 */
    }
    
    .mobile-menu {
        /* 移动端特定样式 */
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(25px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        /* 确保在移动端正确显示 */
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1001;
    }
    
    .mobile-menu.active {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* 移动端菜单内容样式 */
    .mobile-menu-content {
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .mobile-menu-link {
        display: block;
        padding: 15px 20px;
        color: var(--primary);
        text-decoration: none;
        font-size: 1.1rem;
        font-weight: 500;
        border-radius: 10px;
        transition: all 0.3s ease;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .mobile-menu-link:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateX(5px);
    }
}

/* 移动端导航栏样式 */
@media (max-width: 768px) {
    .nav {
        padding: 1rem 1.5rem;
    }
    
    .logo-img {
        width: 4.5rem;
        height: 4.5rem;
        margin-right: 1rem;
    }
    
    .logo-text {
        font-size: 2.2rem;
    }
    
    /* 隐藏桌面端导航链接 */
    .nav-links.desktop-nav {
        display: none;
    }
    
    /* 显示移动端汉堡菜单 */
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-link {
        font-size: 1.6rem;
        padding: 1.2rem 1.5rem;
        width: 100%;
        text-align: center;
        border-radius: 1rem;
    }
}

/* 平板端导航栏样式 */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav {
        padding: 1.3rem 1.8rem;
    }
    
    .logo-img {
        width: 4.8rem;
        height: 4.8rem;
        margin-right: 1.3rem;
    }
    
    .logo-text {
        font-size: 2.4rem;
    }
    
    .nav-link {
        font-size: 1.8rem;
        padding: 1rem 1.5rem;
    }
    
    /* 确保平板端显示桌面导航 */
    .nav-links.desktop-nav {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: none;
    }
}

/* 尾部组件 */
.footer {
    background: linear-gradient(135deg, #1f2937, #111827);
    color: white;
    padding: 60px 0 30px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="footer-grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23footer-grain)"/></svg>');
    opacity: 0.3;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    color: white;
    position: relative;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.footer-section p,
.footer-section a {
    color: #d1d5db;
    margin-bottom: 12px;
    display: block;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 30px;
    text-align: center;
    color: #9ca3af;
    position: relative;
}

.footer-bottom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* 条款页面样式 */
.terms-content {
    max-width: 800px;
    margin: 0 auto;
}

.terms-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 1rem;
    border-left: 4px solid var(--primary);
}

.terms-item.warning {
    border-left-color: var(--warning);
    background: rgba(255, 193, 7, 0.1);
}

.terms-item h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.terms-item.warning h3 {
    color: var(--warning);
}

/* 定价信息样式 */
.pricing-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.pricing-item {
    text-align: center;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 1rem;
    border: 2px solid var(--primary-light);
}

.pricing-item h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.pricing-item .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1rem 0;
}

/* 联系方式样式 */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.contact-card {
    text-align: center;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 1rem;
    border: 2px solid var(--primary-light);
    transition: all 0.3s ease;
}

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

.contact-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.contact-icon.tg-main {
    background: linear-gradient(135deg, #0088cc, #006699);
    color: white;
}

.contact-icon.tg-service {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
}

.contact-icon.twitter {
    background: linear-gradient(135deg, #1da1f2, #0d8bd9);
    color: white;
}

.contact-title {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.contact-desc {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* 服务信息样式 */
.service-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 1rem;
}

.service-item h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* FAQ样式 */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.faq-card {
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 1rem;
    border-left: 4px solid var(--primary);
}

.faq-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.faq-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* 悬浮按钮 */
.floating-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.floating-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.floating-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.floating-btn:hover::before {
    left: 100%;
}

.floating-btn:hover {
    transform: scale(1.15) translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.floating-btn.tg-main {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.floating-btn.tg-service {
    background: linear-gradient(135deg, #10b981, #059669);
}

.floating-btn.twitter {
    background: linear-gradient(135deg, #000000, #1f2937);
}

.floating-btn svg {
    width: 26px;
    height: 26px;
    transition: all 0.3s ease;
}

.floating-btn:hover svg {
    transform: scale(1.1);
}

/* 组件错误提示 */
.component-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #fca5a5;
    margin: 20px 0;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .floating-buttons {
        bottom: 20px;
        right: 20px;
        gap: 12px;
    }
    
    .floating-btn {
        width: 45px;
        height: 45px;
    }
    
    .floating-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-section h4 {
        font-size: 20px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .header {
        background: rgba(26, 26, 26, 0.95);
        border-bottom-color: rgba(64, 64, 64, 0.2);
    }
    
    .nav-link {
        color: #ffffff;
    }
    
    .nav-link:hover {
        background: rgba(236, 72, 153, 0.2);
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .logo,
    .nav-link,
    .floating-btn,
    .footer-section a {
        transition: none;
    }
    
    .floating-btn:hover {
        transform: none;
    }
    
    .nav-link:hover::after {
        width: 0;
    }
}
