/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

body {
    background-color: #f8f5f0;
    color: #333;
    line-height: 1.6;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #8b0000, #b22222);
    color: white;
    padding: 1.8rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23a52a2a' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.2;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

h1 i {
    font-size: 2.2rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* 导航栏 */
nav {
    background-color: #6a0c0c;
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 1rem;
    transition: all 0.3s;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover, .nav-links a.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 城市筛选 */
.city-filter {
    background-color: #fff;
    padding: 1.8rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

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

.filter-title {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    color: #8b0000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.city-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.city-btn {
    background-color: #f0f0f0;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.city-btn i {
    font-size: 0.9rem;
}

.city-btn.active, .city-btn:hover {
    background-color: #8b0000;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(139, 0, 0, 0.2);
}

/* 搜索区域 */
.search-section {
    background-color: #f9f9f9;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

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

.search-box {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 30px;
    padding: 5px 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.search-box i {
    color: #8b0000;
    font-size: 1.2rem;
    margin-right: 10px;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 12px 0;
    font-size: 1rem;
    outline: none;
    background: transparent;
}

.search-box button {
    background-color: #8b0000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.search-box button:hover {
    background-color: #6a0c0c;
    transform: translateY(-2px);
}

/* 内容区域 */
.content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 15px;
}

.section-title {
    font-size: 1.6rem;
    color: #8b0000;
    border-left: 5px solid #8b0000;
    padding-left: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-count {
    color: #666;
    font-size: 1rem;
    background-color: #f0f0f0;
    padding: 8px 15px;
    border-radius: 20px;
}

/* 加载动画 */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #8b0000;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* 遗址卡片网格 */
.heritage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 3rem;
}

.heritage-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.heritage-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-img-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #8b0000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-location {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-desc {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.card-city {
    background-color: #f0f0f0;
    color: #8b0000;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.view-btn {
    color: #8b0000;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.view-btn:hover {
    color: #6a0c0c;
    gap: 8px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px 0;
}

.modal-content {
    background-color: white;
    margin: 2rem auto;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    overflow: hidden;
    animation: modalFade 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes modalFade {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.modal-header {
    padding: 1.5rem;
    background-color: #8b0000;
    color: white;
    position: relative;
}

.modal-title {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    padding-right: 30px;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.2rem;
    cursor: pointer;
    color: white;
    transition: all 0.3s;
    line-height: 1;
}

.close-modal:hover {
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-image-container {
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.modal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.modal-section {
    margin-bottom: 1.8rem;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section-title {
    font-size: 1.3rem;
    color: #8b0000;
    margin-bottom: 0.8rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-section p {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
}

.specialty-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0.5rem;
}

.specialty-item {
    background-color: #f0f0f0;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.specialty-item i {
    color: #8b0000;
    font-size: 0.8rem;
}

/* 页脚 */
footer {
    background-color: #333;
    color: #ddd;
    padding: 3rem 0 2rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

.footer-content p:first-child {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.footer-content p:nth-child(2) {
    color: #aaa;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-links a:hover {
    color: #8b0000;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .heritage-grid {
        grid-template-columns: 1fr;
    }

    .nav-container {
        flex-direction: column;
        gap: 10px;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .nav-links a {
        margin-left: 0;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }

    h1 {
        font-size: 2rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem auto;
    }

    .modal-body {
        max-height: 80vh;
    }
}