/* ================================================
   泰隆减速机官网 - Bootstrap 5 定制样式
   ================================================ */

/* ========== 1. CSS 变量定义 ========== */
:root {
    /* 主色调 - 与Bootstrap变量协调 */
    --tl-primary: #003B7A;
    --tl-primary-light: #0052A3;
    --tl-primary-dark: #002855;
    --tl-secondary: #FF6B00;
    --tl-accent: #00A3E0;
    
    /* 过渡动画 */
    --tl-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 圆角 */
    --tl-radius: 0.5rem;
    
    /* 阴影 */
    --tl-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --tl-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* ========== 2. Bootstrap 覆盖 ========== */
/* 自定义Bootstrap主色 */
.btn-primary {
    background-color: var(--tl-primary);
    border-color: var(--tl-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--tl-primary-dark);
    border-color: var(--tl-primary-dark);
}

.bg-primary {
    background-color: var(--tl-primary) !important;
}

.text-primary {
    color: var(--tl-primary) !important;
}

.badge.bg-primary {
    background-color: var(--tl-primary) !important;
}

/* 链接颜色 */
a {
    color: var(--tl-primary);
    text-decoration: none;
    transition: var(--tl-transition);
}

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

/* ========== 3. 全局样式 ========== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 
                 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', 
                 Helvetica, Arial, sans-serif;
    color: #333;
    line-height: 1.7;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* Section统一间距 */
section {
    padding: 5rem 0;
}

section.py-5 {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
}

/* Section标题 */
.section-header h2,
section h2.display-5 {
    margin-bottom: 1rem;
    font-weight: 700;
}

.section-header p,
section p.lead {
    margin-bottom: 3rem;
}

/* Card间距统一 */
.card {
    margin-bottom: 1.5rem;
}

/* ========== 4. 顶部通知栏 ========== */
.top-banner {
    position: relative;
    z-index: 1030;
}

.top-banner .btn-close-white {
    position: absolute;
}

/* ========== 5. 导航栏增强 ========== */
.navbar {
    transition: var(--tl-transition);
    padding: 1rem 0;
}

.navbar-brand img {
    transition: transform 0.3s ease;
    height: 45px;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-nav {
    gap: 0.25rem;
}

.nav-link {
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.625rem 0.875rem !important;
    transition: var(--tl-transition);
    position: relative;
    color: #333 !important;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--tl-primary) !important;
}

.nav-link.active {
    color: var(--tl-primary) !important;
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.875rem;
    right: 0.875rem;
    height: 2px;
    background: var(--tl-primary);
}

/* 导航栏按钮统一样式 */
.navbar .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-width: 1px;
    white-space: nowrap;
}

.navbar .btn i {
    font-size: 1.125rem;
}

.navbar .btn-outline-secondary {
    color: #6c757d;
    border-color: #dee2e6;
}

.navbar .btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

.navbar .btn-outline-primary {
    color: var(--tl-primary);
    border-color: var(--tl-primary);
}

.navbar .btn-outline-primary:hover {
    background-color: var(--tl-primary);
    border-color: var(--tl-primary);
    color: white;
}

.navbar .btn-primary {
    background-color: var(--tl-primary);
    border-color: var(--tl-primary);
}

.navbar .btn-primary:hover {
    background-color: var(--tl-primary-dark);
    border-color: var(--tl-primary-dark);
}

/* 超级菜单 */
.mega-menu {
    min-width: 600px;
    border: none;
    box-shadow: var(--tl-shadow);
    border-radius: var(--tl-radius);
    padding: 1rem;
}

.dropdown-header {
    color: var(--tl-primary);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: var(--tl-transition);
    border-radius: 0.25rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--tl-primary);
    transform: translateX(5px);
}

/* ========== 6. Hero轮播 ========== */
.hero-swiper {
    position: relative;
    overflow: hidden;
    margin-top: -1px; /* 消除导航栏和banner之间的间隙 */
}

.hero-slide {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-slide .container {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.hero-content h2 {
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.letter-spacing-wide {
    letter-spacing: 3px;
    text-transform: uppercase;
}

.hero-content .lead {
    font-size: 1.125rem;
    line-height: 1.7;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-content .btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    transition: var(--tl-transition);
}

.hero-content .btn-warning {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    border: none;
}

.hero-content .btn-warning:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.4);
}

.hero-content .btn-link {
    font-size: 1rem;
    text-decoration: underline;
    padding: 0.875rem 0;
}

.hero-content .btn-link:hover {
    text-decoration: none;
}

/* 数据卡片 */
.stat-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    padding: 1.75rem 1rem;
    transition: var(--tl-transition);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-number {
    font-size: 3rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.85;
    font-weight: 400;
}

/* Hero按钮链接 */
.btn-link-hero {
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: var(--tl-transition);
}

.btn-link-hero:hover {
    transform: translateX(5px);
    opacity: 0.9;
}

.btn-link-hero i {
    font-size: 1.5rem;
    transition: var(--tl-transition);
}

.btn-link-hero:hover i {
    transform: translateX(3px);
}

/* Swiper自定义 */
.heroSwiper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: white;
    opacity: 0.5;
}

.heroSwiper .swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--tl-secondary);
}

.heroSwiper .swiper-button-next,
.heroSwiper .swiper-button-prev {
    color: white;
    background: rgba(0, 0, 0, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: var(--tl-transition);
}

.heroSwiper .swiper-button-next::after,
.heroSwiper .swiper-button-prev::after {
    font-size: 20px;
}

.heroSwiper .swiper-button-next:hover,
.heroSwiper .swiper-button-prev:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* ========== 7. 选型卡片 ========== */
.selector-card {
    transition: var(--tl-transition);
    cursor: pointer;
    border: 2px solid transparent !important;
    height: 100%;
}

.selector-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--tl-shadow) !important;
    border-color: var(--tl-primary) !important;
}

.selector-card .card-body {
    padding: 2rem 1.5rem;
}

.selector-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.selector-card.bg-primary .card-title,
.selector-card.bg-primary .card-text {
    color: white !important;
}

.icon-box {
    transition: var(--tl-transition);
}

.selector-card:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
}

/* ========== 8. 产品卡片 ========== */
.product-card {
    transition: var(--tl-transition);
    cursor: pointer;
    overflow: hidden;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--tl-shadow) !important;
}

.product-card .card-body {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.product-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.product-card .card-text {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.product-card .list-unstyled {
    margin-bottom: 1.25rem;
}

.product-card .list-unstyled li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.product-img-placeholder {
    transition: var(--tl-transition);
    overflow: hidden;
}

.product-card:hover .product-img-placeholder i {
    transform: scale(1.2) rotate(15deg);
}

.product-card .badge {
    z-index: 10;
}

/* ========== 9. 客户Logo轮播 ========== */
.client-logo-card {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: var(--tl-radius);
    box-shadow: var(--tl-shadow-sm);
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    transition: var(--tl-transition);
}

.client-logo-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--tl-shadow);
    color: var(--tl-primary);
}

.clientsSwiper {
    padding: 2rem 0;
}

/* ========== 10. 按钮增强 ========== */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    transition: var(--tl-transition);
    border-radius: var(--tl-radius);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--tl-shadow-sm);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

/* ========== 11. 卡片增强 ========== */
.card {
    border: none;
    transition: var(--tl-transition);
}

.card:hover {
    box-shadow: var(--tl-shadow) !important;
}

/* ========== 12. 返回顶部按钮 ========== */
#backToTop {
    box-shadow: var(--tl-shadow);
    transition: var(--tl-transition);
    z-index: 1050;
}

#backToTop.show {
    display: block !important;
}

#backToTop:hover {
    transform: translateY(-5px) scale(1.1);
}

/* ========== 13. 悬浮工具栏 ========== */
.position-fixed a.btn {
    box-shadow: var(--tl-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--tl-transition);
}

.position-fixed a.btn:hover {
    transform: scale(1.15);
}

/* ========== 14. 动画效果 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* ========== 15. Footer增强 ========== */
footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%) !important;
}

footer h6 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

footer .footer-links li {
    margin-bottom: 0.65rem;
}

footer .footer-links a {
    color: #adb5bd;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: var(--tl-transition);
    display: inline-block;
}

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

footer .footer-links a::before {
    content: "›";
    margin-right: 5px;
    opacity: 0;
    transition: var(--tl-transition);
}

footer .footer-links a:hover::before {
    opacity: 1;
}

footer .footer-contact {
    font-size: 0.9375rem;
}

footer .footer-contact i {
    font-size: 1.125rem;
}

footer .footer-contact a {
    transition: var(--tl-transition);
}

footer .footer-contact a:hover {
    color: var(--tl-primary-light) !important;
}

footer .badge {
    font-weight: 500;
    font-size: 0.75rem;
}

footer .btn-outline-secondary {
    color: #adb5bd;
    border-color: #495057;
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

footer .btn-outline-secondary:hover {
    background-color: var(--tl-primary);
    border-color: var(--tl-primary);
    color: white;
    transform: translateY(-3px);
}

footer .btn-primary {
    font-weight: 600;
    padding: 0.75rem;
}

footer .border-top {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

footer small {
    font-size: 0.8125rem;
    line-height: 1.6;
}

/* ========== 16. 模态框增强 ========== */
.modal-content {
    border: none;
    border-radius: var(--tl-radius);
    box-shadow: var(--tl-shadow);
}

/* ========== 17. 表单增强 ========== */
.form-control:focus {
    border-color: var(--tl-primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 59, 122, 0.25);
}

.form-select:focus {
    border-color: var(--tl-primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 59, 122, 0.25);
}

/* ========== 18. Badge增强 ========== */
.badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* ========== 19. 响应式优化 ========== */
@media (max-width: 991.98px) {
    .mega-menu {
        min-width: 100%;
    }
    
    .navbar-collapse {
        margin-top: 1rem;
        padding: 1rem;
        background: white;
        border-radius: var(--tl-radius);
        box-shadow: var(--tl-shadow-sm);
    }
    
    .navbar-nav {
        margin-bottom: 1rem;
    }
    
    .navbar .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    
    .navbar .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
    
    .hero-slide {
        min-height: 80vh;
    }
}

@media (max-width: 767.98px) {
    section {
        padding: 3rem 0;
    }
    
    .hero-slide {
        min-height: auto;
        padding: 4rem 0;
    }
    
    .display-3 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .display-6 {
        font-size: 1.5rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .stat-card h3 {
        font-size: 2rem;
    }
    
    .stat-card {
        padding: 1rem 0.75rem;
        min-height: 80px;
    }
    
    footer .col-6 {
        margin-bottom: 2rem;
    }
}

/* ========== 20. 打印样式 ========== */
@media print {
    .navbar,
    .top-banner,
    #backToTop,
    .position-fixed,
    .btn {
        display: none !important;
    }
    
    .hero-slide {
        min-height: auto;
        background: white !important;
        color: black !important;
    }
}

/* ========== 21. 无障碍增强 ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 22. 性能优化 ========== */
.hero-slide,
.card,
.btn,
.product-card {
    will-change: transform;
}

/* ========== 23. 自定义工具类 ========== */
.text-warning-custom {
    color: #FFD700 !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--tl-primary) 0%, var(--tl-primary-light) 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--tl-secondary) 0%, #CC5500 100%);
}

.shadow-custom {
    box-shadow: var(--tl-shadow) !important;
}

.rounded-custom {
    border-radius: var(--tl-radius) !important;
}

/* ========== 24. Swiper自定义分页 ========== */
.swiper-pagination {
    bottom: 20px !important;
}

.swiper-pagination-bullet {
    transition: var(--tl-transition);
}

.swiper-pagination-bullet:hover {
    transform: scale(1.2);
}

/* ========== 25. 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--tl-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tl-primary-dark);
}

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

.spinner {
    animation: spin 1s linear infinite;
}

/* ========== 27. Tooltip增强 ========== */
.tooltip-inner {
    background-color: var(--tl-primary);
    border-radius: var(--tl-radius);
    padding: 0.5rem 1rem;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--tl-primary);
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: var(--tl-primary);
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: var(--tl-primary);
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: var(--tl-primary);
}

/* ========== 28. 文字选择样式 ========== */
::selection {
    background-color: var(--tl-primary);
    color: white;
}

::-moz-selection {
    background-color: var(--tl-primary);
    color: white;
}

/* ========== 29. Focus可见性 ========== */
.btn:focus,
.form-control:focus,
.form-select:focus,
a:focus {
    outline: 2px solid var(--tl-primary);
    outline-offset: 2px;
}

/* ========== 30. 额外响应式调整 ========== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

@media (max-width: 575.98px) {
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .display-3 {
        font-size: 1.75rem;
    }
    
    .display-5 {
        font-size: 1.5rem;
    }
    
    .display-6 {
        font-size: 1.25rem;
    }
}
