/* =========================================================================
   佳孚 JIAFU AUTO · All models 落地页
   严格按设计稿「汽车网站 - 二级页 -2.psd」（1920 宽画板，内容区 355–1569 = 1214px）
   所有尺寸均取自 PSD 图层 bbox，按 1:1 落到 CSS
   ========================================================================= */

.page-all-models { background: #f6f7f8; }

/* 内容区与 PSD 对齐：1216 宽（PSD 1214） */
.page-all-models .container { max-width: 1256px; }

/* 当前页高亮 */
.page-all-models .nav-item > a.is-current { color: var(--primary); }

/* ===== 面包屑（PSD: 366,98 / 15px） ===== */
.am-crumb { padding-top: 32px; font-size: 15px; line-height: 1.2; }
.am-crumb .c-home { color: #ee3c2e; }
.am-crumb .c-mid { color: #ee3c2e; }
.am-crumb .c-mid:hover { text-decoration: underline; }
.am-crumb .c-sep { color: #c5c8cd; margin: 0 9px; }
.am-crumb .c-cur { color: #636364; }

/* ===== 搜索面板（PSD: 355,135 → 1569,872，圆角 10） ===== */
.am-panel {
  margin-top: 21px;
  background: #fff;
  border-radius: 10px;
  padding: 60px 0 64px;
}
.am-panel-title {
  margin: 0;
  font-size: 29px;
  font-weight: 400;
  color: #000;
  text-align: center;
  line-height: 1.2;
  letter-spacing: .2px;
}

/* 搜索框（PSD: 683,274 → 1211,338；按钮 54px 圆） */
.am-search { position: relative; width: 528px; max-width: 100%; margin: 44px auto 0; }
.am-search input {
  width: 100%; height: 64px; border: 1.5px solid #2b2b2b; border-radius: 999px;
  background: #fff; font-size: 15px; color: #1f1f1f; text-align: center;
  padding: 0 70px 0 24px; outline: none;
  font-family: inherit;
}
.am-search input::placeholder { color: #9aa0a6; }
.am-search input:focus { border-color: var(--primary); }
.am-search-go {
  position: absolute; right: 5px; top: 5px; width: 54px; height: 54px;
  border-radius: 50%; border: none; background: var(--primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.am-search-go:hover { background: var(--primary-dark); }

/* 四个分类卡（PSD: 548,384 186×177；gap 19） */
.am-tabs { display: flex; justify-content: center; gap: 19px; margin-top: 42px; padding: 0 20px; }
.am-tab {
  width: 186px; height: 177px; border: none; background: #fff; border-radius: 12px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .045);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 62px; gap: 36px; cursor: pointer; transition: box-shadow .22s, transform .22s;
  font-family: inherit; padding: 62px 0 0;
}
.am-tab:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(16, 24, 40, .09); }
.am-tab img { height: 32px; width: auto; display: block; }
.am-tab img.ico-on { display: none; }
.am-tab span { font-size: 15px; color: #3d3d3d; line-height: 1; }
/* 选中态：文字与图标同时变主色橙（图标用预制的橙色版图片，白底图用 filter 会糊成色块） */
.am-tab.on span { color: var(--primary); }
.am-tab.on img.ico { display: none; }
.am-tab.on img.ico-on { display: block; }

/* 四栏筛选：与首页 index.html 一致（胶囊头 + 点击展开下拉浮层） */
.am-filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin: 80px 0 0; }
.am-fcol { position: relative; }
.am-fhead {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 20px;
  border: none; border-radius: 999px; background: #f3f3f4; color: #6f7378;
  font-size: 15px; cursor: pointer; font-family: inherit; transition: background .18s, color .18s;
}
.am-fhead img { height: 16px; width: auto; display: block; }
.am-fhead .caret { font-size: 10px; line-height: 1; transition: transform .2s; }
.am-fhead.open .caret { transform: rotate(180deg); }
.am-fhead.on, .am-fhead.open { background: var(--primary); color: #fff; }
.am-fhead.on img, .am-fhead.open img { filter: brightness(0) invert(1); }
.am-drop {
  display: none; position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 100%; width: max-content; max-width: 300px;
  background: #fff; border: 1px solid #e7eaf0; border-radius: 10px;
  box-shadow: 0 6px 22px rgba(15, 23, 42, .10); padding: 8px; z-index: 30;
}
.am-drop.open { display: block; }
.am-opt {
  display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 6px;
  font-size: 15px; color: #333; cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s;
}
.am-opt::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #d3d9e3; flex: none; transition: background .18s;
}
.am-opt:hover { background: #f6f7f8; }
.am-opt.sel { color: var(--primary-dark); font-weight: 600; }
.am-opt.sel::before { background: var(--primary); }

/* 已选条件标签：与首页一致，选中后出现在筛选列下方 */
.am-chips { display: none; flex-wrap: wrap; align-items: center; gap: 10px; margin: 24px 0 0; }
.am-chips.on { display: flex; }
.am-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,106,0,.1); color: var(--primary-dark);
  font-size: 13px; line-height: 1; padding: 7px 12px; border-radius: 999px;
}
.am-chip button {
  border: none; background: none; color: var(--primary-dark);
  cursor: pointer; font-size: 14px; line-height: 1; padding: 0;
}
.am-chip-clear {
  border: none; background: none; color: #9c9d9d;
  font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0;
}

/* ===== 区块标题（PSD: 36px / 副标题 16px #9c9d9d） ===== */
.am-sec { margin-top: 64px; }
.am-sec h2 { margin: 0; font-size: 42px; font-weight: 400; color: #000; text-align: center; line-height: 1.15; }
.am-sec .am-sub { font-size: 22px; color: #9c9d9d; text-align: center; margin-top: 16px; line-height: 1.2; }

/* ===== 通用卡片 ===== */
.am-card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 2px 16px rgba(16, 24, 40, .05);
}
.am-actions { display: flex; align-items: center; justify-content: space-between; height: 22px; }
.am-actions + .am-actions { margin-top: 18px; }
.am-actions span { font-size: 15px; color: #2f2f2f; }
.am-go {
  width: 22px; height: 22px; border-radius: 50%; border: none; background: #2f2f2f;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
}
.am-go:hover { background: var(--primary); }

/* ===== New Car Recommendations（PSD: 卡片 355,1141 300×332；gap 6） ===== */
.am-rec-wrap { position: relative; margin-top: 100px; }
/* ===== 推荐区轨道 ===== */
.am-track {
  display: flex; gap: 6px; overflow-x: auto; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none;
}
/* 卡片图片禁止被浏览器原生拖拽（否则鼠标拖动时会被当图片抓走） */
.am-track img, .am-deal img, .am-sale img { -webkit-user-drag: none; user-select: none; }
.am-track::-webkit-scrollbar { display: none; }
.rc-card { flex: 0 0 calc((100% - 18px) / 4); min-height: 332px; padding: 36px 28px 34px; }
.rc-badge { display: flex; align-items: center; gap: 15px; height: 19px; font-size: 16px; color: #1c1c1c; white-space: nowrap; overflow: hidden; }
.rc-badge img { height: 19px; width: auto; display: block; }
.rc-media { width: 243px; max-width: 100%; height: 143px; margin: 26px auto 0; display: flex; align-items: flex-start; justify-content: center; }
.rc-media img { width: 211px; max-width: 100%; height: auto; display: block; }
.rc-foot { margin: 12px 22px 0; }
.rc-foot .am-actions { margin: 0; }
.rc-foot .am-actions + .am-actions { margin-top: 18px; }

.am-track { position: relative; cursor: grab; }
/* 桌面端按住拖动时的状态：抓手指针、禁选中文本、去掉平滑滚动以便跟手 */
.am-track.dragging { cursor: grabbing; user-select: none; scroll-behavior: auto; }
@media (hover: none) { .am-track { cursor: auto; } }
/* ===== 推荐结果页（recommendations.html）：铺开全部符合条件的推荐车 ===== */
.rec-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 56px; }
.rec-list .rc-card { flex: none; }
.rec-head { text-align: center; }
.rec-head h1 { margin: 0; font-size: 42px; font-weight: 400; color: #000; line-height: 1.15; }
.rec-count { margin-top: 12px; font-size: 15px; color: #9c9d9d; }
.rec-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
/* 结果页的 Clear all 用白底灰字胶囊，和橙色条件芯片区分开 */
.rec-chips .am-chip-clear {
  background: #fff; border: 1px solid #e0e2e6; color: #5f6165;
  text-decoration: none; padding: 6px 12px;
}
.rec-chips .am-chip-clear:hover { border-color: var(--primary); color: var(--primary); }
.rec-back { margin-top: 54px; text-align: center; }
.rec-back a {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 24px;
  border: 1px solid #e3e5e8; border-radius: 999px; background: #fff;
  color: #1c1c1c; font-size: 15px; text-decoration: none;
}
.rec-back a:hover { border-color: var(--primary); color: var(--primary); }

/* 竖排 View more（PSD: 1612,1244 31×125）：默认隐藏，8 款滑完才淡入 */
.am-viewmore {
  position: absolute; right: -56px; top: 50%; transform: translateY(-50%);
  width: 31px; height: 125px; border: 1px solid #e3e5e8; border-radius: 999px;
  background: #fff; color: #333; font-size: 12px; letter-spacing: 2px;
  writing-mode: vertical-rl; text-orientation: mixed;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: inherit; padding: 0;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .3s ease, visibility .3s ease, border-color .2s, color .2s;
}
.am-viewmore.show { opacity: 1; visibility: visible; pointer-events: auto; }
.am-viewmore:hover { border-color: var(--primary); color: var(--primary); }

/* ===== Deal List（PSD: 卡片 300×392） ===== */
.am-deal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 49px; }
#amDeals { margin-top: 98px; }
.dc-card { position: relative; min-height: 392px; padding: 21px 26px 30px; }
.dc-top {
  position: absolute; top: 20px; right: 19px; height: 19px; padding: 0 7px;
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 700;
  letter-spacing: .4px; border-radius: 5px; display: flex; align-items: center;
}
.dc-top::after {
  content: ""; position: absolute; left: 5px; bottom: -5px;
  border: 3px solid transparent; border-top-color: var(--primary); border-left-color: var(--primary);
}
.dc-stat { margin-top: 30px; max-width: 186px; min-height: 39px; font-size: 15px; color: #6b7075; line-height: 1.3; }
.dc-stat b { font-size: 20px; font-weight: 400; color: #1c1c1c; }
.dc-media { width: 243px; max-width: 100%; height: 143px; margin: 11px auto 0; display: flex; align-items: flex-start; justify-content: center; }
.dc-media img { width: 211px; max-width: 100%; height: auto; display: block; }
.dc-name { text-align: center; font-size: 16px; color: #1c1c1c; margin-top: 7px; }
.dc-foot { margin: 31px 22px 0; }
.dc-foot .am-actions { margin: 0; }
.dc-foot .am-actions + .am-actions { margin-top: 18px; }

.am-note { text-align: right; font-size: 16px; color: #a8adb3; margin-top: 30px; }

/* ===== All models on sale（PSD: 卡片 298×346；列 gap 7 / 行 gap 18） ===== */
.am-sale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 7px; margin-top: 70px; }
#amSale { margin-top: 117px; }
.sc-card { min-height: 346px; padding: 31px 26px 30px; }
.sc-name { text-align: center; font-size: 16px; color: #1c1c1c; }
.sc-sub { text-align: center; font-size: 12px; color: #9c9d9d; margin-top: 13px; }
.sc-media { width: 196px; max-width: 100%; height: 100px; margin: 41px auto 0; display: flex; align-items: center; justify-content: center; }
.sc-media img { width: 100%; height: auto; display: block; }
.sc-foot { margin: 24px 22px 0; }
.sc-foot .am-actions { margin: 0; }
.sc-foot .am-actions + .am-actions { margin-top: 18px; }

/* ===== 分页（PSD: 780,3963 359×65 胶囊；当前页灰块） ===== */
.am-pager { display: flex; justify-content: center; margin-top: 129px; padding-bottom: 84px; }
.am-pager-box {
  display: inline-flex; align-items: center; height: 65px; background: #fff;
  border-radius: 999px; box-shadow: 0 2px 14px rgba(16, 24, 40, .05); overflow: hidden;
}
.am-pg {
  min-width: 78px; height: 65px; border: none; background: transparent;
  font-size: 15px; color: #1c1c1c; cursor: pointer; font-family: inherit;
}
.am-pg.on { background: #e9eaeb; }
.am-pg:disabled { cursor: default; }
.am-pg-sep { min-width: 44px; text-align: center; font-size: 15px; color: #999; }
.am-pg-next { min-width: 79px; display: flex; align-items: center; justify-content: center; }

/* ===== 右侧悬浮快捷条（PSD: 1597,2904 177×401） ===== */
.am-float {
  position: fixed; right: 28px; top: 50%; transform: translateY(-50%);
  width: 132px; background: #fff; border-radius: 16px;
  box-shadow: 0 12px 34px rgba(16, 24, 40, .12);
  padding: 18px 10px; z-index: 90;
}
.am-float button {
  width: 100%; border: none; background: none; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 18px 0; font-size: 15px; color: #1c1c1c;
}
.am-float button:hover { color: var(--primary); }
.am-float button img { height: 22px; width: auto; display: block; }
.am-float .am-float-fire img { height: 23px; }

/* ===== Contact Sales 留言板（设计稿未给，按站点风格补齐） ===== */
.am-modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: none; align-items: center; justify-content: center; z-index: 999; padding: 20px;
}
.am-modal.show { display: flex; }
.am-modal-card {
  width: 100%; max-width: 460px; background: #fff; border-radius: 16px; padding: 32px 30px 28px;
  position: relative; box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}
.am-modal-card h3 { font-size: 22px; font-weight: 500; color: #111; text-align: center; }
.am-modal-card p { font-size: 14px; color: #8b9198; text-align: center; margin-top: 10px; }
.am-modal-card .am-x {
  position: absolute; right: 14px; top: 12px; width: 32px; height: 32px; border: none;
  background: none; font-size: 20px; color: #9aa0a6; cursor: pointer;
}
.am-modal-card label { display: block; font-size: 13px; color: #5b6167; margin-top: 18px; }

/* 询盘身份条：登录会员 / 游客 */
.am-who {
  display: flex; align-items: flex-start; gap: 7px;
  margin-top: 14px; padding: 9px 12px; border-radius: 8px;
  font-size: 12.5px; line-height: 1.5; text-align: left;
}
.am-who .am-who-ico { font-size: 11px; line-height: 1.7; flex: none; }
.am-who i { display: block; font-style: normal; font-size: 11.5px; opacity: .72; margin-top: 1px; }
.am-who.is-member { background: #f1f7f1; color: #1a7f37; border: 1px solid #d9ecdd; }
.am-who.is-member .am-who-ico { color: #1a7f37; }
.am-who.is-guest { background: #fbf6f1; color: #8a5a2b; border: 1px solid #f0e2d4; }
.am-who.is-guest .am-who-ico { color: #c98b4a; }
.am-who.is-guest a { display: inline-block; margin-left: 6px; color: var(--primary); text-decoration: underline; }
.am-modal-card input[readonly] { background: #f4f5f7; color: #6b7178; }
.am-modal-card input, .am-modal-card textarea {
  width: 100%; margin-top: 8px; border: 1px solid #e3e5e8; border-radius: 8px;
  padding: 11px 13px; font-size: 14px; font-family: inherit; color: #1f1f1f; outline: none;
  background: #fbfbfc;
}
.am-modal-card input:focus, .am-modal-card textarea:focus { border-color: var(--primary); background: #fff; }
.am-modal-card textarea { height: 96px; resize: vertical; }
.am-modal-card .am-submit {
  width: 100%; margin-top: 22px; height: 46px; border: none; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 16px; cursor: pointer; font-family: inherit;
}
.am-modal-card .am-submit:hover { background: var(--primary-dark); }
.am-modal-card .am-tip { font-size: 12px; color: #a8adb3; text-align: center; margin-top: 12px; }

/* ===== 响应式 ===== */
@media (max-width: 1279px) {
  .am-viewmore { right: -18px; }
}
@media (max-width: 1080px) {
  .am-float { display: none; }
  .am-track { overflow-x: auto; }
  .rc-card, .dc-card, .sc-card { flex: 0 0 calc((100% - 12px) / 3); }
  .am-deal, .am-sale { grid-template-columns: repeat(3, 1fr); }
  .am-filters { gap: 12px; }
  .am-chips { margin-left: 0; }
  .am-panel { padding: 46px 20px 48px; }
  .rec-list { grid-template-columns: repeat(3, 1fr); }
  .am-viewmore { right: -18px; }
}
@media (max-width: 768px) {
  .am-crumb { padding-top: 20px; }
  .am-panel-title { font-size: 22px; }
  .am-search { margin-top: 30px; }
  .am-search input { height: 54px; padding: 0 62px 0 18px; }
  .am-search-go { width: 44px; height: 44px; }
  .am-tabs { flex-wrap: wrap; gap: 12px; margin-top: 30px; }
  .am-tab { width: calc(50% - 6px); height: 132px; gap: 22px; padding-top: 34px; }
  .am-tab img { height: 26px; }
  .am-filters { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; margin: 36px 0 0; }
  .am-chips { margin: 20px 0 0; }
  .am-fhead { font-size: 14px; height: 36px; padding: 0 16px; }
  .am-sec { margin-top: 48px; }
  .am-sec h2 { font-size: 26px; }
  .am-sec .am-sub { margin-top: 14px; font-size: 14px; }
  .am-rec-wrap { margin-top: 40px; }
  .am-track { gap: 12px; }
  .rc-card, .dc-card, .sc-card { flex: 0 0 78%; }
  .am-deal, .am-sale { grid-template-columns: 1fr; }
  .rec-list { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  /* 移动端：View more 由竖排浮条改为整宽按钮，放在轨道下方 */
  .am-viewmore {
    position: static; width: 100%; height: 44px; margin-top: 20px; transform: none;
    writing-mode: horizontal-tb; letter-spacing: 1px; font-size: 14px;
  }
  .am-pager { margin-top: 46px; padding-bottom: 50px; }
  .am-pg { min-width: 58px; }
  .am-note { text-align: center; }
}
