/* main.css - 非首屏渲染样式 */

/* 防止复制与用户交互限制 */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 图片样式统一设置 */
img {
    -webkit-touch-callout: none;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 特定图片排除点击效果 */
img#modal-wechat-qr, 
img#wechat-qr, 
img#viewer-image {
    cursor: default;
}

#viewer-image {
    cursor: grab;
}

#viewer-image.grabbing {
    cursor: grabbing;
}

/* 允许表单元素可以选择文本 */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* 统一文本样式 */
.text-base, p, li, .text-gray-600, .text-gray-700, .text-gray-800 {
    font-size: var(--body-font-size);
    line-height: var(--body-line-height);
    margin-bottom: 1rem;
}

/* 文本尺寸层级 */
.text-sm, .text-xs { font-size: 0.875rem; line-height: 1.5; }
.text-lg { font-size: 1.125rem; line-height: 1.75; }
.text-xl { font-size: 1.25rem; line-height: 1.75; }
.text-2xl { font-size: 1.5rem; line-height: 1.4; }
.text-3xl { font-size: 1.875rem; line-height: 1.3; }
.text-4xl { font-size: 2.25rem; line-height: 1.2; }

/* 标题样式统一 */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--primary-font);
    font-weight: 700;
    line-height: var(--heading-line-height);
    color: var(--heading-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; letter-spacing: -0.025em; }
h2 { font-size: 2rem; letter-spacing: -0.015em; }
h3 { font-size: 1.5rem; letter-spacing: -0.01em; }

/* 副标题样式 */
.subtitle {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 0.01em;
    position: relative;
    display: block;
    text-align: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.subtitle::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* 页脚中的subtitle特殊样式 */
footer .subtitle {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    width: auto;
}

footer .subtitle::after {
    left: 0;
    transform: none;
}

/* 段落和列表样式 */
p {
    margin-bottom: var(--spacing-unit);
    max-width: 70ch;
}

.container p {
    max-width: none;
}

ul, ol {
    margin-bottom: var(--spacing-unit);
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.75rem;
}

/* 间距统一 */
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.mb-16 { margin-bottom: 4rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }

/* 卡片效果统一 */
.card-hover {
    transition: all 0.3s ease;
    border-radius: 0.75rem;
    overflow: hidden;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-hover p, .bg-white p, .bg-gray-50 p {
    color: var(--text-color);
    font-size: var(--body-font-size);
    line-height: var(--body-line-height);
}

/* 按钮统一样式 */
button, .bg-white.text-indigo-600 {
    font-family: var(--primary-font);
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* 背景和特效 */
.testimonial-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

/* 导航相关样式 - 非首屏部分 */
/* 桌面导航 */
.desktop-nav a:hover {
    transform: translateY(-2px);
}

/* 桌面导航项选中效果 */
.desktop-nav a.active,
.desktop-nav a.text-indigo-600,
.desktop-nav a[aria-current="page"] {
    color: #4f46e5;
    position: relative;
}

/* 导航项通用样式 */
.nav-item {
    text-align: center;
    white-space: nowrap;
    display: flex;
    align-items: center;
    padding: 0.4rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.2s ease;
    position: relative;
    height: auto;
    min-height: 2.25rem;
    box-sizing: border-box;
    margin-bottom: 6px;
}

.nav-item:hover {
    color: #4f46e5;
    background-color: rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.nav-item i {
    flex-shrink: 0;
}

.nav-item span {
    display: inline-block;
    white-space: nowrap;
}

/* 确保导航按钮样式统一 */
.desktop-nav button.nav-item {
    background: none;
    border: none;
    cursor: pointer;
    margin: 0;
    line-height: normal;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
    text-transform: none;
}

/* 优化联系我们按钮 */
.desktop-nav button:focus {
    outline: none;
}

/* 确保导航链接和按钮外观一致 */
.desktop-nav a.nav-item,
.desktop-nav button.nav-item {
    height: auto;
    box-sizing: border-box;
}

/* 响应式导航项样式 */
@media (min-width: 768px) and (max-width: 1023px) {
    .nav-item {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
        min-height: 2rem;
    }
    
    .nav-item i {
        font-size: 0.8rem;
    }
}

@media (min-width: 768px) and (max-width: 900px) {
    .nav-item {
        padding: 0.25rem 0.3rem;
        font-size: 0.75rem;
        min-height: 1.9rem;
    }
    
    .nav-item i {
        font-size: 0.75rem;
    }
}

/* 确保移动设备正确显示 */
@media (max-width: 767px) {
    html:not(.loading) .desktop-nav {
        display: none !important;
    }
}

/* 移动导航 */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 20px;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow-y: auto;
}

.mobile-nav.active {
    transform: translateX(0);
    display: flex !important;
}

.mobile-nav-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding-left: 30px;
    padding-top: 30px;
    gap: 0.25rem;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0.3rem 0;
    padding: 0.6rem 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #4a5568;
    text-align: left;
    transition: all 0.3s;
    width: 80%;
    max-width: 250px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.mobile-nav a:hover {
    color: var(--primary-color-hover);
    background-color: rgba(237, 242, 247, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.mobile-nav a i {
    min-width: 24px;
}

.mobile-nav .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.8rem;
    color: #4a5568;
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(247, 250, 252, 0.8);
}

.mobile-nav .close-btn:hover {
    transform: rotate(90deg);
    color: var(--primary-color-hover);
    background-color: rgba(237, 242, 247, 0.9);
}

.mobile-nav button, 
.mobile-nav .contact-btn {
    margin-top: 1rem;
    width: 80%;
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 600;
}

/* 联系我们按钮样式 */
.mobile-nav .contact-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0.5rem 0;
    padding: 0.6rem 1rem;
    font-size: 1.1rem;
    color: #4a5568;
    text-align: left;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.hamburger-btn {
    display: none;
    cursor: pointer;
}

/* 响应式样式 */
@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
    }
    .hamburger-btn {
        display: none;
    }
}

@media (max-width: 767px) {
    .hamburger-btn {
        display: block;
    }
    .desktop-nav {
        display: none;
    }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    .text-4xl { font-size: 1.75rem; }
    .text-3xl { font-size: 1.5rem; }
    .py-20 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    .mb-16 { margin-bottom: 2.5rem; }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .desktop-nav a {
        font-size: 0.875rem;
    }
}

/* 图片加载与效果 */
@keyframes imgLoading {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

img[loading] {
    opacity: 0;
}

img.loaded {
    animation: imgLoading 0.5s ease forwards;
    opacity: 1;
}

.img-container {
    overflow: hidden;
    position: relative;
}

.img-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(243, 244, 246, 0) 0%, rgba(243, 244, 246, 0.5) 50%, rgba(243, 244, 246, 0) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.img-container.loaded::before {
    display: none;
}

.shadow-md img:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}

/* 图片懒加载样式 */
img[data-src] {
    opacity: 0;
    transition: opacity 0.5s ease;
    filter: blur(2px);
}

/* 容器通用样式 */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* 锚点偏移 */
section[id] {
    scroll-margin-top: 100px;
}

/* 图片查看器样式 */
#image-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
}

#image-viewer.active {
    display: flex;
}

#viewer-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    transform-origin: center center;
}

.image-container {
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

/* 缩放控制 */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 30px;
    z-index: 10;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 缩放指示器 */
.zoom-level {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
}

.zoom-level.visible {
    opacity: 1;
}

/* 返回顶部按钮 */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 40;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#back-to-top:hover {
    transform: translateY(-5px);
    background-color: var(--primary-color-hover);
}

/* 导航栏自定义滚动条样式 */
.scrollbar-thin::-webkit-scrollbar {
    height: 4px;
    width: 4px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: rgba(79, 70, 229, 0.2);
    border-radius: 4px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background-color: rgba(79, 70, 229, 0.4);
}

/* 优化桌面导航滚动 */
.desktop-nav {
    -webkit-overflow-scrolling: touch;
    margin-left: auto;
    scrollbar-width: thin;
    padding-left: 8px;
    padding-right: 8px;
    -ms-overflow-style: none;
}

/* 修复导航图标显示问题 */
.desktop-nav a,
.desktop-nav button {
    position: relative;
    padding: 0.35rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    display: flex !important;
    align-items: center !important;
    height: auto !important;
    min-height: 2.25rem;
    box-sizing: border-box !important;
}

.desktop-nav a:hover,
.desktop-nav button:hover {
    background-color: rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.desktop-nav a i,
.desktop-nav button i {
    position: relative;
    z-index: 1;
    font-size: 0.85rem;
}

/* 移动设备"电脑模式"优化 */
.mobile-desktop-mode .desktop-nav {
    max-width: calc(100% - 120px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 10px;
}

.mobile-desktop-fix {
    margin-left: auto !important;
}

/* 全局确保导航项相同高度 */
.desktop-nav a,
.desktop-nav button {
    display: flex !important;
    align-items: center !important;
    height: auto !important;
    min-height: 2.25rem;
    box-sizing: border-box !important;
}

/* 统一移动端和桌面端导航项样式 */
@media (max-width: 767px) {
    /* 确保移动设备加载时不显示导航闪烁 */
    html.loading .mobile-nav {
        display: none !important;
    }
    
    /* 确保移动导航关闭按钮可见 */
    .mobile-nav .close-btn {
        z-index: 10;
    }
    
    .mobile-nav-content a,
    .mobile-nav-content .contact-btn {
        height: auto;
        min-height: 2.25rem;
        display: flex;
        align-items: center;
    }
}

/* 重置按钮默认样式 - 修复联系我们按钮高度问题 */
button.nav-item {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
    border-style: none;
    text-transform: none;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* 特定修复联系我们按钮高度问题 - 2023-10-25 */
.desktop-nav button.nav-item {
    box-sizing: border-box !important;
    line-height: 1.5 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: auto;
}

.desktop-nav button.nav-item i,
.desktop-nav button.nav-item span {
    display: inline-block;
    vertical-align: middle;
    line-height: normal;
}

/* 确保所有导航项尺寸一致 */
.desktop-nav a.nav-item,
.desktop-nav button.nav-item {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.4rem 0.5rem;
    margin: 0 0 6px 0;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .desktop-nav a.nav-item,
    .desktop-nav button.nav-item {
        min-height: 2rem;
        padding: 0.3rem 0.4rem;
    }
}

/* 优化窄屏幕导航 */
@media (min-width: 768px) and (max-width: 1100px) {
    .desktop-nav a, 
    .desktop-nav button {
        padding: 0.25rem 0.35rem;
        font-size: 0.8rem;
    }
    
    .desktop-nav a i,
    .desktop-nav button i {
        font-size: 0.75rem;
    }
}

/* 优化超小屏幕的导航 */
@media (min-width: 768px) and (max-width: 880px) {
    .desktop-nav a, 
    .desktop-nav button {
        padding: 0.25rem;
        font-size: 0.75rem;
    }
    
    .desktop-nav a i,
    .desktop-nav button i {
        margin-right: 0.25rem !important;
        font-size: 0.7rem;
    }
}

/* 移动端横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-nav-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        max-width: 90%;
        gap: 0.5rem;
        padding-top: 15px;
    }
    
    .mobile-nav-content a {
        margin: 0;
    }
}

/* 修复移动导航 */
.mobile-nav.active {
    transform: translateX(0);
    display: flex !important;
}

/* 修复"电脑模式"下的导航栏问题 */
@media (min-width: 320px) and (max-width: 767px) {
    .desktop-nav {
        max-width: calc(100vw - 140px);
        min-height: 40px;
    }
}

/* 导航项选中样式增强 */
.desktop-nav a.nav-item::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #4f46e5;
    transition: width 0.3s ease;
}

.desktop-nav a.nav-item:hover::after,
.desktop-nav a.nav-item.active::after,
.desktop-nav a.nav-item.text-indigo-600::after,
.desktop-nav a.nav-item[aria-current="page"]::after {
    width: 100%;
}

/* 导航高亮样式 - 2023-10-25 - 添加在末尾确保优先级 */
.desktop-nav a.nav-item.active,
.desktop-nav a.nav-item.text-indigo-600,
.desktop-nav a.nav-item[aria-current="page"] {
    color: #4f46e5;
    position: relative;
}

.desktop-nav a.nav-item::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #4f46e5;
    transition: width 0.3s ease;
}

.desktop-nav a.nav-item:hover::after,
.desktop-nav a.nav-item.active::after,
.desktop-nav a.nav-item.text-indigo-600::after,
.desktop-nav a.nav-item[aria-current="page"]::after {
    width: 100%;
} 