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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* 头部样式 */
header {
    background-color: #2c3e50;
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #3498db;
}

/* 主体内容 */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 180px);
}

.page-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

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

/* 产品列表 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.product-card {
    text-align: center;
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.product-card h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.product-card .price {
    color: #e74c3c;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

/* 产品详情 */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.product-detail img {
    width: 100%;
    border-radius: 8px;
}

.product-info h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.product-info .price {
    color: #e74c3c;
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.product-info .description {
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* 分类列表 */
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-item {
    background: #fff;
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* 高亮状态的样式 */
.category-item.active {
    background-color: #3498db !important; /* 使用 !important 覆盖内联样式或默认背景 */
    color: #fff !important;
}

.category-item:hover {
    background-color: #3498db;
    color: #fff;
}

/* 关于我们 */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.about-content h3 {
    margin: 2rem 0 1rem 0;
    color: #2c3e50;
}

/* 登录注册表单 */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.auth-form .btn {
    width: 100%;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-link a {
    color: #3498db;
    text-decoration: none;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 1rem;
        justify-content: center;
    }
    
    nav ul li {
        margin: 0.5rem 1rem;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
}



#pagination {
    display: flex;
    justify-content: center; /* 水平居中 */
    align-items: center;     /* 垂直居中 */
    gap: 8px;                /* 统一设置按钮之间的间距 */
    margin-top: 20px;
    padding: 10px 0;
}

#pagination button,
#pagination span {
    min-width: 36px;         /* 保证数字按钮的最小宽度一致 */
    height: 36px;            /* 固定高度 */
    padding: 0 10px;         /* 左右内边距 */

    border: 1px solid #dee2e6; /* 浅灰色边框 */
    background-color: #fff;    /* 白色背景 */
    color: #007bff;            /* 主题蓝色文字 */

    border-radius: 4px;        /* 轻微圆角 */
    font-size: 14px;           /* 适中的字体大小 */
    cursor: pointer;           /* 鼠标指针变为手型 */
    transition: all 0.2s ease; /* 添加平滑过渡动画 */
}

#pagination button:hover:not(:disabled) {
    background-color: #e9ecef; /* 悬停时背景变灰 */
    border-color: #adb5bd;     /* 边框颜色加深 */
    z-index: 2;                /* 提升层级，防止边框被遮挡 */
}

#pagination button[style*="background-color: rgb(0, 123, 255)"] {
    background-color: #007bff !important;
    color: #fff !important;
    border-color: #007bff;
    font-weight: bold;
    cursor: default;           /* 当前页不可点击，恢复默认指针 */
    z-index: 3;                /* 确保高亮在最上层 */
}

#pagination button:disabled {
    background-color: #f8f9fa;
    color: #6c757d;            /* 灰色文字 */
    border-color: #dee2e6;
    cursor: not-allowed;       /* 显示禁止点击的光标 */
    opacity: 0.6;              /* 降低透明度，视觉弱化 */
}

#pagination span {
    border: none;              /* 省略号不需要边框 */
    background: transparent;   /* 透明背景 */
    color: #6c757d;            /* 灰色文字 */
    cursor: default;
}
