/* 首页样式文件
   作者：张同学
   日期：2024年3月 */

/* ========== 主内容区域 ========== */
.main-content {
    margin-top: 50px;
    min-height: calc(100vh - 50px);
    position: relative;
    z-index: 1;
}

/* ========== 轮播图样式 ========== */
.banner-section {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.swiper-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.swiper-wrapper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.swiper-slide.active {
    opacity: 1;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-text {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.banner-text h2 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.banner-text p {
    font-size: 1.4rem;
    opacity: 0.9;
}

.swiper-pagination {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.swiper-pagination span {
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
}

.swiper-pagination span.active {
    background: #fff;
}

/* ========== 快捷入口 ========== */
.quick-entry {
    padding: 30px 0;
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.entry-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 5px;
    background: #fff;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.entry-item:active {
    transform: scale(0.95);
    background: var(--bg-gray);
}

.entry-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.entry-text {
    font-size: 1.3rem;
    color: var(--text-color);
}

/* ========== 产品推荐 ========== */
.products-section {
    background: var(--bg-gray);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--text-color);
}

.more-link {
    font-size: 1.3rem;
    color: var(--secondary-color);
}

.product-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.3s ease;
}

.product-card:active {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.product-image {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    background: var(--accent-color);
    color: #fff;
    font-size: 1.1rem;
    border-radius: 3px;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 5px;
}

.product-desc {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.product-price {
    font-size: 1.6rem;
    color: var(--accent-color);
    font-weight: bold;
}

/* ========== 新闻资讯 ========== */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-item {
    display: flex;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.3s ease;
}

.news-item:active {
    transform: translateX(3px);
}

.news-date {
    flex-shrink: 0;
    width: 50px;
    text-align: center;
    padding-right: 15px;
    border-right: 2px solid var(--border-color);
    margin-right: 15px;
}

.date-day {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.date-month {
    display: block;
    font-size: 1.2rem;
    color: var(--text-light);
}

.news-content {
    flex: 1;
}

.news-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-summary {
    font-size: 1.3rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--secondary-color);
    color: #fff;
    font-size: 1.1rem;
    border-radius: 3px;
}

.news-views {
    font-size: 1.2rem;
    color: var(--text-light);
}

/* ========== 服务特色 ========== */
.features-section {
    background: var(--bg-gray);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.feature-item {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.3s ease;
}

.feature-item:active {
    transform: scale(0.98);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.feature-title {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 1.3rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* ========== 合作伙伴 ========== */
.partners-section {
    padding: 40px 0;
}

.partners-scroll {
    overflow: hidden;
    margin-top: 30px;
    position: relative;
}

.partners-list {
    display: flex;
    gap: 30px;
    animation: scroll 15s linear infinite;
}

.partner-item {
    flex-shrink: 0;
    width: 120px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.partner-item img {
    max-width: 100px;
    max-height: 50px;
    object-fit: contain;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ========== 返回顶部按钮 ========== */
.back-to-top {
    position: fixed;
    bottom: 60px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-color);
    z-index: 900;
    transition: all 0.3s ease;
}

.back-to-top.show {
    display: flex;
}

.back-to-top:active {
    transform: scale(0.9);
}

.back-to-top span {
    font-size: 2rem;
    line-height: 1;
}

/* ========== 社交链接 ========== */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.social-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.social-icon:hover {
    opacity: 1;
}

/* ========== 响应式优化 ========== */
@media (max-width: 360px) {
    .entry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .banner-section {
        height: 300px;
    }
    
    .product-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .banner-text h2 {
        font-size: 2.5rem;
    }
    
    .banner-text p {
        font-size: 1.6rem;
    }
}

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

.section {
    animation: fadeIn 0.6s ease;
}

/* 确保页面可以正常滚动 */
html, body {
    width: 100%;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}