/* 公共CSS文件 */

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    background: #f5f5f5;
}

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

/* ==================== Header 样式 ==================== */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: #2a9d8f;
}

.logo::before {
    content: "❤️";
    margin-right: 10px;
    flex-shrink: 0;
}

.logo-text {
    display: inline-block;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    text-decoration: none;
    color: #555;
    font-size: 15px;
    font-weight: 500;
}

.nav a:hover,
.nav a.active {
    color: #2a9d8f;
}

.user-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
}

.btn-login {
    color: #2a9d8f;
    border: 1px solid #2a9d8f;
}

.btn-register {
    background: #2a9d8f;
    color: #fff;
}

/* ==================== Footer 样式 ==================== */
.footer {
    background: #264653;
    color: #fff;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer h4 {
    font-size: 16px;
    margin-bottom: 20px;
}

.footer ul {
    list-style: none;
}

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

.footer a {
    color: #b0c4c0;
    text-decoration: none;
    font-size: 14px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: #b0c4c0;
    font-size: 13px;
}

/* ==================== 模态框样式 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    position: relative;
}

.modal-content.large {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
}

.modal-close:hover {
    color: #333;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.modal-content input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.modal-content input:focus {
    outline: none;
    border-color: #2a9d8f;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: #2a9d8f;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.btn-submit:hover {
    background: #21867a;
}

.modal-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.modal-footer a {
    color: #2a9d8f;
    text-decoration: none;
    font-weight: 500;
}

/* ==================== 加载状态 ==================== */
.loading {
    color: #999;
    font-size: 14px;
}

/* ==================== 图片懒加载 ==================== */
img[data-src] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==================== 响应式样式 ==================== */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .recommend-grid,
    .hotels-grid,
    .attractions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .recommend-grid,
    .hotels-grid,
    .attractions-grid {
        grid-template-columns: 1fr;
    }
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    .search-form,
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .form-group {
        min-width: 100%;
    }
    .btn-search {
        width: 100%;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    .footer-content {
        grid-template-columns: 1fr;
    }
    .search-tabs {
        flex-wrap: wrap;
    }
    .tab {
        padding: 8px 16px;
        font-size: 12px;
    }
}
