/* ==========================================================================
   响应式样式（移动端按 yanglao.com 移动端模式重构）
   断点：1024 平板 / 768 手机（核心）/ 480 小手机 / 360 极小屏
   ========================================================================== */

/* 移动端底部 TabBar 桌面隐藏 */
.mobile-tabbar { display: none; }

/* ============================================================
   大平板 (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
	:root { --yly-max-width: 100%; }

	/* 头部：热线隐藏，给搜索让位 */
	.header-hotline { display: none; }
	.site-header__inner { gap: 14px; padding: 12px 14px; }

	/* 首页两栏 → 单栏 */
	.home-grid { grid-template-columns: 1fr; }
	.home-aside { margin-top: 10px; }

	/* 文章/机构详情两栏 → 单栏 */
	.grid-2 { grid-template-columns: 1fr !important; }
	.site-sidebar { margin-top: 20px; }

	/* 机构meta列表两列 → 单列 */
	.institution-meta-list { grid-template-columns: 1fr; }
}

/* ============================================================
   手机 (≤ 768px) —— 移动端核心适配（仿 yanglao 移动端）
   ============================================================ */
@media (max-width: 768px) {
	html { font-size: 15px; }
	body { padding-bottom: 56px; background: #F3F3F3; } /* kangyang51 底色 + TabBar 让位 */
	.container { padding: 0 12px; }
	.site-content { padding: 0 0 24px; }

	/* ---------- 顶部条：移动端整体隐藏（信息在 header 行内） ---------- */
	.topbar { display: none; }

	/* ---------- 头部：主题色通栏（logo+城市+搜索一体，仿 kangyang51）---------- */
	.site-header { background: var(--ky-primary, #42B712); position: relative; }
	.site-header__inner { flex-wrap: nowrap; gap: 6px; padding: 8px 10px; align-items: center; }
	.site-branding { flex: 0 0 auto; margin-right: 0; }
	.site-logo-text { gap: 0; }
	.site-logo-text__name { font-size: 15px !important; color: #fff !important; white-space: nowrap; font-weight: 700; }
	.site-logo-text__icon { display: none; }
	.site-description { display: none; }
	/* 城市选择器：半透明白底胶囊，与 header 有区分 */
	.topbar__city { flex-shrink: 0; }
	.topbar__city-btn { background: rgba(255,255,255,0.2) !important; color: #fff !important; border: none; padding: 4px 8px !important; font-size: 12px; white-space: nowrap; border-radius: 14px; }
	.topbar__city-btn svg { color: #fff; width: 12px; height: 12px; }
	.topbar__city-arrow { color: rgba(255,255,255,0.8); font-size: 8px; }
	.topbar__city-panel { position: fixed; left: 10px; right: 10px; top: 48px; width: auto; max-width: none; }
	/* 搜索胶囊：白色圆角整体，按钮是胶囊内的绿色小圆块 */
	.site-search { display: flex !important; flex: 1 1 auto; min-width: 0; order: 3; }
	.search-form { flex-wrap: nowrap; height: 34px; border-radius: 17px; background: #fff; border: none; overflow: hidden; padding: 0 3px 0 0; max-width: 100%; width: 100%; align-items: center; }
	.search-form__type { display: none; }
	.search-form__input { flex: 1; min-width: 0; border: none; padding: 0 6px 0 14px; font-size: 16px; border-radius: 0; background: transparent; -webkit-appearance: none; }
	.search-form__input::placeholder { color: #999; font-size: 14px; }
	.search-form__btn { flex: 0 0 36px; width: 36px; height: 28px; border-radius: 14px; padding: 0; margin: 0; background: var(--ky-primary, #42B712); color: #fff; border: none; display: flex; align-items: center; justify-content: center; font-size: 0; flex-shrink: 0; }
	.search-form__btn i, .search-form__btn svg { font-size: 16px; width: 16px; height: 16px; color: #fff; }
	/* 汉堡菜单（移动端隐藏，导航靠底部 TabBar） */
	.mobile-menu-btn { display: none; }
	/* 移动端独立搜索条隐藏（搜索已融入 header） */
	.mobile-searchbar { display: none; }

	/* ---------- 主导航：仅汉堡展开时显示（桌面已隐藏） ---------- */
	.main-nav { position: absolute; top: 100%; left: 0; right: 0; z-index: 200; }
	.main-nav[hidden] { display: none; }
	.main-nav .container { padding: 0; }
	.main-nav__list { flex-direction: column; max-height: 70vh; overflow-y: auto; background: #fff; }
	.main-nav__list > li { width: 100%; }
	.main-nav__list > li > a { padding: 14px 18px; border-bottom: 1px solid var(--yly-border); font-size: 15px; }
	.main-nav__list > li > a:hover, .main-nav__list > li.current-menu-item > a { background: var(--yly-bg-alt); color: var(--yly-primary); }
	.main-nav__list .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: var(--yly-bg-alt); min-width: 0; border: none; }
	.main-nav__list .sub-menu a { color: var(--yly-text); border-bottom: 1px solid var(--yly-border); padding: 10px 32px; font-size: 13px; }

	/* ---------- 面包屑 ---------- */
	.yly-breadcrumb { font-size: 12px; padding: 8px 0; }

	/* ---------- 通用 section ---------- */
	.section { margin-bottom: 18px; }
	.section__head { margin-bottom: 10px; padding-bottom: 8px; }
	.section__title { font-size: 16px; }
	.section__title::before { height: 16px; }
	.section__more { font-size: 12px; }

	/* ---------- 首页 Banner（移动端，玻璃拟态） ---------- */
	/* ---------- 首页 Banner（移动端）---------- */
	.home-banner { aspect-ratio: 16/9; min-height: 160px; max-height: 240px; margin-bottom: 10px; border-radius: 0; position: relative; overflow: hidden; width: 100%; max-width: 100%; }
	.home-banner__slide { position: relative !important; width: 100% !important; display: none; }
	.home-banner__slide.active { display: block; }
	.home-banner__slide a { display: block; }
	.home-banner__slide img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; display: block; }
	.home-banner__dots { bottom: 8px; gap: 5px; }
	.home-banner__dot { width: 6px; height: 6px; }
	.home-banner__dot.active { width: 16px; }

	/* ---------- 首页快捷入口：金刚区（圆形图标，仿 kangyang51）---------- */
	.home-entry { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 10px; background: #fff; padding: 14px 4px; border-radius: 0; }
	.home-entry__item { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 7px; padding: 0; border-radius: 0; min-width: 0; box-shadow: none; border: none; background: transparent; overflow: visible; }
	.home-entry__item::before { display: none; }
	.home-entry__item:hover { transform: none; box-shadow: none; }
	.home-entry__icon { width: 48px !important; height: 48px !important; border-radius: 50% !important; box-shadow: none !important; }
	.home-entry__icon::after { display: none; }
	.home-entry__icon .yly-ico { font-size: 24px !important; }
	.home-entry__text { display: flex; flex-direction: column; gap: 0; width: 100%; align-items: center; }
	.home-entry__text strong { font-size: 12px; color: #333; font-weight: 400; white-space: nowrap; line-height: 1.2; }
	.home-entry__text span { display: none; }

	/* ---------- 机构卡片：左图右文白底列表（仿 kangyang51）---------- */
	.inst-grid { grid-template-columns: 1fr; gap: 0; background: #fff; }
	.inst-card { display: flex; flex-direction: row; align-items: flex-start; border-radius: 0; overflow: visible; border-bottom: 1px solid #f3f3f3; padding: 12px; box-shadow: none; }
	.inst-card:hover { transform: none; box-shadow: none; }
	.inst-card__thumb { flex: 0 0 90px !important; width: 90px !important; height: 68px !important; aspect-ratio: auto !important; border-radius: 4px; overflow: hidden; }
	.inst-card__thumb img { height: 68px !important; min-height: 68px !important; object-fit: cover; }
	.inst-card__nature { font-size: 10px; padding: 1px 6px; }
	.inst-card__body { flex: 1; padding: 0 0 0 10px; gap: 3px; min-width: 0; }
	.inst-card__title { font-size: 15px; line-height: 1.35; margin-bottom: 2px; font-weight: 400; }
	.inst-card__title a { color: #323232; }
	.inst-card__type { font-size: 11px; color: #999; }
	.inst-card__foot { padding-top: 4px; border-top: none; }
	.inst-card__price { font-size: 14px; color: #ff672d; font-weight: 700; }
	.inst-card__loc { font-size: 11px; color: #999; }
	/* standard 卡片：横向美观图（110×82）+ 图文垂直居中，协调不竖高 */
	.inst-card--standard { align-items: center; }
	.inst-card--standard .inst-card__thumb { flex: 0 0 110px !important; width: 110px !important; height: 82px !important; align-self: center; border-radius: 6px; }
	.inst-card--standard .inst-card__thumb img { height: 82px !important; min-height: 0 !important; }
	.inst-card--standard .inst-card__body { gap: 4px; }
	.inst-card--standard .inst-card__title { font-size: 15px; }
	.inst-card--standard .inst-card__addr-line { font-size: 12px; }
	.inst-card--standard .inst-card__foot { padding-top: 2px; }

	/* ---------- 文章列表卡片 ---------- */
	.post-item { flex-direction: row; gap: 10px; padding: 12px; }
	.post-item__thumb { flex: 0 0 40%; width: auto; aspect-ratio: 4/3; }
	.post-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
	.post-item__title { font-size: 14px; }
	.post-item__excerpt { font-size: 12px; -webkit-line-clamp: 2; }
	.post-item-simple { padding: 11px 0; }
	.post-item-simple__title { font-size: 14px; }

	/* ---------- Tab：横向滚动 ---------- */
	.tabs__nav { gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: none; }
	.tabs__nav::-webkit-scrollbar { display: none; }
	.tabs__tab { padding: 8px 14px; font-size: 13px; white-space: nowrap; }

	/* ---------- 单文章页 ---------- */
	.article-detail { padding: 16px 14px; border-radius: 10px; }
	.article-detail__title { font-size: 18px; line-height: 1.45; }
	.article-detail__meta { gap: 10px; font-size: 12px; padding: 10px 0; margin-bottom: 16px; flex-wrap: wrap; }
	.article-detail__content { font-size: 15px; line-height: 1.85; }
	.article-detail__content h2 { font-size: 17px; padding-left: 10px; }
	.article-detail__content h3 { font-size: 15px; }
	.article-detail__content img { margin: 1em 0; }

	/* ---------- 机构详情页 ---------- */
	.institution-detail__main-img { aspect-ratio: 16/9; }
	.institution-detail__thumb { flex: 0 0 70px; height: 52px; }
	.institution-info-card { padding: 14px; border-radius: 10px; }
	.institution-info-card h1 { font-size: 18px; line-height: 1.4; }
	.institution-info-card__tags { gap: 6px; }
	.institution-tag { font-size: 12px; padding: 2px 9px; }
	.institution-meta-list li { font-size: 13px; padding: 7px 0; gap: 4px; flex-wrap: wrap; }
	.institution-meta-list li strong { flex: 0 0 72px; font-size: 12px; }
	.institution-desc { margin-top: 12px; padding-top: 12px; }
	.institution-desc h3 { font-size: 15px; }
	.institution-map { height: 200px; }

	/* ---------- 留言表单 / 评论区 ---------- */
	.message-form { padding: 14px; }
	.comments-area { padding: 14px; }
	.yly-comment-item { gap: 8px; padding: 12px 0; }
	.comment-avatar img, .yly-comment-item .avatar { width: 34px !important; height: 34px !important; }
	.children { padding-left: 22px; }

	/* ---------- 机构列表筛选：折叠（点"筛选"展开） ---------- */
	.yly-filter-form { padding: 12px; }
	.yly-filter-form__row { gap: 8px; }
	.yly-filter-form .form-select, .yly-filter-form .form-input { flex: 1 1 calc(50% - 8px); min-width: 0; width: 100%; font-size: 13px; }
	.yly-filter-form input[name="s"] { flex: 1 1 auto; min-width: 0; }
	.yly-filter-toggle { display: inline-flex; flex: 0 0 auto; }
	.yly-filter-form__rows { display: none; }
	.yly-filter-form.open .yly-filter-form__rows { display: block; }
	.yly-filter-form__rows .yly-filter-form__row { margin-bottom: 0; }
	.yly-filter-form button[type="submit"] { flex: 1 1 100%; min-height: 40px; }

	/* ---------- 入驻申请页 ---------- */
	.apply-steps { gap: 4px; }
	.apply-step__num { width: 28px; height: 28px; font-size: 13px; }
	.apply-step__body h4 { font-size: 12px; }
	.apply-step__body p { font-size: 10px; }
	.apply-step__line { width: 16px; }
	.apply-card { padding: 16px 14px; border-radius: 10px; }
	.form-grid { grid-template-columns: 1fr !important; gap: 0 !important; }
	.apply-benefits { grid-template-columns: 1fr; gap: 8px; }
	.apply-benefits__item { padding: 11px 14px; font-size: 13px; }

	/* ---------- 登录页 ---------- */
	.yly-auth-wrap { margin: 14px auto !important; }
	.yly-auth-box { padding: 18px 14px; }

	/* ---------- 用户中心 ---------- */
	.uc-layout { grid-template-columns: 1fr; gap: 14px; }
	.uc-sidebar { position: static; padding: 14px; }
	.uc-profile { padding-bottom: 12px; }
	.uc-profile__avatar { width: 50px !important; height: 50px !important; }
	.uc-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--yly-border); }
	.uc-nav li { flex: 1 1 calc(50% - 6px); }
	.uc-nav li a { padding: 9px 10px; font-size: 13px; text-align: center; }
	.uc-content { min-height: auto; }
	.uc-panel { padding: 14px; border-radius: 10px; }
	.uc-panel__title { font-size: 16px; }
	.uc-panel__head { flex-wrap: wrap; gap: 8px; }
	.uc-fieldset { padding: 14px; margin-bottom: 12px; }
	.uc-fieldset__title { font-size: 14px; }
	.uc-cover__preview { max-width: 100%; }
	.yly-media-thumb img { width: 60px; height: 60px; }
	.uc-form-actions { flex-direction: column; gap: 8px; }
	.uc-form-actions .btn { width: 100%; min-height: 42px; }
	.uc-article-item { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 0; }
	.uc-article-item__actions { display: flex; gap: 6px; width: 100%; }
	.uc-article-item__actions .btn { flex: 1; min-height: 38px; }

	/* ---------- 首页底部信息带：压缩 ---------- */
	.home-bottom { padding: 14px 12px; gap: 14px; }
	.home-bottom__citys { display: flex; flex-wrap: wrap; gap: 8px; }
	.home-bottom__citys a { font-size: 12px; padding: 4px 10px; border: 1px solid var(--yly-border); border-radius: 14px; background: #fff; }
	.home-bottom__block--nav { display: none; } /* 快捷导航移动端隐藏 */
	.home-bottom__block--contact { border-left: none; padding-left: 0; }

	/* ---------- 页脚 ---------- */
	.site-footer { padding: 20px 0 24px; }
	.site-footer__inner { grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
	.site-footer__brand h4 { font-size: 15px; }
	.footer-links__list { gap: 10px; overflow-x: auto; white-space: nowrap; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
	.footer-links__list::-webkit-scrollbar { display: none; }
	.site-footer__bottom { font-size: 11px; }


	/* ---------- 分页 ---------- */
	.yly-pagination .page-numbers { padding: 6px 10px; margin: 0 2px; font-size: 13px; min-width: 34px; text-align: center; }

	/* ---------- 侧栏 widget ---------- */
	.site-sidebar .widget { padding: 14px; margin-bottom: 12px; }
	.widget--hotline { padding: 16px 14px; }
	.widget--hotline__num { font-size: 18px; }

	/* ---------- 首页右侧栏（移动端整体隐藏：热门机构榜/入驻卡） ---------- */
	.home-aside { display: none; }

	/* ---------- 首页机构推荐：只显示前 4 张卡 ---------- */
	.inst-grid--home .inst-card:nth-child(n+5) { display: none; }

	/* ---------- 首页资讯区：移动端精简 ---------- */
	/* 隐藏 Tab 切换（只显示"推荐"列），资讯条目只留前 5 条 */
	.home-tabs .tabs__nav { display: none; }
	.home-tabs .tabs__panel:not([data-panel="0"]) { display: none; }
	.home-main .news-row:nth-child(n+6) { display: none; }
	/* 资讯行改紧凑单行：日期竖排 → 横排小标签，隐藏次要 meta */
	.home-main .news-row { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 10px 0; }
	.home-main .news-row__date { flex: 0 0 auto; flex-direction: row; align-items: baseline; gap: 4px; background: var(--yly-bg-alt); padding: 3px 7px; border-radius: 4px; }
	.home-main .news-row__date strong { font-size: 12px; }
	.home-main .news-row__date span { font-size: 10px; opacity: 0.6; }
	.home-main .news-row__body { flex: 1; min-width: 0; }
	.home-main .news-row__title { font-size: 14px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.home-main .news-row__meta { display: none; } /* 隐藏标签+时间+浏览，移动端只要标题 */

	/* ---------- 首页底部信息带：移动端整体隐藏 ---------- */
	.home-bottom { display: none; }

	/* ---------- 页脚精简：只留品牌 + 版权 ---------- */
	.site-footer__contact, .site-footer__links { display: none; }
	.site-footer__inner { margin-bottom: 8px; }
	.site-footer__brand h4 { font-size: 15px; margin-bottom: 2px; }
	.site-footer__brand p { font-size: 12px; }

	/* ---------- 移动端底部 TabBar ---------- */
	.mobile-tabbar {
		display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
		background: #fff; border-top: 1px solid var(--yly-border);
		box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.07);
		padding-bottom: env(safe-area-inset-bottom);
	}
	.mobile-tabbar__item {
		flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
		gap: 2px; padding: 7px 0 6px; color: #999; font-size: 11px; line-height: 1.2;
		transition: color 0.2s;
	}
	.mobile-tabbar__item.is-active { color: var(--yly-primary); }
	.mobile-tabbar__item.is-active .mobile-tabbar__icon svg { fill: var(--yly-primary); }
	.mobile-tabbar__icon { display: flex; align-items: center; justify-content: center; height: 22px; }
	.mobile-tabbar__icon svg { fill: currentColor; }
	.mobile-tabbar__label { font-size: 11px; }
}

/* ============================================================
   小手机 (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
	html { font-size: 14px; }

	/* 机构卡图占比再缩 */
	.inst-card__thumb { flex-basis: 36%; }
	.inst-card__thumb img { min-height: 88px; }

	/* 快捷入口 4 列微调 */
	.home-entry { gap: 6px; }
	.home-entry__item { padding: 10px 2px 8px; }
	.home-entry__icon { width: 36px; height: 36px; border-radius: 10px; }
	.home-entry__icon svg { width: 18px !important; height: 18px !important; }
	.home-entry__text strong { font-size: 11px; }

	/* 顶部条更紧凑 */
	.topbar__right { font-size: 11px; gap: 8px; }
	.topbar__city-grid { grid-template-columns: repeat(3, 1fr); }

	/* 机构详情 meta */
	.institution-meta-list li strong { flex: 0 0 64px; }

	/* 用户中心导航整行 */
	.uc-nav li { flex: 1 1 100%; }

	/* 文章标题 */
	.article-detail__title { font-size: 17px; }

	/* 图集缩略图 */
	.institution-detail__thumb { flex: 0 0 60px; height: 44px; }

	/* Banner 高度 */
	.home-banner { aspect-ratio: 16/10; max-height: 190px; }

	/* 搜索按钮文字隐藏用图标 */
	.search-form__btn { padding: 0 12px; font-size: 12px; }
}

/* ============================================================
   极小屏 (≤ 360px)
   ============================================================ */
@media (max-width: 360px) {
	.home-entry { grid-template-columns: repeat(4, 1fr); gap: 4px; }
	.inst-card { flex-direction: row; }
	.inst-card__thumb { flex-basis: 38%; }
	.inst-card__thumb img { min-height: 84px; }
	.tabs__tab { padding: 8px 11px; font-size: 12px; }
	.topbar__city-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
	.topbar__city-tip { display: none; }
	.topbar__welcome { display: none; }
	.site-logo-text__name { font-size: 15px; }
	.search-form__type { display: none; } /* 极小屏隐藏类型下拉 */
	.home-bottom__citys a { font-size: 11px; }
}
