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

body {
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: white;
    color: #000;
    line-height: 1.4;
    width: 100%;
    min-width: 375px;
    max-width: 430px;
    min-height: 667px;
    max-height: 932px;
    margin: 0 auto;
    position: relative;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* 主标题栏 */
.header {
    width: 100%;
    max-width: 430px;
    min-width: 375px;
    height: 70px;
    padding: 0 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
}

.title-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-section img {
    width: 24px;
    height: 24px;
}

.back-icon {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.back-icon:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.back-icon:active {
    transform: scale(0.95);
}

.title-section h1 {
    font-family: '斗鱼追光体', sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: #000;
}

.search-bar {
    width: 48%;
    max-width: 200px;
    min-width: 160px;
    height: 32px;
    background: #DEDEDE;
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 0 4px 0 12px;
    gap: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.search-bar.active {
    background: #FFF;
    border: 1px solid #FF5F57;
    box-shadow: 0 2px 8px rgba(255, 95, 87, 0.2);
}

.search-btn {
    padding: 5px 12px;
    background: #FF5F57;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
    font-weight: 500;
    flex-shrink: 0;
    height: 24px;
    line-height: 1;
}

.search-btn:hover {
    background: #FF4747;
    box-shadow: 0 2px 4px rgba(255, 95, 87, 0.3);
}

.search-btn:active {
    transform: scale(0.98);
}

.search-bar .search-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.search-bar .search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    color: #333;
    padding: 0;
    width: 100%;
    min-width: 0;
}

.search-bar .search-input::placeholder {
    color: #969191;
    font-size: 13px;
}

.search-bar .clear-search {
    width: 18px;
    height: 18px;
    background: #999;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s ease;
    margin-right: 2px;
}

.search-bar .clear-search:hover {
    background: #666;
    transform: scale(1.15);
}

/* 搜索结果提示 */
.search-result-info {
    padding: 10px 15px;
    background: #F8F8F8;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-result-info .result-text {
    font-size: 14px;
    color: #666;
}

.search-result-info .result-text strong {
    color: #FF5F57;
    font-weight: 600;
}

.search-result-info .back-btn {
    padding: 4px 12px;
    background: #FF5F57;
    color: white;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.search-result-info .back-btn:hover {
    background: #FF4747;
    transform: scale(1.05);
}

/* 主内容区域 */
.main-content {
    margin-top: 165px; /* 为固定的标题栏、分类标签和筛选标签留出空间 */
    padding: 0 4%;
    padding-top: 10px;
    min-height: calc(100vh - 165px);
    max-width: 430px;
    min-width: 375px;
    margin-left: auto;
    margin-right: auto;
}

/* 搜索模式下的主内容区域 */
body.search-mode .main-content {
    margin-top: 90px; /* 搜索模式下减少顶部距离 */
    padding-top: 0;
}

/* 分类标签 */
.category-tabs {
    position: fixed;
    top: 70px; /* 标题栏高度70px */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    min-width: 375px;
    background: white;
    z-index: 998;
    padding: 10px 4% 8px 4%;
    margin-bottom: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    min-width: 52px;
    height: 31px;
    background: #E8E8E8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0 12px;
    white-space: nowrap;
}

.tab.active {
    background: #FFE5E5;
}

.tab span {
    font-size: 18px;
    color: #000;
}

.tab.active span {
    color: #FF5F57;
}

/* 地区选择标签特殊样式 */
.region-tab {
    display: flex;
    align-items: center;
    gap: 4px;
}

.region-tab .switch-icon {
    width: 18px;
    height: 18px;
    color: #666;
    transition: transform 0.3s ease, color 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
    pointer-events: all;
}

.region-tab .switch-icon path {
    pointer-events: none;
}

/* 只有在激活状态下才显示交互效果 */
.region-tab.active .switch-icon {
    color: #FF5F57;
    cursor: pointer;
}

.region-tab.active:hover .switch-icon {
    color: #FF5F57;
    transform: rotate(90deg);
}

/* 未激活状态下，切换图标显示为灰色且不可点击 */
.region-tab:not(.active) .switch-icon {
    color: #999;
    cursor: not-allowed;
    opacity: 0.5;
}

/* 筛选标签 */
.filter-tags {
    position: fixed;
    top: 119px; /* 标题栏70px + 分类标签49px */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    min-width: 375px;
    background: white;
    z-index: 997;
    padding: 8px 4%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-tags::-webkit-scrollbar {
    height: 3px;
}

.filter-tags::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.filter-tags::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.filter-tags::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.filter-tags-container {
    display: flex;
    gap: 10px;
    white-space: nowrap;
}

.filter-tag {
    font-size: 14px;
    color: #333;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
    border-radius: 14px;
    background: #F5F5F5;
    border: 1px solid transparent;
    position: relative;
    user-select: none;
    line-height: 1.4;
}

.filter-tag:hover {
    background: #EBEBEB;
    border-color: #E0E0E0;
    transform: translateY(-1px);
}

.filter-tag:active {
    transform: translateY(0);
}

.filter-tag.active {
    color: #FF5F57;
    background: #FFE5E5;
    border-color: #FF9999;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(255, 95, 87, 0.2);
}

/* 酒店卡片网格 - 响应式双列布局 */
.attractions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(12px, 4vw, 16px);
    margin-bottom: 20px;
}

.attraction-card {
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.attraction-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.attraction-card .card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    background: #F5F5F5;
}

.attraction-card .card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attraction-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 距离标签 */
.distance-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: white;
    font-weight: 500;
    z-index: 1;
}

.distance-badge .location-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.distance-badge span {
    line-height: 1;
    white-space: nowrap;
}

.card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 140px;
}

/* 酒店名称 */
.scenic-name {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scenic-level {
    font-size: 12px;
    font-weight: 400;
    color: #666;
    background: #F0F0F0;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* 推荐语 */
.recommendation {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 39px; /* 确保两行高度一致 */
}

/* 酒店标签 */
.scenic-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 2px 0 4px 0;
    min-height: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding-bottom: 2px;
}

.scenic-tags::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.scenic-tag {
    font-size: 11px;
    color: #FF5F57;
    background: linear-gradient(135deg, #FFE5E5 0%, #FFF0F0 100%);
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    line-height: 1.4;
    border: 1px solid rgba(255, 95, 87, 0.2);
    font-weight: 500;
    flex-shrink: 0; /* 防止标签被压缩 */
}

/* 卡片底部：评分和价格 */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #F0F0F0;
}

.rating-section {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #FFF5F5;
    border-radius: 8px;
}

.rating-icon {
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(255, 95, 87, 0.3));
}

.rating {
    font-size: 14px;
    color: #FF5F57;
    font-weight: 600;
}

.price-section {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price-label {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

.price {
    font-size: 18px;
    color: #FF0000;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.attraction-card {
    animation: fadeIn 0.5s ease-out;
}

/* 加载状态 */
.loading {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 16px;
    color: #666;
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #999;
}

/* 地区模式空状态 */
.region-empty-state {
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.region-empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.region-empty-state h3 {
    font-size: 20px;
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
}

.region-empty-state p {
    font-size: 15px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
    max-width: 280px;
}

.switch-region-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #FF5F57;
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 95, 87, 0.3);
}

.switch-region-btn:hover {
    background: #FF4747;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 95, 87, 0.4);
}

.switch-region-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 95, 87, 0.3);
}

.switch-region-btn .switch-icon-small {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* 地区选择模态框 */
.region-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.region-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 380px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: #F5F5F5;
    border-radius: 50%;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.region-selector {
    display: flex;
    height: calc(80vh - 70px);
    overflow: hidden;
}

.region-sidebar {
    width: 120px;
    background: #F8F8F8;
    border-right: 1px solid #F0F0F0;
    overflow-y: auto;
}

.region-option {
    padding: 12px 16px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.region-option.active {
    background: white;
    color: #FF5F57;
    font-weight: 500;
    border-right: 2px solid #FF5F57;
}

.region-option:hover {
    background: #F0F0F0;
}

.province-list {
    overflow-y: auto;
    flex: 1;
}

.province-item {
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #F8F8F8;
}

.province-item:hover {
    background: #F8F8F8;
}

.province-item.active {
    background: #FFE5E5;
    color: #FF5F57;
    font-weight: 500;
}

.region-main {
    flex: 1;
    overflow-y: auto;
}

.city-list {
    padding: 8px 0;
}

.city-item {
    padding: 12px 20px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.city-item:hover {
    background: #F8F8F8;
}

.city-item.active {
    background: #FFE5E5;
    color: #FF5F57;
    font-weight: 500;
}

.city-item.all-cities {
    font-weight: 500;
    color: #666;
    border-bottom: 1px solid #F0F0F0;
    margin-bottom: 8px;
}

/* 滚动条样式 */
.region-sidebar::-webkit-scrollbar,
.province-list::-webkit-scrollbar,
.region-main::-webkit-scrollbar {
    width: 4px;
}

.region-sidebar::-webkit-scrollbar-track,
.province-list::-webkit-scrollbar-track,
.region-main::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.region-sidebar::-webkit-scrollbar-thumb,
.province-list::-webkit-scrollbar-thumb,
.region-main::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

