/* ==========================================================================
   城市总览页 v2：地图压缩 + 目录分页
   ========================================================================== */

/* ---------- 地图区：桌面 55 / 45，高度 400px ---------- */
@media (min-width: 980px) {
    .silk__stage {
        grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
        height: 400px;
        align-items: stretch;
    }
    .silk__mapwrap { height: 100%; min-height: 0; }
    .silk__panel { height: 100%; overflow: auto; }
    .silk__photo { height: 132px; }
    .silk__body { padding: .8rem 1rem 1rem; }
    .silk__intro { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .silk__spots { display: none; }
}
@media (min-width: 980px) and (max-height: 800px) {
    .silk__stage { height: 372px; }
}

/* ---------- 工具条 ---------- */
.city-toolbar {
    display: flex;
    align-items: center;
    gap: .9rem;
    flex-wrap: wrap;
    margin: 1.2rem 0 1.3rem;
}
.city-search {
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: 340px;
    padding: .5rem .95rem;
    border-radius: 9999px;
    background: #FFFDF8;
    border: 1px solid rgba(38, 61, 56, .16);
}
.city-search svg { width: 15px; height: 15px; color: #8a9a90; flex: none; }
.city-search input {
    flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: none;
    font-size: .86rem; color: var(--dark);
}
.city-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.city-chip {
    border: 1px solid rgba(38, 61, 56, .16);
    background: #FFFDF8;
    color: #4b5b53;
    font-size: .8rem;
    padding: .4rem .9rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.city-chip:hover { border-color: rgba(216, 180, 116, .8); color: #a95f45; }
.city-chip.is-on { background: #1f3d36; border-color: #1f3d36; color: #f3e6c8; }
.city-count { flex: 1 1 100%; margin: 0; font-size: .76rem; color: #8a9a90; }

/* ---------- 城市卡：3 列、图片 140px ---------- */
.city-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1.1rem !important;
}
/* 固定两行高度，翻到最后一页（卡片变少）时页面不会向上跳 */
@media (min-width: 980px) { .city-grid { min-height: 566px; align-content: start; } }
.city-card { display: flex; flex-direction: column; }
.city-card__media, .city-card__media.has-photo { height: 140px !important; }
.city-card__body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.city-card__desc {
    font-size: .8rem; line-height: 1.7; color: #55645c;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.city-card__spots { font-size: .74rem; color: #8a7659; }
.city-card__link { margin-top: .35rem; font-size: .78rem; }
.city-card:hover { transform: translateY(-3px); }

/* ---------- 分页 ---------- */
.city-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin: 1.6rem 0 .4rem;
    flex-wrap: wrap;
}
.city-pager button {
    min-width: 36px;
    height: 36px;
    padding: 0 .7rem;
    border-radius: 9999px;
    border: 1px solid rgba(38, 61, 56, .16);
    background: #FFFDF8;
    color: #40534b;
    font-size: .82rem;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.city-pager button:hover:not(:disabled) { border-color: rgba(216, 180, 116, .85); color: #a95f45; }
.city-pager button[aria-current="page"] {
    background: #1f3d36; border-color: #1f3d36; color: #f3e6c8;
}
.city-pager button:disabled { opacity: .4; cursor: not-allowed; }
.city-pager .city-pager__dots { color: #9aa8a0; padding: 0 .2rem; }

.city-empty { text-align: center; padding: 2.4rem 1rem; color: #6c7b72; }
.city-empty b { display: block; font-size: 1rem; color: #2c3a34; margin-bottom: .3rem; }
.city-empty p { margin: 0; font-size: .84rem; }

@media (max-width: 980px) {
    .silk__stage { grid-template-columns: 1fr; height: auto; }
    .silk__panel { height: auto; }
    .silk__spots { display: block; }
    .city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 600px) {
    .city-grid { grid-template-columns: 1fr !important; }
    .city-search { max-width: none; }
}

/* ---------- 地图区收紧约 1/5：外框与地图画布始终同高 ---------- */
@media (min-width: 980px) {
    #cities #silkroad {
        --silk-stage-height: clamp(416px, 36.8vw, 528px);
        padding-bottom: 8px;
    }
    #cities #silkroad .silk__stage {
        grid-template-columns: minmax(0, 53fr) minmax(0, 47fr) !important;
        height: auto !important;
        align-items: stretch;
        margin-top: 12px;
    }
    #cities #silkroad .silk__mapwrap {
        height: var(--silk-stage-height) !important;
        min-height: 0;
    }
    #cities #silkroad .silk__map { height: 100% !important; }
    #cities #silkroad .silk__panel {
        height: var(--silk-stage-height) !important;
        overflow: hidden !important;
        display: flex;
        flex-direction: column;
    }
    #cities #silkroad .silk__photo { height: 44% !important; aspect-ratio: auto !important; flex: none; }
    #cities #silkroad .silk__body { min-height: 0; padding: .8rem 1rem; overflow-y: auto; }
    #cities #silkroad .silk__intro { -webkit-line-clamp: 4; }
    #cities #silkroad .silk__spots { display: flex; }
    #cities #silkroad .silk__list { margin-top: 8px; }
}
@media (min-width: 980px) and (max-height: 820px) {
    #cities #silkroad { --silk-stage-height: 400px; }
}
