/* 基础样式重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 变量定义 */
:root {
    --primary-color: #4d61fc;
    --secondary-color: #6c7ae0;
    --accent-color: #ff6b6b;
    --text-color: #333;
    --text-light: #777;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --bg-dark: #2d3748;
    --border-color: #e6e6e6;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --radius: 6px;
    --radius-lg: 10px;
    --container-width: 1200px;
}

/* 全局样式 */
body {
    font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-light);
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

button, .btn {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-full {
    width: 100%;
}

section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.section-header p {
    font-size: 18px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    margin-top: 20px;
}

/* 顶部导航栏 */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.main-nav {
    display: flex;
}

.main-nav li {
    margin: 0 15px;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 10px 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.user-actions {
    display: flex;
    align-items: center;
}

.search-bar {
    display: flex;
    margin-right: 20px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.search-bar input {
    padding: 10px 15px;
    border: none;
    outline: none;
    width: 200px;
}

.search-bar button {
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.user-menu {
    display: flex;
    align-items: center;
}

.user-menu a {
    margin-left: 15px;
    font-weight: 500;
}

.login-btn, .register-btn {
    padding: 8px 15px;
}

.register-btn {
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--radius);
}

.cart-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent-color);
    color: white;
    font-size: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.mobile-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 2px 0;
    border-radius: 3px;
}

/* 轮播图 */
.hero-slider {
    position: relative;
    overflow: hidden;
    height: 500px;
}

.slider-container {
    position: relative;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    max-width: 500px;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.slide-content h2 {
    font-size: 42px;
    margin-bottom: 20px;
}

.slide-content p {
    font-size: 18px;
    margin-bottom: 30px;
}

.slider-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    z-index: 2;
}

.prev-btn, .next-btn {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.prev-btn:hover, .next-btn:hover {
    background-color: var(--primary-color);
}

.slider-dots {
    display: flex;
    margin: 0 20px;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background-color: white;
}

/* 分类导航 */
.category-section {
    background-color: white;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 30px;
}

.category-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.category-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: rgba(77, 97, 252, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
}

.category-card h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.category-card p {
    color: var(--text-light);
    font-size: 14px;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.product-thumb {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-thumb img {
    transform: scale(1.05);
}

.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
}

.badge {
    padding: 5px 10px;
    font-size: 12px;
    color: white;
    border-radius: 3px;
    margin-bottom: 5px;
}

.badge.hot {
    background-color: var(--accent-color);
}

.badge.new {
    background-color: #00c9a7;
}

.badge.discount {
    background-color: #ff922b;
}

.badge.featured {
    background-color: #845ef7;
}

.product-actions {
    position: absolute;
    right: 10px;
    bottom: -50px;
    display: flex;
    flex-direction: column;
    transition: bottom 0.3s ease;
}

.product-card:hover .product-actions {
    bottom: 10px;
}

.product-actions button {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: white;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0;
    transition: var(--transition);
}

.product-actions button:hover {
    background-color: var(--primary-color);
    color: white;
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.product-title {
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.4;
    height: 45px;
    overflow: hidden;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.rating {
    color: #ffc107;
}

.rating span {
    color: var(--text-light);
    margin-left: 5px;
}

.download-count {
    color: var(--text-light);
}

.product-price {
    display: flex;
    align-items: center;
}

.current-price {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.original-price {
    font-size: 14px;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: 10px;
}

/* 分类标签 */
.section-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tab {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: white;
    font-size: 14px;
    transition: var(--transition);
}

.tab.active, .tab:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.view-all {
    font-weight: 500;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.view-all i {
    margin-left: 5px;
    transition: var(--transition);
}

.view-all:hover i {
    transform: translateX(5px);
}

/* 会员卡片 */
.membership-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.membership-card {
    background-color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    padding: 30px;
}

.membership-card.featured {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
}

.membership-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 5px 15px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 14px;
}

.membership-header {
    text-align: center;
    margin-bottom: 30px;
}

.membership-header h3 {
    font-size: 22px;
    margin-bottom: 15px;
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
}

.period {
    font-size: 16px;
    color: var(--text-light);
    margin-left: 5px;
}

.membership-features {
    margin-bottom: 30px;
}

.membership-features ul li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.membership-features ul li i {
    margin-right: 10px;
    color: #00c9a7;
}

.membership-features ul li.disabled {
    color: var(--text-light);
}

.membership-features ul li.disabled i {
    color: #ff6b6b;
}

/* 用户评价 */
.testimonial-section {
    background-color: var(--bg-light);
}

.testimonial-slider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}

.testimonial-content {
    position: relative;
    padding-bottom: 30px;
}

.testimonial-content::before {
    content: '\201C';
    font-size: 60px;
    color: rgba(77, 97, 252, 0.1);
    position: absolute;
    top: -20px;
    left: -10px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.testimonial-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
}

.author-info h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.author-info p {
    font-size: 14px;
    color: var(--text-light);
}

/* 页脚 */
footer {
    background-color: var(--bg-dark);
    color: white;
    padding-top: 70px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-column {
    margin-bottom: 30px;
}

.footer-logo h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: white;
}

.footer-column p {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.social-links {
    display: flex;
}

.social-links a {
    width: 35px;
    height: 35px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 10px;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-column ul li a:hover {
    color: white;
    padding-left: 5px;
}

.contact-info li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.7);
}

.contact-info li i {
    width: 25px;
    margin-right: 10px;
    color: var(--primary-color);
}

.subscribe-form {
    position: relative;
    margin-top: 20px;
}

.subscribe-form input {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border-radius: var(--radius);
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    outline: none;
}

.subscribe-form button {
    position: absolute;
    right: 5px;
    top: 5px;
    height: 36px;
    width: 36px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    margin-left: 20px;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    font-size: 24px;
    background: none;
    color: var(--text-light);
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary-color);
}

.form-options {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--border-color);
}

.login-divider span {
    background-color: white;
    padding: 0 10px;
    position: relative;
    color: var(--text-light);
    font-size: 14px;
}

.social-login {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.social-btn {
    flex: 1;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 14px;
    color: white;
}

.social-btn.wechat {
    background-color: #07c160;
}

.social-btn.qq {
    background-color: #12b7f5;
}

.social-btn i {
    margin-right: 8px;
}

.register-link {
    text-align: center;
    font-size: 14px;
    margin-top: 20px;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 99;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-5px);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .section-header h2 {
        font-size: 28px;
    }
    
    .hero-slider {
        height: 400px;
    }
    
    .slide-content h2 {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-wrap: wrap;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 20px 0;
        order: 3;
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .main-nav li {
        margin: 10px 0;
    }
    
    .user-actions {
        order: 2;
    }
    
    .search-bar {
        width: 100%;
        margin-right: 0;
    }
    
    .search-bar input {
        width: 100%;
    }
    
    .user-menu .login-btn, .user-menu .register-btn {
        display: none;
    }
    
    .hero-slider {
        height: 350px;
    }
    
    .slide-content {
        left: 5%;
        max-width: 90%;
    }
    
    .slide-content h2 {
        font-size: 28px;
    }
    
    .slide-content p {
        font-size: 16px;
    }
    
    section {
        padding: 50px 0;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 20px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .membership-card.featured {
        transform: none;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        margin-top: 15px;
    }
    
    .footer-links a {
        margin: 0 10px;
    }
}

@media (max-width: 576px) {
    .logo h1 {
        font-size: 20px;
    }
    
    .hero-slider {
        height: 300px;
    }
    
    .slide-content h2 {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .slide-content p {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .section-header h2 {
        font-size: 24px;
    }
    
    .section-header p {
        font-size: 16px;
    }
    
    .tabs {
        width: 100%;
        margin-bottom: 15px;
        justify-content: center;
    }
    
    .section-controls {
        flex-direction: column;
    }
    
    .view-all {
        margin-top: 15px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonial-slider {
        grid-template-columns: 1fr;
    }
}
