/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    padding-bottom: 80px;
    transition: background var(--transition), color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   顶部栏（主页专用）
   ============================================================ */
.top-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background var(--transition);
}

.city-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text);
    font-size: 16px;
    font-weight: 600;
    padding: 6px 8px 6px 4px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
}
.city-selector:active {
    opacity: 0.7;
}
.city-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.arrow {
    font-size: 10px;
    color: var(--color-primary);
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1.5px solid var(--color-primary);
    border-radius: 20px;
    padding: 8px 14px;
    cursor: pointer;
    min-height: 36px;
    transition: background 0.2s, border-color 0.2s;
    flex: 1 1 0%;
    min-width: 0;
}
.search-box:active {
    background: var(--color-primary-light);
}
.search-placeholder {
    color: var(--color-text-light);
    font-size: 14px;
    flex: 1 1 0%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 客服按钮 */
.top-bar-service {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.service-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF9A44 0%, #FF6B35 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255,107,53,0.3);
    transition: transform 0.15s;
}
.top-bar-service:active .service-icon {
    transform: scale(0.92);
}
.top-bar-service span {
    font-size: 10px;
    color: #FF6B35;
    font-weight: 600;
    margin-top: 2px;
}
/* ============================================================
   分类网格（浅底 + 线条 SVG）
   ============================================================ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 12px 8px;
    background: transparent;
    margin: 8px 12px;
    border: none;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.category-item:active {
    transform: scale(0.92);
}

/* ✅ 改成方形 + 圆角 */
.category-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px; /* 原来是 50% */
    background: #FFF4ED; /* 浅橙色底 */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, background 0.2s;
}

[data-theme="dark"] .category-icon-wrap {
    background: rgba(255, 107, 53, 0.15);
}

.category-item:active .category-icon-wrap {
    background: #FFE0D0;
}

/* SVG 图标保持居中 */
.category-icon-wrap svg {
    width: 24px;
    height: 24px;
    stroke: var(--color-primary);
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 兼容彩色图片 */
.category-icon-wrap img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: none;
}

.category-emoji {
    font-size: 24px;
    line-height: 1;
}

.category-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
    text-align: center;
    line-height: 1.2;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-grid .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: var(--color-text-light);
    font-size: 14px;
}
/* ============================================================
   免费玩长条横幅
   ============================================================ */
.feature-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 12px 12px;
    padding: 10px 16px;
    background: linear-gradient(90deg, #FFB347 0%, #FF6B35 100%);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255,107,53,0.2);
    transition: transform 0.2s;
}
.feature-banner:active {
    transform: scale(0.98);
}
.feature-banner-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.feature-banner-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.feature-banner-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.9);
}
.feature-banner-right {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

/* 隐藏旧的联系客服占位 */
.feature-entries {
    display: none;
}

/* ============================================================
   双瀑布流
   ============================================================ */
.waterfall-container {
    padding: 0 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 16px 0 12px;
    padding-left: 4px;
    color: var(--color-text);
    transition: color var(--transition);
}

.waterfall {
    display: flex;
    gap: 12px;
}

.waterfall-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background var(--transition);
}
.review-card:active {
    transform: scale(0.98);
}

.review-image {
    width: 100%;
    aspect-ratio: 182 / 242;
    object-fit: cover;
    background: var(--color-bg);
}

.review-content {
    padding: 10px 12px 12px;
}

.review-rating {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-secondary);
    margin-bottom: 4px;
    transition: color var(--transition);
}

.review-text {
    font-size: 13px;
    color: var(--color-text);
    margin: 4px 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    transition: color var(--transition);
}

.review-user {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-text-light);
}

.loading-more,
.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--color-text-light);
}

/* ============================================================
   城市选择器弹窗
   ============================================================ */
.city-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-bg);
    border-radius: 20px;
    padding: 8px 14px;
    margin: 12px 0 16px;
    border: 1px solid var(--color-border);
    transition: border-color 0.2s, background var(--transition);
}
.city-search-box:focus-within {
    border-color: var(--color-primary);
}
.city-search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--color-text);
}
.city-search-box input::placeholder {
    color: var(--color-text-light);
}
.city-search-clear {
    cursor: pointer;
    color: var(--color-text-light);
    font-size: 12px;
    padding: 0 4px;
}

.city-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin: 16px 0 10px;
}
.hot-city-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.hot-city-item {
    padding: 6px 16px;
    background: var(--color-primary-light);
    border-radius: 20px;
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
    border: 1px solid var(--color-primary);
    transition: background 0.2s;
}
.hot-city-item:active {
    background: var(--color-primary);
    color: #fff;
}

.province-group {
    margin-top: 12px;
}
.province-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    padding: 4px 0;
    cursor: pointer;
    user-select: none;
}
.province-count {
    font-size: 11px;
    font-weight: 400;
    color: var(--color-text-light);
}
.province-arrow {
    font-size: 10px;
    margin-left: auto;
    color: var(--color-text-light);
    transition: transform 0.2s;
}

.city-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0 4px 0;
}
.city-grid .city-item {
    padding: 6px 14px;
    background: var(--color-bg);
    border-radius: 16px;
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
    border: 1px solid var(--color-border);
    transition: background 0.2s, color var(--transition), border-color var(--transition);
}
.city-grid .city-item:active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.no-result {
    text-align: center;
    padding: 30px;
    color: var(--color-text-light);
    font-size: 14px;
}

.city-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.city-picker {
    width: 100%;
    max-height: 70vh;
    background: var(--color-bg-card, #FFFFFF);
    border-radius: 16px 16px 0 0;
    padding: 16px 20px 30px;
    overflow-y: auto;
    transition: background 0.3s;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   加载相关 & 骨架屏
   ============================================================ */
.shimmer {
    background: linear-gradient(90deg, var(--color-bg) 25%, var(--color-border) 50%, var(--color-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.load-more-trigger {
    text-align: center;
    padding: 20px 0 30px;
    color: var(--color-text-light);
    font-size: 14px;
}

.load-more-loading {
    display: inline-block;
    animation: pulse 1.2s ease-in-out infinite;
}

.load-more-end {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 0 30px;
}

.load-more-line {
    flex: 1;
    max-width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-border), transparent);
}

.load-more-end .load-more-text {
    color: var(--color-text-light);
    font-size: 13px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* ============================================================
   底部 Tab Bar & 地图凸起按钮
   ============================================================ */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--color-bg-card);
    border-top: 1px solid var(--color-border);
    padding: 6px 0 8px;
    height: 50px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.3s, border-color 0.3s;
    box-sizing: border-box;
}

.tab-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s, transform 0.15s;
    color: var(--color-text-light);
}

.tab-item .tab-label {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
}

.tab-item.active {
    color: var(--color-primary-dark);
}

.tab-item.active .tab-label {
    font-weight: 700;
}

.tab-item:active {
    opacity: 0.6;
    transform: scale(0.96);
}

.tab-item-map {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-bubble {
    position: absolute;
    width: 84px;
    height: 38px;
    border-radius: 19px;
    bottom: calc(50% - 19px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark, #E55A2B) 100%);
    border: none;
    box-shadow: 0 0 0 4px var(--color-bg-card), 0 4px 16px rgba(255, 107, 53, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.3s ease;
    box-sizing: border-box;
    z-index: 2;
}

.map-bubble-text {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.5px;
}

.tab-item-map:active .map-bubble {
    transform: translateX(-50%) scale(0.92);
    box-shadow: 0 0 0 4px var(--color-bg-card), 0 2px 8px rgba(255, 107, 53, 0.5);
}

.tab-item-map.active .map-bubble {
    background: linear-gradient(135deg, var(--color-secondary, #FFA94D) 0%, var(--color-primary, #FF6B35) 100%);
    box-shadow: 0 0 0 4px var(--color-bg-card), 0 4px 20px rgba(255, 169, 77, 0.6);
}

[data-theme="dark"] .map-bubble {
    box-shadow: 0 0 0 4px var(--color-bg-card), 0 4px 16px rgba(255, 107, 53, 0.5);
}

[data-theme="dark"] .tab-item-map.active .map-bubble {
    box-shadow: 0 0 0 4px var(--color-bg-card), 0 4px 20px rgba(255, 169, 77, 0.7);
}

/* ============================================================
   个人中心页面
   ============================================================ */
.profile-page {
    padding: 20px 16px 80px;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0 20px;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    transition: background 0.3s;
}

.profile-avatar {
    font-size: 64px;
    margin-bottom: 12px;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: background 0.3s;
}

.profile-menu-item {
    padding: 14px 16px;
    font-size: 15px;
    color: var(--color-text);
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s;
}
.profile-menu-item:last-child {
    border-bottom: none;
}
.profile-menu-item:active {
    background: var(--color-bg);
}

.profile-footer {
    text-align: center;
    padding: 20px 0;
}

/* ============================================================
   杂项与隐藏
   ============================================================ */
[data-theme="dark"] .hot-city-item {
    background: #3D3D3D;
    border-color: #555;
}
[data-theme="dark"] .city-grid .city-item {
    background: #3D3D3D;
    border-color: #555;
}
[data-theme="dark"] .city-search-box {
    background: #3D3D3D;
    border-color: #555;
}

.leaflet-control-attribution {
    display: none !important;
}
.leaflet-control-container .leaflet-bottom {
    display: none !important;
}

/* ============================================================
   动画集合（合并去重）
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes emptyPulse {
    0%, 100% { transform: scale(1); opacity: 0.15; }
    50% { transform: scale(1.15); opacity: 0.25; }
}

/* ============================================================
   小屏适配
   ============================================================ */
@media (max-width: 360px) {
    .map-bubble {
        width: 76px;
        height: 34px;
        bottom: calc(50% - 17px);
        border-radius: 17px;
    }
    .map-bubble-text {
        font-size: 14px;
    }
    .category-grid {
        gap: 6px;
        padding: 10px 4px;
    }
    .category-icon-wrap {
        width: 44px;
        height: 44px;
    }
    .category-icon-wrap svg {
        width: 22px;
        height: 22px;
    }
    .category-name {
        font-size: 11px;
        max-width: 56px;
    }
}