/* 自定义样式文件 */

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 隐藏元素 - 不使用!important，避免覆盖Tailwind的响应式类 */
/* .hidden 类由 Tailwind CSS 提供，不需要自定义 */

/* Section 切换动画 */
.section {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 图片容器 */
img {
    max-width: 100%;
    height: auto;
    /* 防止图片被拖拽下载 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: auto;
}

/* 图片保护 - 防止右键菜单和拖拽 */
img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 文本截断 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 自定义滚动条（Webkit浏览器） */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 响应式视频 */
video {
    max-width: 100%;
    height: auto;
    /* 防止视频被拖拽下载 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: auto;
}

/* 表单样式增强 */
input:focus, textarea:focus, select:focus {
    outline: none;
}

/* 按钮过渡效果 */
button, a {
    transition: all 0.3s ease;
}

/* 卡片悬停效果 */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
}

/* 加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 移动端字体大小调整 */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
}

/* 导航栏菜单链接样式 - 微软黑体 + 立体阴影 */
/* 选择所有导航链接，排除logo链接（logo链接class包含items-center） */
nav a[href]:not([class*="items-center"]),
nav #mobile-menu a {
    font-family: 'Microsoft YaHei', '微软雅黑', sans-serif !important;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.4), 
                 1px 1px 2px rgba(0, 0, 0, 0.3),
                 0px 1px 1px rgba(0, 0, 0, 0.2) !important;
}

/* 导航栏用户信息文字样式 */
nav .user-info-container span,
nav .user-info-container a {
    font-family: 'Microsoft YaHei', '微软雅黑', sans-serif !important;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.4), 
                 1px 1px 2px rgba(0, 0, 0, 0.3),
                 0px 1px 1px rgba(0, 0, 0, 0.2) !important;
}

/* 主页标题样式 - 英文版本字体更小 */
.home-title[lang="en"] {
    font-size: 2rem !important;
}

@media (min-width: 768px) {
    .home-title[lang="en"] {
        font-size: 3.5rem !important;
    }
}

/* 导航菜单按钮样式 - 立体效果 */
nav .nav-menu-item {
    padding: 0.4rem 0.7rem;
    border-radius: 0.5rem;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15),
                -2px -2px 4px rgba(255, 255, 255, 0.9),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    display: inline-block;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.8125rem;
    line-height: 1.25rem;
    white-space: nowrap;
}

nav .nav-menu-item:hover {
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.12),
                -1px -1px 2px rgba(255, 255, 255, 0.8);
    transform: translateY(1px);
}

nav .nav-menu-item:active {
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.2),
                inset -1px -1px 2px rgba(255, 255, 255, 0.5);
    transform: translateY(2px);
}

nav .nav-menu-item.active {
    background: linear-gradient(145deg, #3b82f6, #2563eb) !important;
    color: white !important;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2),
                -2px -2px 4px rgba(59, 130, 246, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

nav .nav-menu-item.active:hover {
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15),
                -1px -1px 2px rgba(59, 130, 246, 0.25);
}

nav .nav-menu-item.active:active {
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.3),
                inset -1px -1px 2px rgba(255, 255, 255, 0.1);
}

nav .nav-menu-item.active.text-blue-600 {
    color: white !important;
}

/* 只在英文界面微调导航菜单字号和间距，避免挤压 LOGO，高度不变 */
html[lang="en"] .nav-main-menu {
    gap: 0.4rem; /* 原来是 gap-3 ≈ 0.75rem，这里稍微缩小一点间距 */
}

html[lang="en"] .nav-main-menu .nav-menu-item,
html[lang="en"] .nav-main-menu .login-link,
html[lang=“en”] .nav-main-menu .user-info-container span,
html[lang=“en”] .nav-main-menu .user-info-container a {
    font-size: 0.7rem;          /* 比中文小半号，只在英文模式下生效 */
    padding-top: 0.2rem;        /* 减少上下内边距，菜单整体变矮一点 */
    padding-bottom: 0.2rem;
}
/* ============================================
   移动端优化样式（手机浏览专用）
   ============================================ */

@media (max-width: 768px) {
    /* 导航栏优化 */
    nav {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    nav .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* LOGO 在手机上稍微缩小一点，但保持清晰 */
    nav .logo-main {
        height: 2.5rem !important;
        max-height: 2.5rem;
    }
    
    /* 移动端菜单按钮优化 */
    #mobile-menu-btn {
        padding: 0.5rem;
        font-size: 1.5rem;
    }
    
    /* 移动端菜单项优化 */
    #mobile-menu {
        padding-top: 0.5rem;
        padding-bottom: 1rem;
    }
    
    #mobile-menu a,
    #mobile-menu .user-info-container span,
    #mobile-menu .user-info-container a {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        line-height: 1.5;
        border-radius: 0.375rem;
        margin-bottom: 0.25rem;
    }
    
    /* 移动端语言选择器优化 */
    #mobile-menu select {
        margin-top: 0.5rem;
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    /* 主页标题优化 */
    .home-title {
        font-size: 1.75rem !important;
        line-height: 1.3;
        margin-bottom: 1rem !important;
        padding: 0 0.5rem;
    }
    
    /* 主页副标题优化 */
    .home-title + p {
        font-size: 1.1rem !important;
        line-height: 1.4;
        padding: 0 0.5rem;
    }
    
    /* 主要内容区域优化 */
    main .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 卡片/功能块优化 */
    .grid.grid-cols-1.md\\:grid-cols-3 > * {
        margin-bottom: 1rem;
        padding: 1.25rem;
    }
    
    /* 卡片图标在手机上稍微缩小 */
    .grid .text-5xl {
        font-size: 2.5rem;
    }
    
    /* 卡片标题优化 */
    .grid h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    /* 卡片描述文字优化 */
    .grid p.text-gray-600 {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    /* 通用标题优化 */
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.3;
        margin-bottom: 1.5rem;
    }
    
    h2 {
        font-size: 1.5rem !important;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
    
    h3 {
        font-size: 1.25rem !important;
        line-height: 1.4;
    }
    
    /* 段落文字优化 */
    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    /* 按钮优化 */
    button,
    .btn,
    a[class*="bg-"] {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        min-height: 44px; /* 符合移动端触摸标准 */
    }
    
    /* 表单输入框优化 */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        padding: 0.75rem;
        font-size: 1rem; /* 防止 iOS 自动缩放 */
        min-height: 44px;
    }
    
    /* 表格优化（如果有） */
    table {
        font-size: 0.875rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 页脚优化 */
    footer {
        padding: 2rem 1rem;
    }
    
    footer h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    footer p {
        font-size: 0.875rem;
        line-height: 1.6;
        margin-bottom: 0.5rem;
    }
    
    /* 产品列表/卡片网格优化 */
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 {
        gap: 1rem;
    }
    
    /* 图片优化 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* 视频区域在手机上高度调整 */
    .relative.w-full.h-96 {
        height: 50vh !important;
        min-height: 300px;
    }
}

/* 超小屏幕优化（小于 375px） */
@media (max-width: 374px) {
    .home-title {
        font-size: 1.5rem !important;
    }
    
    .home-title + p {
        font-size: 1rem !important;
    }
    
    nav .logo-main {
        height: 2.25rem !important;
    }
    
    #mobile-menu a {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }
    
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
}

/* 横屏模式优化（手机横屏时） */
@media (max-width: 768px) and (orientation: landscape) {
    .home-title {
        font-size: 2rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .home-title + p {
        font-size: 1.25rem !important;
    }
    
    .relative.w-full.h-96 {
        height: 60vh !important;
    }
}
