/* ==========================================================
   首页（index.html）—— 只放这一页的样式
   1 蓝墙横幅  2 快捷入口  3 货架工具条  4 商品卡补充  5 小屏
   ========================================================== */

/* ---------- 1 蓝墙横幅 ---------- */
/* 商城页头占文档流（sticky），首页不需要 .band 默认的「往上缩 50px」；
   改成用 ::before 把蓝墙往上延伸到页头 / 公告条后面，免得露出一条地面色。 */
.page--home { padding-top: 0; }
.home-hero.band {
  position: relative;
  margin-top: 0;
  padding-top: clamp(18px, 3.6vh, 38px);
}
.home-hero.band::before {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 100%;
  height: 320px;
  background: var(--wall);
  pointer-events: none;
}
/* 公告条（layout.js 插在页头和正文之间）要盖在延伸出来的蓝墙上面 */
body[data-page="home"] .annbar { position: relative; z-index: 3; }

.home-hero__copy { padding-bottom: 26px; }
.home-hero__copy h1 { overflow-wrap: anywhere; }
.home-hero__copy .intro__sub { max-width: 30em; overflow-wrap: anywhere; }
.home-hero__cta {
  display: flex; flex-wrap: wrap; gap: 12px 14px;
  margin-top: 20px;
}
.home-hero .intro__cat { margin-bottom: -5px; }

/* ---------- 2 快捷入口 ---------- */
.quick { margin-top: clamp(22px, 3vw, 34px); }
.quick__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.quick__item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-width: 0;
  padding: 12px 14px;
  text-align: left; text-decoration: none; color: var(--choco);
  background: var(--fluff);
  border: var(--edge) solid var(--choco);
  border-radius: 20px;
  box-shadow: var(--drop);
  transition: transform .15s var(--spring), box-shadow .15s, background-color .15s;
}
a.quick__item:hover, button.quick__item:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--choco); background: #FFF9F6; }
a.quick__item:active, button.quick__item:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--choco); }
.quick__item.is-off { opacity: .55; box-shadow: none; border-style: dashed; }
.quick__icon {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--wall);
  border: 2px solid var(--choco);
  border-radius: 14px;
}
.quick__item:nth-child(2n) .quick__icon { background: var(--ear); }
.quick__icon svg {
  width: 24px; height: 24px;
  fill: none; stroke: var(--choco); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.quick__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.quick__eyebrow { font-size: 11px; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.quick__title { font: 400 18px/1.35 var(--font-display); }
.quick__sub { font-size: 13px; line-height: 1.5; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick__arrow { flex: none; font-size: 20px; line-height: 1; color: var(--ink-3); }

/* ---------- 3 货架工具条 ---------- */
.shelf { padding-top: 6px; }
.shelf .section-title { margin-top: clamp(26px, 3.4vw, 40px); }
.shelf__tools { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.shelf__chips .chip { cursor: pointer; }
.chip__icon { font-size: 15px; line-height: 1; }
.shelf__bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.shelf__search { flex: 1 1 320px; min-width: 0; }
.shelf__search .input { min-width: 0; }
.shelf__search .btn { flex: none; white-space: nowrap; }
.shelf__search .input::-webkit-search-cancel-button { cursor: pointer; }
.shelf__sort { display: flex; align-items: center; gap: 8px; flex: none; }
.shelf__sort-label { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.shelf__sort .select { width: auto; min-width: 9.5em; }
.shelf__grid { min-height: 220px; }

/* ---------- 4 商品卡补充 ---------- */
.pcard__cat { font-size: 12px; line-height: 1.4; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard__tag {
  padding: 0 8px;
  font-size: 12px; line-height: 1.7;
  background: var(--ear);
  border: 1.5px dashed var(--cocoa);
  border-radius: 999px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pcard__badges { display: flex; flex-wrap: wrap; gap: 4px; }
.pcard__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 2px; min-width: 0; }
.pcard__to { font-size: .62em; }
.pcard__price .price__old { margin-left: 4px; }
.pcard__sold { flex: none; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.pcard__img { position: relative; }
.pcard.is-soldout .pcard__img::after {
  content: "";
  position: absolute; inset: 0;
  background: rgb(74 55 45 / .18);
}
.pcard__ribbon { background: var(--nose); }

/* 加载中的骨架卡 */
.pcard--skel { pointer-events: none; }
.pcard--skel:hover { transform: none; box-shadow: var(--drop); }
.pcard--skel .pcard__img { border-bottom-color: rgb(74 55 45 / .25); }
.skel-line { display: block; height: 14px; border-radius: 8px; }
.skel-line--short { width: 62%; }
.skel-line--price { width: 42%; height: 22px; margin-top: 10px; }

/* ---------- 5 小屏 ---------- */
@media (max-width: 720px) {
  .shelf__chips { flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 6px; margin-inline: -2px; scrollbar-width: none; }
  .shelf__chips::-webkit-scrollbar { display: none; }
  .shelf__chips .chip { flex: none; }
  .shelf__search { flex-basis: 100%; }
  .shelf__sort { flex: 1 1 100%; }
  .shelf__sort .select { flex: 1 1 auto; }
}
@media (max-width: 560px) {
  .home-hero__copy { padding-bottom: 16px; }
  .home-hero__copy .intro__sub { font-size: 13.5px; }
  .home-hero__cta { gap: 8px; margin-top: 14px; }
  .home-hero__cta .btn { padding: 6px 14px; font-size: 15px; box-shadow: 0 3px 0 var(--choco); }
  .quick__grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .quick__item { padding: 10px 12px; }
  .quick__icon { width: 38px; height: 38px; border-radius: 12px; }
  .quick__title { font-size: 16px; }
  .pcard__tag:nth-child(n+2) { display: none; }
  .pcard__badges .badge:nth-child(n+3) { display: none; }
  .pcard__sold { display: none; }
  .pcard__foot { padding-top: 2px; }
}
@media (max-width: 380px) {
  .home-hero__copy h1 { font-size: 27px; }
  .home-hero .intro__cat { width: 92px; }
}
