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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* 加载指示器 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    display: none;
}

.loader::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示框样式 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 10000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.message.success {
    background-color: #28a745;
    border-left: 5px solid #1e7e34;
}

.message.error {
    background-color: #dc3545;
    border-left: 5px solid #c82333;
}

.message.warning {
    background-color: #ffc107;
    border-left: 5px solid #e0a800;
    color: #333;
}

.message.info {
    background-color: #17a2b8;
    border-left: 5px solid #138496;
}

.message.show {
    opacity: 1;
    transform: translateY(0);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

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

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* 导航栏样式 */
.navbar {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.navbar-brand a {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
}

.navbar-menu {
    display: flex;
    align-items: center;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin-right: 30px;
}

.nav-item {
    margin: 0 15px;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: #007bff;
}

.navbar-actions {
    display: flex;
    gap: 10px;
}

/* 轮播图样式 */
.carousel {
    padding: 50px 0;
    background-color: #e9ecef;
}

.carousel h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px;
}

.carousel-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 20px 0;
    scroll-behavior: smooth;
}

.carousel-item {
    flex: 0 0 350px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.carousel-item:hover {
    transform: translateY(-10px);
}

.carousel-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.carousel-item-info {
    padding: 20px;
}

.carousel-item-info h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.carousel-item-info p {
    margin-bottom: 15px;
    color: #666;
}

.carousel-item-info .price {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 20px;
}

/* 软件网格样式 */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.software-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

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

.software-image {
    height: 150px;
    overflow: hidden;
}

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

.software-card:hover .software-image img {
    transform: scale(1.1);
}

.software-info {
    padding: 20px;
}

.software-info h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.software-rating {
    margin-bottom: 15px;
}

.star {
    color: #ffc107;
    font-size: 16px;
}

.star.filled {
    color: #ff9800;
}

.software-price {
    font-size: 20px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 20px;
}

.view-more {
    text-align: center;
    margin-top: 30px;
}

/* 充值区域样式 */
.recharge-section {
    padding: 80px 0;
    background-color: #007bff;
    color: white;
}

.recharge-content {
    text-align: center;
}

.recharge-content h2 {
    font-size: 36px;
    margin-bottom: 15px;
}

.recharge-content p {
    font-size: 18px;
    margin-bottom: 30px;
}

.recharge-content .btn {
    background-color: white;
    color: #007bff;
}

.recharge-content .btn:hover {
    background-color: #e9ecef;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.error-messages {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.error-messages p {
    margin: 5px 0;
}

/* 登录/注册表单容器 */
.login-form, .register-form {
    max-width: 500px;
    margin: 50px auto;
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.login-form h2, .register-form h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: #007bff;
}

.login-link, .register-link {
    text-align: center;
    margin-top: 20px;
}

.login-link a, .register-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.login-link a:hover, .register-link a:hover {
    text-decoration: underline;
}

/* 页脚样式 */
.footer {
    background-color: #343a40;
    color: white;
    padding: 50px 0;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
    color: #adb5bd;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 99;
}

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

.back-to-top:hover {
    background-color: #0056b3;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 导航栏 */
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: white;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: left 0.3s ease;
        z-index: 99;
    }
    
    .navbar-menu.active {
        left: 0;
    }
    
    .navbar-nav {
        flex-direction: column;
        align-items: center;
        margin-right: 0;
        margin-bottom: 30px;
    }
    
    .nav-item {
        margin: 15px 0;
    }
    
    /* 轮播图 */
    .carousel-item {
        flex: 0 0 280px;
    }
    
    /* 软件网格 */
    .software-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    /* 表单容器 */
    .login-form, .register-form {
        margin: 30px 20px;
        padding: 30px;
    }
}

@media (max-width: 1024px) {
    /* 导航栏 */
    .nav-item {
        margin: 0 10px;
    }
    
    /* 轮播图 */
    .carousel-item {
        flex: 0 0 300px;
    }
}