/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS变量定义 */
:root {
    --min-width: 375px;
    --max-width: 430px;
    --min-height: 667px;
    --max-height: 932px;
    --base-font-size: clamp(14px, 4vw, 16px);
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #FAFAFA;
    color: #333;
    overflow-x: hidden;
    line-height: 1.4;
    font-size: var(--base-font-size);
}

/* 应用容器 - 自适应宽度和高度 */
.app-container {
    width: 100%;
    min-width: var(--min-width);
    max-width: var(--max-width);
    height: 100vh;
    min-height: var(--min-height);
    max-height: var(--max-height);
    background: linear-gradient(to bottom, #F8F8F8 0%, #FFFFFF 50%, #F5F5F5 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 宽度范围：375px-430px */
@media screen and (max-width: 375px) {
    .app-container {
        width: var(--min-width);
        font-size: 14px;
    }
}

@media screen and (min-width: 430px) {
    .app-container {
        width: var(--max-width);
        font-size: 16px;
    }
}

/* 高度范围：667px-932px */
@media screen and (max-height: 667px) {
    .app-container {
        height: var(--min-height);
    }
}

@media screen and (min-height: 932px) {
    .app-container {
        height: var(--max-height);
    }
}

/* 搜索栏部分 */
.search-section {
    background: #FFFFFF;
    padding: clamp(12px, 3.5vh, 16px) clamp(10px, 3vw, 13px);
    width: 100%;
    border-radius: 0 0 clamp(14px, 4vw, 18px) clamp(14px, 4vw, 18px);
    margin: 0 0 clamp(8px, 2vh, 12px) 0;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.top-bar {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2.5vw, 12px);
    margin-bottom: 8px;
    padding-bottom: 8px;
    min-height: 32px;
    position: relative;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background: #FFFFFF;
    padding-right: clamp(6px, 2vw, 10px);
    cursor: pointer;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.location-info:hover {
    opacity: 0.7;
}

.location-info span {
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 400;
    color: #000;
    user-select: none;
    white-space: nowrap;
}

.nav-container {
    flex: 1;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    min-width: 0;
    flex-shrink: 1;
}

.location-icon {
    width: clamp(20px, 6vw, 24px);
    height: clamp(20px, 6vw, 24px);
    flex-shrink: 0;
}

.nav-tabs {
    display: flex;
    align-items: center;
    gap: clamp(12px, 4.5vw, 20px);
    white-space: nowrap;
}

.nav-tab {
    font-size: clamp(16px, 5vw, 20px);
    font-weight: 400;
    color: #000;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.nav-tab.active {
    color: #FF5F57;
}

.search-bar {
    height: clamp(32px, 5vh, 36px);
    background: #FF9E9E;
    border-radius: clamp(14px, 4vw, 18px);
    display: flex;
    align-items: center;
    padding: 0 clamp(10px, 3vw, 12px);
    gap: clamp(6px, 2vw, 8px);
}

.search-icon, .voice-icon {
    width: clamp(20px, 6vw, 24px);
    height: clamp(20px, 6vw, 24px);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: clamp(14px, 4vw, 16px);
    color: #735E5E;
    placeholder-color: #735E5E;
}

.search-bar input::placeholder {
    color: #735E5E;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 0 clamp(12px, 4vw, 16px) clamp(60px, 18vh, 80px);
    width: 100%;
    max-width: var(--max-width);
    min-width: var(--min-width);
    margin: 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 轮播图 */
.banner-section {
    margin: clamp(8px, 2.5vh, 12px) 0 clamp(12px, 3.5vh, 16px) 0;
    position: relative;
}

.banner-container {
    width: 100%;
    height: clamp(140px, 25vh, 180px);
    border-radius: clamp(14px, 4vw, 18px);
    overflow: hidden;
    position: relative;
}

.banner-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.banner-slide.active {
    opacity: 1;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: clamp(14px, 4vw, 18px);
}

.banner-dots {
    position: absolute;
    bottom: clamp(10px, 2.5vh, 12px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(6px, 2vw, 8px);
    z-index: 10;
}

.dot {
    width: clamp(6px, 2vw, 8px);
    height: clamp(6px, 2vw, 8px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(4px);
}

.dot:hover {
    transform: scale(1.2);
}

.dot.active {
    background: rgba(255, 158, 158, 0.9);
    transform: scale(1.2);
}

/* 功能图标网格 */
.function-grid {
    background: #fff;
    border-radius: clamp(14px, 4vw, 18px);
    padding: clamp(12px, 3.5vw, 16px);
    margin: clamp(12px, 3.5vh, 16px) 0;
}

.grid-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.grid-row:last-child {
    margin-bottom: 8px;
}

.function-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 56px;
    cursor: pointer;
    transition: transform 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.function-item:hover {
    transform: scale(1.1);
}

.function-icon {
    width: clamp(32px, 9vw, 36px);
    height: clamp(32px, 9vw, 36px);
    margin-bottom: clamp(3px, 1vw, 4px);
}

.function-item span {
    font-size: clamp(12px, 3.5vw, 14px);
    text-align: center;
    color: #000;
}

.grid-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.page-dot {
    width: 20px;
    height: 4px;
}

/* 通用section样式 */
.featured-section, .immersive-section, .travel-together-section {
    background: #EEEEEE;
    border-radius: clamp(14px, 4vw, 18px);
    padding: clamp(12px, 3.5vw, 16px);
    margin: clamp(12px, 3.5vh, 16px) 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(8px, 2.5vh, 12px);
}

.section-header h3 {
    font-size: clamp(16px, 5vw, 20px);
    font-weight: 400;
    color: #000;
}

.more-link {
    font-size: 16px;
    font-weight: 400;
    color: #000;
    cursor: pointer;
}

/* 筛选标签 */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-tab {
    padding: 4px 8px;
    background: white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 400;
    color: #000;
    cursor: pointer;
    transition: background 0.3s ease;
}

.filter-tab.active {
    background: #FF9E9E;
}

/* 景点卡片 */
.attractions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.attraction-card {
    background: #DEDEDE;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.attraction-card:hover {
    transform: scale(1.02);
}

.attraction-image {
    width: 100%;
    height: 122px;
    object-fit: cover;
}

.attraction-info {
    padding: 8px;
}

.attraction-info h4 {
    font-size: 16px;
    font-weight: 400;
    color: #000;
    margin-bottom: 4px;
}

.attraction-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rating, .distance {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
}

.star-icon, .distance-icon {
    width: 16px;
    height: 16px;
}

.level {
    color: #F22E2E;
}

/* 沉浸式导览 */
.immersive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.immersive-card {
    background: #DEDEDE;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.immersive-card:hover {
    transform: scale(1.02);
}

.immersive-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.immersive-info {
    padding: 8px;
}

.immersive-info h4 {
    font-size: 16px;
    font-weight: 400;
    color: #000;
    margin-bottom: 4px;
}

.online-count {
    font-size: 12px;
    color: #FF1010;
}

.view-all {
    font-size: 16px;
    font-weight: 400;
    color: #000;
    cursor: pointer;
    text-align: right;
    display: block;
}

/* 一起去疯吧 */
.tab-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.tab-button {
    font-size: 16px;
    font-weight: 400;
    color: #FF5F57;
    cursor: pointer;
    white-space: nowrap;
}

.tab-button.active {
    color: #FF5F57;
}

.tab-button:not(.active) {
    color: #000;
}

.tab-more {
    font-size: 14px;
    color: #4E4E4E;
    cursor: pointer;
    margin-left: auto;
}

.travel-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.travel-item {
    border-bottom: 1px solid #D0D0D0;
    padding-bottom: 16px;
    display: flex;
    gap: 12px;
}

.travel-item:last-child {
    border-bottom: none;
}

.user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.travel-content {
    flex: 1;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.user-info h4 {
    font-size: 15px;
    font-weight: 400;
    color: #4E4E4E;
}

.date {
    font-size: 14px;
    color: #4E4E4E;
}

.stats {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.stat-item {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 400;
}

.interested {
    background: #FF9E9E;
    color: #4E4E4E;
}

.joined {
    background: #5DFF75;
    color: #4E4E4E;
}

.travel-desc {
    font-size: 18px;
    font-weight: 400;
    color: #000;
    line-height: 1.4;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    min-width: var(--min-width);
    height: clamp(50px, 8vh, 57px);
    background: #FF9E9E;
    border-radius: clamp(20px, 6.5vw, 28px) clamp(20px, 6.5vw, 28px) 0 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 clamp(16px, 4.5vw, 20px);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.nav-item:hover {
    transform: scale(1.1);
}

.nav-item.active {
    color: #FF5F57;
}

.nav-icon {
    width: clamp(20px, 6vw, 24px);
    height: clamp(20px, 6vw, 24px);
    margin-bottom: clamp(3px, 1vw, 4px);
}

.nav-item span {
    font-size: clamp(12px, 3.5vw, 14px);
    font-weight: 400;
    color: #000;
}

.nav-item.active span {
    color: #FF5F57;
}

/* 滚动样式优化 */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.top-bar::-webkit-scrollbar {
    height: 3px;
}

.top-bar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.top-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.function-grid, .featured-section, .immersive-section, .travel-together-section {
    animation: fadeIn 0.6s ease-out;
}

/* 响应式调整 - 宽度范围 375px-430px */
@media screen and (max-width: 375px) {
    .function-item span {
        font-size: 12px;
    }
    
    .attractions-grid, .immersive-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        gap: 12px;
        font-size: 16px;
    }
    
    .search-section {
        padding: 12px 10px;
    }
}

@media screen and (min-width: 430px) {
    .app-container {
        font-size: 16px;
    }
    
    .nav-tabs {
        gap: 20px;
        font-size: 20px;
    }
}

/* 响应式调整 - 高度范围 667px-932px */
@media screen and (max-height: 667px) {
    .banner-container {
        height: 140px;
    }
    
    .banner-dots {
        margin-top: 8px;
    }
    
    .featured-section, .immersive-section, .travel-together-section {
        margin: 10px 0;
        padding: 12px;
    }
    
    .main-content {
        padding-bottom: 60px;
    }
    
    .bottom-nav {
        height: 50px;
    }
}

@media screen and (min-height: 932px) {
    .banner-container {
        height: 180px;
    }
    
    .banner-dots {
        margin-top: 12px;
    }
    
    .main-content {
        padding: 0 clamp(12px, 4vw, 16px) clamp(80px, 10vh, 100px);
    }
    
    .travel-list {
        gap: clamp(16px, 4vh, 20px);
    }
    
    .featured-section, .immersive-section, .travel-together-section {
        padding: clamp(14px, 3.5vw, 18px);
    }
}

/* 中间尺寸的自适应 */
@media screen and (min-width: 375px) and (max-width: 430px) {
    .app-container {
        width: 100vw;
        max-width: 430px;
    }
}

@media screen and (min-height: 667px) and (max-height: 932px) {
    .app-container {
        height: 100vh;
        max-height: 932px;
    }
}

/* 城市选择模态框 */
.city-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.city-modal-content {
    background: #FFFFFF;
    border-radius: clamp(14px, 4vw, 18px);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.city-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(16px, 4vh, 20px);
    border-bottom: 1px solid #E5E5E5;
    flex-shrink: 0;
}

.city-modal-header h3 {
    font-size: clamp(18px, 5vw, 20px);
    font-weight: 500;
    color: #000;
    margin: 0;
}

.city-modal-close {
    font-size: clamp(24px, 6vw, 28px);
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.city-modal-close:hover {
    color: #333;
}

.city-search {
    padding: clamp(12px, 3vw, 16px);
    border-bottom: 1px solid #E5E5E5;
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 12px);
    background: #F8F8F8;
    flex-shrink: 0;
    position: relative;
}

.city-search .search-icon {
    width: clamp(18px, 5vw, 20px);
    height: clamp(18px, 5vw, 20px);
    flex-shrink: 0;
}

.city-search input {
    flex: 1;
    padding: clamp(8px, 2vw, 10px);
    border: 1px solid #E5E5E5;
    border-radius: clamp(6px, 1.5vw, 8px);
    font-size: clamp(14px, 4vw, 16px);
    outline: none;
    transition: border-color 0.3s ease;
    background: #FFFFFF;
}

.city-search input:focus {
    border-color: #FF9E9E;
}

.search-clear {
    width: clamp(20px, 5vw, 24px);
    height: clamp(20px, 5vw, 24px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    font-size: clamp(18px, 5vw, 20px);
    line-height: 1;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.search-clear:hover {
    color: #333;
}

.city-select-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.province-section {
    width: 40%;
    border-right: 1px solid #E5E5E5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.city-section {
    width: 60%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-title {
    padding: clamp(12px, 3vw, 16px);
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 500;
    color: #666;
    background: #F5F5F5;
    border-bottom: 1px solid #E5E5E5;
    flex-shrink: 0;
}

.province-list {
    flex: 1;
    overflow-y: auto;
    padding: clamp(4px, 1vw, 8px);
}

.city-list {
    flex: 1;
    overflow-y: auto;
    padding: clamp(4px, 1vw, 8px);
}

.city-placeholder {
    padding: clamp(20px, 5vw, 40px);
    text-align: center;
    color: #999;
    font-size: clamp(14px, 4vw, 16px);
}

.province-item {
    padding: clamp(12px, 3vw, 16px);
    border-radius: clamp(6px, 1.5vw, 8px);
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: clamp(2px, 0.5vw, 4px);
    font-size: clamp(14px, 4vw, 16px);
    color: #000;
}

.province-item:hover {
    background-color: #F5F5F5;
}

.province-item.active {
    background-color: #FFE5E5;
    color: #FF5F57;
    font-weight: 500;
}

.city-item {
    padding: clamp(12px, 3vw, 16px);
    border-radius: clamp(6px, 1.5vw, 8px);
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: clamp(2px, 0.5vw, 4px);
    font-size: clamp(14px, 4vw, 16px);
    color: #000;
}

.city-item:hover {
    background-color: #F5F5F5;
}

.city-item.active {
    background-color: #FFE5E5;
    color: #FF5F57;
    font-weight: 500;
}

/* 搜索结果样式 */
.search-results {
    width: 100%;
    padding: clamp(8px, 2vw, 12px);
}

.search-results-title {
    padding: clamp(8px, 2vw, 12px);
    font-size: clamp(13px, 3.5vw, 15px);
    color: #666;
    font-weight: 500;
    border-bottom: 1px solid #E5E5E5;
    margin-bottom: clamp(8px, 2vw, 12px);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2.5vw, 12px);
    padding: clamp(12px, 3vw, 16px);
    border-radius: clamp(6px, 1.5vw, 8px);
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: clamp(4px, 1vw, 6px);
}

.search-result-item:hover {
    background-color: #F5F5F5;
}

.result-icon {
    font-size: clamp(18px, 5vw, 20px);
    flex-shrink: 0;
}

.result-text {
    flex: 1;
    font-size: clamp(15px, 4vw, 17px);
    color: #000;
    font-weight: 500;
}

.result-text mark {
    background-color: #FFF3CD;
    color: #FF5F57;
    padding: 0 2px;
    border-radius: 2px;
}

.result-province {
    font-size: clamp(12px, 3vw, 14px);
    color: #999;
    flex-shrink: 0;
}


@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}