/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 滑块容器完整样式 */
.slider-container {
    position: relative;
    width: 100%;
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 10px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* 重要：防止触摸设备上的默认行为 */
}

/* 确保滑块在移动设备上可拖动 */
.slider-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    cursor: -webkit-grab;
    cursor: grab;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s;
    user-select: none;
    -webkit-user-select: none;
    z-index: 10;
    /* 防止触摸事件穿透 */
    pointer-events: all;
    /* 确保在所有设备上显示为手型 */
    -webkit-appearance: none;
    appearance: none;
}

.slider-handle:active {
    cursor: -webkit-grabbing;
    cursor: grabbing;
}

/* 修复移动端触摸问题 */
@media (hover: none) and (pointer: coarse) {
    .slider-handle {
        width: 50px;
        height: 50px;
        border-radius: 25px;
    }
    
    .slider-container {
        height: 50px;
        border-radius: 25px;
    }
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #f8f8f8;
}

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

/* 颜色变量 */
:root {
    --primary-color: #d31145;
    --secondary-color: #333;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #e0e0e0;
}

/* 按钮样式 */
.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #b80e3c;
}

.btn-secondary {
    display: inline-block;
    padding: 8px 16px;
    background-color: transparent;
    color: var(--primary-color);
    text-decoration: none;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* 标题样式 */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 36px;
    margin-bottom: 20px;
}

h2 {
    font-size: 28px;
    margin-bottom: 16px;
    color: var(--secondary-color);
}

h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--secondary-color);
}

/* 段落样式 */
p {
    margin-bottom: 16px;
    font-size: 16px;
    color: var(--text-color);
}

/* 列表样式 */
ul, ol {
    list-style: none;
}

/* 链接样式 */
a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* 头部导航 */
.header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo-img {
    height: 60px;
}

.nav-menu ul {
    display: flex;
    gap: 40px;
}

.nav-menu a {
    font-size: 16px;
    font-weight: 500;
    position: relative;
}

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

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 10px 0;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
}

.dropdown-menu li a:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* 移动端菜单 */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background-color: white;
    z-index: 2000;
    transition: right 0.3s;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
    right: 0;
}

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

.mobile-logo {
    height: 40px;
}

.mobile-menu-close {
    font-size: 24px;
    cursor: pointer;
}

.mobile-menu-list {
    padding: 20px;
}

.mobile-menu-list li {
    margin-bottom: 15px;
}

.mobile-menu-list a {
    display: block;
    padding: 10px 0;
    font-size: 16px;
    font-weight: 500;
}

/* 移动端下拉菜单 */
.mobile-dropdown-menu {
    padding-left: 20px;
    margin-top: 10px;
    display: none;
}

.mobile-dropdown-menu.active {
    display: block;
}

.mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 英雄区 */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('images/hero-bg.png') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-top: 0;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: white;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
    color: white;
}

/* 产品系列 */
.products {
    padding: 80px 0;
    background-color: white;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 32px;
    color: var(--secondary-color);
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

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

.product-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.product-category {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-category:hover .product-image img {
    transform: scale(1.05);
}

.product-category h3 {
    text-align: center;
    padding: 20px 0 10px;
}

.product-category .btn-secondary {
    display: block;
    margin: 0 auto 20px;
    width: 120px;
    text-align: center;
}

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

.about-content {
    display: flex;
    gap: 50px;
    align-items: center;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
}

.about-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* 联系我们 */
.contact {
    padding: 80px 0;
    background-color: white;
}

.contact-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.contact-form {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-color);
}

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

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.contact-form .btn-primary {
    width: 100%;
    margin-top: 20px;
}

/* 页脚 */
.footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 40px 0;
}

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

.footer-info {
    flex: 1;
}

.footer-logo img {
    height: 60px;
    margin-bottom: 20px;
}

.footer-contact h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: white;
}

.footer-contact p {
    margin-bottom: 10px;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: #ccc;
    font-size: 14px;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #b80e3c;
    transform: translateY(-3px);
}

/* 移动验证弹窗样式 */
#mobile-verification {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* 确保PC端（宽屏设备）滑块验证弹窗始终隐藏 */
@media (min-width: 769px) {
    #mobile-verification {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

#mobile-verification .bg-white {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 85%;
    max-width: 400px;
    padding: 24px;
}

#mobile-verification h3 {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
    color: var(--secondary-color);
}

#mobile-verification p {
    text-align: center;
    margin-bottom: 24px;
    color: #666;
}

/* 滑块验证样式 */
.slider-container {
    position: relative;
    width: 100%;
    height: 50px;
    background-color: #f5f5f5;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    touch-action: none; /* 重要：防止浏览器默认触摸行为 */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.slider-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #1677ff;
    transition: width 0.3s ease;
    z-index: 1;
}

.slider-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    background-color: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    cursor: -webkit-grab;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    z-index: 10;
    pointer-events: auto;
    touch-action: none;
}

.slider-handle:active {
    cursor: -webkit-grabbing;
    cursor: grabbing;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.slider-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    z-index: 2;
    pointer-events: none;
}

.slider-text.success {
    color: #52c41a;
}

.slider-text.error {
    color: #ff4d4f;
}

/* 移动端滑块验证样式增强 */
@media (max-width: 768px) {
    #mobile-verification .bg-white {
        width: 90%;
        padding: 20px;
    }
    
    .slider-container {
        height: 50px;
    }
    
    .slider-handle {
        width: 50px;
        height: 50px;
        font-size: 18px;
        /* 增大移动端滑块尺寸和可点击区域 */
        padding: 2px;
    }
    
    #mobile-verification h3 {
        font-size: 18px;
    }
    
    #mobile-verification p {
        font-size: 15px;
    }
    
    .slider-text {
        font-size: 16px; /* 增大字体，提高可读性 */
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .hero-content p {
        font-size: 16px;
    }
    
    .product-categories {
        grid-template-columns: 1fr;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .about-image {
        order: -1;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 992px) {
    .product-categories {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 隐藏/显示工具类 */
.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

.opacity-0 {
    opacity: 0;
}