/* ============================================================
   觅水狸 · 前台样式

   布局、栅格、按钮、表单、徽章、模态、响应式断点全部交给 Bootstrap 5，
   这里只放三样东西：
     1) 品牌色变量
     2) 对 Bootstrap 组件的品牌化覆盖（改的是 --bs-* 变量，不写 !important 硬覆盖）
     3) Bootstrap 里没有的组件：城市搜索弹层、招商占位卡、招商带、Toast

   Bootstrap 文件位置：public/vendor/bootstrap/（本地，不依赖外网 CDN）
   ============================================================ */

:root {
    --brand: #2C6E86;
    --brand-dark: #245B70;
    --brand-soft: #F0F6F7;
    --ink: #16232B;
    --ink-2: #4A5560;
    --ink-3: #7C8794;
    --line: #E4E9E7;
    /* 顶部导航实际高度，由 site.js 测量后写入，区导航靠它贴在 header 下面 */
    --header-h: 0px;
}

body {
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------
   1. Bootstrap 组件品牌化
   ------------------------------------------------------------ */
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand);
    --bs-btn-active-border-color: var(--brand);
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--brand);
}

.form-control:focus,
.form-select:focus {
    border-color: #9CC3CF;
    box-shadow: 0 0 0 .2rem rgba(44, 110, 134, .15);
}

.text-brand { color: var(--brand) !important; }

/* ------------------------------------------------------------
   2. 顶部（品牌 + 城市切换 + 入驻入口 + 热线；搜索单独一行）
   ------------------------------------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-name {
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
}

.brand-sub {
    font-size: 11.5px;
    color: var(--ink-3);
    line-height: 1.2;
}

.hotline {
    font-size: 13px;
    color: var(--ink-3);
    white-space: nowrap;
}

.hotline b {
    color: var(--brand);
    font-size: 14.5px;
}

/* ------------------------------------------------------------
   3. 城市选择弹层（Bootstrap 没有「可搜索 + 分组 + 内部滚动」的现成组件）
   ------------------------------------------------------------ */
.city-wrap { position: relative; }

.city-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #DEE3E0;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.city-btn:hover { border-color: #C6D6D2; }

.city-btn .city-ip {
    font-size: 11px;
    font-weight: 400;
    color: var(--ink-3);
}

.city-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 1055;
    width: 288px;
    max-width: calc(100vw - 24px);
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(22, 35, 43, .14);
    display: none;
}

.city-wrap.open .city-pop { display: block; }

.city-search { position: relative; margin-bottom: 8px; }

.city-search svg {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.city-search input {
    width: 100%;
    height: 36px;
    padding: 0 10px 0 30px;
    border: 1px solid #DEE3E0;
    border-radius: 8px;
    font-size: 13.5px;
    outline: none;
}

.city-search input:focus { border-color: #9CC3CF; }

.city-list {
    max-height: min(58vh, 360px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.city-group {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 4px 0 2px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #F6F8F7;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ink-3);
}

.city-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    font-size: 13.5px;
    color: var(--ink);
    text-align: left;
}

.city-opt:hover { background: var(--brand-soft); }

.city-opt .cname { flex: 1 1 auto; }

.city-opt .cprov {
    font-size: 11.5px;
    color: var(--ink-3);
    white-space: nowrap;
}

.city-opt .cdot {
    display: none;
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
}

.city-opt.on {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
}

.city-opt.on .cdot { display: block; }

.city-none {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-3);
}

.city-note {
    margin-top: 6px;
    padding: 8px 4px 2px;
    border-top: 1px solid #EEF2F1;
    font-size: 11.5px;
    color: var(--ink-3);
}

/* ------------------------------------------------------------
   4. 区导航（横向胶囊，移动端可横滑）
   ------------------------------------------------------------ */
.zone-nav {
    position: sticky;
    top: var(--header-h, 0px);
    z-index: 1020;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.zone-nav .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.zone-nav .nav::-webkit-scrollbar { display: none; }

.zone-nav .nav-link {
    padding: .35rem .9rem;
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.zone-nav .nav-link:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

.zone-nav .nav-link.active {
    background: var(--brand);
    color: #fff;
}

/* ------------------------------------------------------------
   5. 区与商家卡片
   ------------------------------------------------------------ */
.blk-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
}

.blk-title::before {
    content: "";
    width: 3px;
    height: 15px;
    border-radius: 2px;
    background: var(--brand);
}

.m-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .18s, transform .18s;
}

.m-card:hover {
    box-shadow: 0 10px 26px rgba(22, 35, 43, .12);
    transform: translateY(-2px);
}

/* 图区比例：移动端 16:9、桌面 2:1，与 <picture> 的 media 断点保持一致 */
.m-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #EEF2F1;
}

@media (min-width: 992px) {
    .m-card-media { aspect-ratio: 2 / 1; }
}

.m-card-media picture {
    display: block;
    width: 100%;
    height: 100%;
}

.m-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.m-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px 14px;
}

.m-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.m-card-title a {
    color: var(--ink);
    text-decoration: none;
}

.m-card:hover .m-card-title a { color: var(--brand); }

.m-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.m-tags .badge {
    border: 1px solid #DCE8EB;
    background: var(--brand-soft) !important;
    color: var(--brand) !important;
    font-weight: 500;
}

.m-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 4px;
}

.m-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--ink-3);
}

.m-rate {
    color: #E8A33D;
    font-weight: 700;
}

.m-rate i { font-style: normal; }

/* 招商占位卡 */
.card-invite {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    min-height: 176px;
    padding: 18px;
    border: 1.5px dashed #C6D6D2;
    border-radius: 12px;
    background: #FAFCFC;
    color: var(--ink-2);
    text-align: center;
    cursor: pointer;
}

.card-invite:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.card-invite .plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #DCE8EB;
    border-radius: 50%;
    background: #fff;
}

.card-invite b {
    font-size: 13.5px;
    color: var(--ink);
}

.card-invite span {
    font-size: 12px;
    line-height: 1.6;
    color: var(--ink-3);
}

/* ------------------------------------------------------------
   6. 空状态 / 招商带 / 页脚
   ------------------------------------------------------------ */
.empty-ic {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--brand-soft);
}

.empty-open { margin: 18px 0; }

.empty-open > span {
    display: block;
    margin-bottom: 8px;
    font-size: 12.5px;
    color: var(--ink-3);
}

.empty-open-list a {
    display: inline-block;
    margin: 0 6px 8px 0;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 13px;
    text-decoration: none;
}

.empty-open-list a:hover {
    background: var(--brand);
    color: #fff;
}

.band {
    margin-top: 30px;
    padding: 22px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand) 0%, #1F5468 100%);
    color: #fff;
}

.band h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
}

.band p {
    margin: 0;
    font-size: 13.5px;
    color: rgba(255, 255, 255, .82);
}

.band-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.band-stat {
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    text-align: center;
}

.band-stat b {
    display: block;
    font-size: 20px;
    font-weight: 700;
}

.band-stat span {
    font-size: 11.5px;
    color: rgba(255, 255, 255, .8);
}

.site-foot {
    padding: 22px 0 34px;
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--ink-3);
    text-align: center;
}

/* ------------------------------------------------------------
   7. Toast（Bootstrap 的 toast 需要自己管容器，这里用更轻的实现）
   ------------------------------------------------------------ */
.site-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 1085;
    max-width: calc(100vw - 32px);
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(22, 35, 43, .92);
    color: #fff;
    font-size: 13.5px;
    opacity: 0;
    transform: translate(-50%, 12px);
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}

.site-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ------------------------------------------------------------
   8. 商家详情页
   ------------------------------------------------------------ */
.d-head {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.d-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ink-2);
    font-size: 13.5px;
    text-decoration: none;
}

.d-back:hover { color: var(--brand); }

.d-head h1 {
    margin: 6px 0 2px;
    font-size: 18px;
    font-weight: 700;
}

.d-hint {
    font-size: 12.5px;
    color: var(--ink-3);
}

.pv-img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.d-cap {
    margin: 14px 0 0;
    font-size: 12.5px;
    line-height: 1.85;
    color: var(--ink-3);
}

.d-sib-hd {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.d-sib-hd h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.d-sib-hd span {
    font-size: 12.5px;
    color: var(--ink-3);
}
