/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}



:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #777;
    --white: #fff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    color: var(--text-color);
    background-color: var(--light-gray);
    line-height: 1.6;
}

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

/* 头部样式 */
header {
    background-color: rgb(66 191 152);
    padding: 15px 0;
    box-shadow: var(--shadow);
}

/* Banner样式 */
.banner {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
}

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

.banner img:hover {
    transform: scale(1.02);
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--white);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #FFFFFF;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: rgb(66 191 152);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

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

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #27ae60;
}

.btn-accent {
    background-color: var(--accent-color);
}

.btn-accent:hover {
    background-color: #c0392b;
}

/* 主内容区样式 */
main {
    padding: 40px 0;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-color);
    border-bottom: 2px solid rgb(66 191 152);
    padding-bottom: 10px;
}

/* 列表页样式 */
.listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.listing-card {
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.listing-card:hover {
    transform: translateY(-5px);
}

.listing-image {
    height: 200px;
    overflow: hidden;
}

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

.listing-card:hover .listing-image img {
    transform: scale(1.05);
}

.listing-content {
    padding: 20px;
}

.listing-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.listing-card a {
    text-decoration: none;
}

.listing-details {
    color: var(--dark-gray);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display:-webkit-box;
overflow:hidden;
text-overflow:ellipsis;
-webkit-line-clamp:4;
-webkit-box-orient:vertical;
}

.listing-details .red{
	color: red;
}

.listing-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 15px;
}

/* 详情页样式 */
.detail-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.detail-image {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.detail-image img {
    width: 100%;
    height: auto;
}

.detail-content {
    background-color: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.detail-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.detail-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: var(--dark-gray);
    font-size: 0.9rem;
}

.detail-description {
    margin-bottom: 25px;
    line-height: 1.7;
}

.detail-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 25px;
}

.seller-info {
    background-color: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.seller-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.seller-details {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.seller-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
}

.seller-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.seller-rating {
    color: #f1c40f;
}

.contact-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

/* 表单样式 */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: rgb(66 191 152);
}

.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    font-size: 1rem;
    resize: vertical;
    min-height: 150px;
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    font-size: 1rem;
    background-color: var(--white);
}

.form-submit {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: var(--white);
    padding: 40px 0;
    margin-top: 60px;
}

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

.footer-column h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: rgb(66 191 152);
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #444;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }

    .nav-links {
        margin-top: 15px;
    }

    .nav-links li {
        margin-left: 15px;
        margin-right: 15px;
    }

    .detail-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links li {
        margin: 5px 10px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .listings {
        grid-template-columns: 1fr;
    }
}

/* 自定义组件样式 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.alert-success {
    background-color: #dff0d8;
    color: #3c763d;
}

.alert-error {
    background-color: #f2dede;
    color: #a94442;
}

.spinner {
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 5px solid rgb(66 191 152);
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* 标签样式 */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    background-color: var(--light-gray);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--dark-gray);
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    list-style: none;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin: 0 10px;
    color: var(--dark-gray);
}

.breadcrumb a {
    color: var(--dark-gray);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: rgb(66 191 152);
}

.breadcrumb li:last-child {
    color: rgb(66 191 152);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    margin-top: 40px;
}

.pagination li {
    margin: 0 5px;
}

.pagination a {
    display: block;
    padding: 8px 15px;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: var(--light-gray);
    border-color: rgb(66 191 152);
}

.pagination .active a {
    background-color: rgb(66 191 152);
    color: var(--white);
    border-color: rgb(66 191 152);
}