/* ==========================================================================
   手机版（屏幕窄于 768px 时加载，见 base.html）。同一网址、同一份内容，只换排版：
   - 头部 52px：标志 + 城市 + 灰色圆角搜索框；电脑版的导航菜单收起，改用底部 4 个入口
   - 卡片两列，横排标签可左右滑；能点的地方不小于 40px 高
   - 底部导航、购买栏避开 iPhone 底部横条（safe-area）
   ========================================================================== */

html { -webkit-text-size-adjust: 100%; }
body { font-size: 14px; padding-bottom: calc(56px + env(safe-area-inset-bottom)); overflow-x: hidden; }
.wrap { padding: 0 12px; }
.main { padding-top: 8px; }
img { max-width: 100%; }

/* ---- 顶部栏：只保留切换城市的面板（入口在头部城市按钮） ---- */
.topbar { height: 0; border: 0; overflow: visible; }
.topbar .wrap { height: 0; }
.topbar-right, .city-switch > svg, .city-switch > b, .city-switch-btn { display: none; }
.city-switch:hover .city-picker, .city-switch:focus-within .city-picker { display: none; }
html.cp-open, html.cp-open body { overflow: hidden; }
html.cp-open .city-picker { display: block !important; position: fixed; z-index: 1000; inset: 0; width: auto; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: #fff; box-shadow: none; overflow: hidden; }
.city-picker .cp-head { position: sticky; top: 0; align-items: center; height: 52px; margin: 0; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); }
.city-picker .cp-head b { font-size: 16px; margin-right: auto; }
.city-picker .cp-head a { margin-right: 16px; font-size: 13px; }
.cp-close { display: inline-block; border: 0; background: none; font-size: 15px; color: var(--text-2); padding: 8px 0 8px 8px; }
.city-picker .cp-body { max-height: calc(100vh - 52px); padding: 4px 16px 24px; -webkit-overflow-scrolling: touch; }
.city-picker .cp-row { flex-direction: column; gap: 6px; padding: 8px 0; }
.city-picker .cp-row dt { width: auto; }
.city-picker .cp-row dd { gap: 8px; }
.city-picker .cp-row dd a, .city-picker .cp-row dd span { padding: 6px 12px; border-radius: 16px; background: #f5f5f5; font-size: 13px; }
.city-picker .cp-city.on { background: var(--primary-soft); }

/* ---- 头部：标志 + 城市 + 搜索框，一行 52px，滚动时贴在顶部 ---- */
.header { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid #f0f0f0; }
.header-inner { flex-direction: row !important; align-items: center !important; gap: 8px !important; height: 52px; padding-top: 0; padding-bottom: 0; }
.logo-h1 { display: flex; }
.logo { gap: 0; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; }
.logo-text { display: none; }
.logo-img { height: 28px; width: auto; }
.m-city { display: block; flex: none; max-width: 5.5em; border: 0; background: none; padding: 0 12px 0 2px; position: relative;
  font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-city::after { content: ""; position: absolute; right: 2px; top: 50%; margin-top: -4px; width: 5px; height: 5px;
  border-right: 1.5px solid #999; border-bottom: 1.5px solid #999; transform: rotate(45deg); }
.search-box { flex: 1; min-width: 0; max-width: none; }
.search-box form { border: 0; border-radius: 18px; background: #f2f2f2; height: 36px; }
.search-box input { height: 36px; background: transparent; padding: 0 4px 0 14px; font-size: 14px; }
.search-box button { background: none; color: var(--primary); padding: 0 14px; font-size: 14px; }
.search-box button:hover { background: none; }
.hot-keys, .header-hol { display: none; }
.header > .nav { display: none; }

/* ---- 底部导航：4 个入口，细线条图标 ---- */
.tabbar { display: flex; position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid #ececec; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: #888; }
.tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--primary); }
.to-top:not([hidden]) { display: grid; place-items: center; position: fixed; z-index: 80; right: 14px; bottom: calc(72px + env(safe-area-inset-bottom));
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid #ececec; background: rgba(255,255,255,.95); color: #666; }
.to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- 通用区块 ---- */
.block { padding: 14px 12px; margin-bottom: 10px; border-radius: 10px; }
.block-head { flex-wrap: wrap; align-items: center; margin-bottom: 10px; border-left: 0; padding-left: 0; gap: 4px 8px; }
.block-head h2 { font-size: 16px; }
.block-head > span { display: none; }
.block-head > a { margin-left: auto; font-size: 13px; }
h1 { font-size: 20px; }

/* 横排标签：一行放不下就左右滑，不换成好几行 */
.who-tab-bar, .chip-links { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-left: -12px; margin-right: -12px; padding: 0 12px; }
.who-tab-bar::-webkit-scrollbar, .chip-links::-webkit-scrollbar { display: none; }
.who-tab-bar > span { display: none; }
.who-tab-bar button, .chip-links a { flex: none; height: 32px; padding: 0 14px; font-size: 13px; }
.who-tab-bar button { border-color: transparent; background: #f5f5f5; }
.who-tab-bar button.on { background: var(--primary-soft); border-color: transparent; color: var(--primary); }

/* ---- 商品卡片：两列，正方形图，标题两行，价格加大 ---- */
.products, .products.compact, .products.mini { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
.product { border: 0; border-radius: 8px; }
.product:hover { box-shadow: none; transform: none; }
.product-img, .products.mini .product-img { aspect-ratio: 1 / 1; }
.product-img img { padding: 8px; }
.product-title, .products.mini .product-title { height: 40px; line-height: 20px; padding: 8px 8px 0; font-size: 13px; }
.product-reason { display: none; }
.product-foot, .products.mini .product-foot { padding: 4px 8px 10px; }
.product-price b { font-size: 16px; }
.product-buy { font-size: 11px; }
.price-note { font-size: 11px; }

/* ---- 页脚：只留简介和备案 ---- */
.footer { padding: 18px 0 12px; }
.f-main { display: block; }
.f-col { display: none; }
.f-brand p { font-size: 12px; }
.f-bottom { flex-direction: column; align-items: flex-start; gap: 8px; font-size: 12px; }
.f-bottom nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.f-bottom nav a { margin: 0; }

/* 电脑版首页不再做窄屏排版：手机一律去 m 站首页（见 web/device.py、base.html 里的窄屏跳转） */

/* 攻略列表：一栏（攻略详情页“相关攻略”用） */
.home-alist { grid-template-columns: minmax(0, 1fr) !important; }
.ha-row { gap: 10px; padding: 11px 0; }
.ha-row:nth-last-child(2) { border-bottom: 1px dashed var(--line); }
.ha-row b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.5; }
.ha-row small, .ha-row em { display: none; }

/* ==========================================================================
   内页（手机）：一个页面只突出一件事——主内容一栏，侧栏收起；图片控制大小，不占满屏
   ========================================================================== */
.crumbs { margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail, .two-col, .hero, .guide-wrap { display: block; }
.detail-main, .detail-side { min-width: 0; }
.detail-side { display: none; }                       /* 侧栏（其他特产、热门排行……）手机上不放，页面只讲当前内容 */
.detail-main > .block { margin-top: 10px; }

/* 页头横幅：矮一点，配图缩成右上角小图 */
.page-hero { padding: 16px; margin-bottom: 10px; border-radius: 10px; }
.page-hero::after { display: none; }
.page-hero h1 { font-size: 20px; margin-bottom: 4px; }
.page-hero p { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.page-hero .ph-stats { gap: 16px; margin-top: 10px; font-size: 12px; }
.ph-scenic.has-img, .ph-region.has-img { display: block; }
.ph-scenic-img, .ph-region-img { float: right; width: 96px; aspect-ratio: 1; margin: 0 0 6px 12px; border-width: 2px; }

/* 图片统一控制：卡片里的图不超过 4:3，正文图不超过 220px 高 */
.product-img, .products.mini .product-img { aspect-ratio: 4 / 3; }
.pc-spec-img, .season-specs .pc-spec-img { aspect-ratio: 4 / 3 !important; }
.article-body img, .prose img { max-height: 220px; width: auto; margin: 8px auto; display: block; border-radius: 8px; }
.gf-scenics img { display: none; }

/* 卡片网格：特产 / 景点 / 礼品分类一栏列表，节日两列 */
.sp-grid, .sp-grid.three, .detail .sp-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 8px; }
.sp-card { padding: 10px 12px; }
.sp-card p, .sp-card .sp-sum { height: auto; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; margin: 4px 0 0; }
.sp-thumb, .sp-grid:not(.three) .sp-thumb { width: 64px !important; height: 64px !important; }
.sp-card .badge { flex: none; }
.sp-head { min-width: 0; flex-wrap: wrap; }
.sc-grid, .two-col .sc-grid, .trip-grid, .trip-grid.four { grid-template-columns: minmax(0, 1fr) !important; gap: 8px; }
.trip-card, .sc-card { padding: 12px; }
.trip-card p, .sc-card p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
.cat-grid.big { grid-template-columns: minmax(0, 1fr) !important; }
.cat-grid.big .cat-card { padding: 14px; }
.cat-card { min-width: 0; }
.cat-rows dd { min-width: 0; }
.holiday-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
.holiday-card { padding: 10px 12px; }
.calendar { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px; }
.article-cards, .acards { grid-template-columns: minmax(0, 1fr) !important; }
.article-card { padding: 14px; }
.rest-links { font-size: 13px; }
.rest-links a { margin-right: 10px; }

/* 全国特产页已有手机版（m 站），这里不再做窄屏排版 */

/* 省 / 市页：送给谁一栏 */
.pc-who { grid-template-columns: minmax(0, 1fr); }
.pc-who-row b { width: 72px; }
.pc-scenics { grid-template-columns: minmax(0, 1fr) !important; }

/* 特产页已有手机版（m 站），这里不再做窄屏排版 */
.gift-story, .detail-main .gift-story { grid-template-columns: minmax(0, 1fr) !important; }

/* 送礼指南已有手机版（m 站），这里不再做窄屏排版 */
.chip-btn { flex: none; padding: 5px 14px; font-size: 13px; }
.guide-row b { width: 52px; }

/* 攻略已有手机版（m 站），这里不再做窄屏排版 */
.tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

/* 伴手礼已有手机版（m 站），这里不再做窄屏排版 */

/* 搜索已有手机版（m 站），这里不再做窄屏排版 */
/* 商品标题固定两行，不压到价格 */
.product-title, .products.mini .product-title { height: auto; min-height: 48px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
