/* ============================================================
   食光 Pantry Life · 第二阶段 · 库存管理样式
   只使用 tokens.css 变量：奶油米白 / 鼠尾草绿 / 暖棕 / 纸纹 /
   有机圆角 / 衬线标题。刻意避开冷硬表格与后台系统感。
   ============================================================ */

/* ---------------- 通用补充组件 ---------------- */
.crumb-link { cursor: pointer; border-bottom: 1px solid transparent; }
.crumb-link:hover { border-bottom-color: var(--olive); color: var(--olive); }

.db-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--sage-wash);
  color: var(--olive-deep);
  font-size: 10px; letter-spacing: .2px;
  white-space: nowrap;
}
.db-pill svg { width: 13px; height: 13px; flex: none; }
.db-pill b { font-weight: 600; }
/* 预览沙箱 / 隐私模式：不谎称持久化 */
.db-pill--temp { background: var(--cream-deep); border-color: var(--clay-pale); color: var(--warm); }
.db-pill--temp b { color: var(--clay); }

.btn--danger { background: var(--clay); color: #fff; }
.btn--danger:hover { background: #9c452f; }
.btn--danger-ghost { color: var(--clay); border-color: var(--clay-pale); }
.btn--danger-ghost:hover { background: var(--clay-pale); border-color: var(--clay); }

/* 表单控件扩展（select / textarea / 开关） */
.field select, .field textarea {
  width: 100%; min-height: var(--tap);
  padding: 10px 13px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  font-size: 13px; font-family: var(--sans); color: var(--ink);
  outline: none; appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.4 6 6.4l5-5' fill='none' stroke='%237b7362' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 32px;
}
.field textarea { resize: vertical; line-height: 1.6; min-height: 78px; }
.field select:focus, .field textarea:focus { border-color: var(--sage); background-color: var(--paper); }
.field input:disabled, .field select:disabled { opacity: .5; cursor: not-allowed; }
.field__hint { display: block; margin-top: 6px; font-size: 10px; font-style: normal; color: var(--ink-3); line-height: 1.5; }
.req { font-style: normal; font-size: 9px; color: var(--clay); margin-left: 4px; font-weight: 600; }

.switch-row {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); cursor: pointer;
  font-size: 12px; color: var(--ink-2);
}
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-row__track {
  position: relative; width: 44px; height: 26px; flex: none;
  border-radius: var(--r-pill); background: var(--cream-deep);
  border: 1px solid var(--line); transition: background .2s ease;
}
.switch-row__track > i {
  position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
  border-radius: var(--r-round); background: var(--paper);
  box-shadow: 0 1px 4px rgba(107,77,54,.2); transition: transform .2s ease;
}
.switch-row input:checked + .switch-row__track { background: var(--sage); border-color: var(--sage); }
.switch-row input:checked + .switch-row__track > i { transform: translateX(18px); }
.switch-row input:focus-visible + .switch-row__track { outline: 2px solid var(--olive); outline-offset: 3px; }

.modal-card--wide { width: min(560px, 100%); max-height: min(88vh, 820px); overflow-y: auto; }
.modal-body .form__lead { margin-bottom: 16px; }
.form__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.confirm__text { font-size: 14px; line-height: 1.75; color: var(--ink); }
.confirm__detail { margin-top: 10px; font-size: 11px; line-height: 1.7; color: var(--ink-2); background: var(--paper-warm); padding: 12px 14px; border-radius: var(--r-chip); }
.confirm__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ============================================================
   一、库存列表页
   ============================================================ */
.inv-page { padding-bottom: 8px; }

.inv-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 14px 24px;
  align-items: center;
  padding: 26px 30px 24px;
  margin-bottom: 22px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.inv-head::before {
  content: ""; position: absolute; width: 260px; height: 260px;
  left: -120px; bottom: -170px; border-radius: var(--r-round);
  background: radial-gradient(circle, rgba(185,195,154,.22), transparent 68%);
  pointer-events: none;
}
.inv-head__text { position: relative; }
.inv-head__text h1 { font-size: 30px; margin: 6px 0 8px; }
.inv-head__text p { font-size: 12px; color: var(--ink-2); max-width: 620px; line-height: 1.75; }
.inv-head__art { position: relative; align-self: center; }
.inv-head__art img {
  width: 168px; height: 128px; object-fit: cover;
  border-radius: 30px 34px 26px 32px / 32px 26px 34px 28px;
  border: 1px solid var(--line-soft);
  transform: rotate(2deg);
}
.inv-head__actions { position: relative; grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }

.inv-stats {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px; margin-bottom: 22px;
}
.inv-stat {
  position: relative; padding: 16px 16px 15px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.inv-stat::after {
  content: ""; position: absolute; right: -18px; top: -22px;
  width: 78px; height: 78px; border-radius: var(--r-round);
  background: rgba(185,195,154,.13); pointer-events: none;
}
.inv-stat__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--ink-2); }
.inv-stat__head svg { color: var(--sage); flex: none; }
.inv-stat__value { font-family: var(--serif); font-size: 28px; font-weight: 700; line-height: 1.25; margin-top: 6px; color: var(--ink); }
.inv-stat__value small { font-family: var(--sans); font-size: 11px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.inv-stat__foot { font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.inv-stat--honey .inv-stat__value { color: var(--warm-deep); }
.inv-stat--honey .inv-stat__head svg { color: var(--honey); }
.inv-stat--clay .inv-stat__value { color: var(--clay); }
.inv-stat--clay .inv-stat__head svg { color: var(--clay); }

.inv-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.search-box {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 16px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-pill);
}
.search-box svg { color: var(--ink-3); flex: none; }
.search-box input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 13px; color: var(--ink);
}
.search-box input::placeholder { color: var(--ink-3); }
.search-box:focus-within { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(150,162,115,.12); }
.sort-box {
  display: flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 14px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-pill); color: var(--ink-3);
}
.sort-box select {
  border: 0; outline: none; background: transparent; appearance: none;
  font-size: 12px; color: var(--ink-2); cursor: pointer; padding-right: 4px;
}

.inv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 6px 15px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-2); font-size: 12px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.chip:hover { transform: translateY(-1px); border-color: var(--sage); }
.chip.is-active { background: var(--olive); border-color: var(--olive); color: var(--on-olive); font-weight: 600; }
.chip i { font-style: normal; font-size: 10px; opacity: .65; }
.inv-result-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; font-size: 11px; color: var(--ink-2);
}
.inv-result-head b { font-family: var(--serif); font-size: 15px; color: var(--ink); }

/* 食材卡片网格：PC 3 列，水彩插画 + 纸卡，不用表格 */
.inv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.food-card {
  position: relative; display: flex; flex-direction: column;
  padding: 16px 18px 14px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card-sm);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  outline: none;
}
.food-card:hover, .food-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--sage-light); }
.food-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.food-card__img { width: 76px; height: 76px; object-fit: cover; border: 1px solid var(--line-soft); }
.food-card__badges { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.food-card__name { font-family: var(--serif); font-size: 19px; font-weight: 700; margin-top: 12px; line-height: 1.3; }
.food-card__cat { font-size: 10px; letter-spacing: 1px; color: var(--ink-3); margin-top: 2px; }
.food-card__qty { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--olive-deep); margin: 8px 0 10px; }
.food-card__meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px; margin: 0; padding: 12px 0;
  border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line);
}
.food-card__meta > div { min-width: 0; }
.food-card__meta dt { font-size: 9px; color: var(--ink-3); letter-spacing: .3px; }
.food-card__meta dd { margin: 1px 0 0; font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.food-card__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 11px; font-size: 10px; color: var(--ink-3); }
.food-card__more { color: var(--olive); font-weight: 600; white-space: nowrap; }

.inv-empty { text-align: center; padding: 46px 20px; background: var(--paper); border: 1px dashed var(--line); border-radius: var(--r-card); }
.inv-empty img { width: 120px; height: 96px; object-fit: cover; margin: 0 auto 14px; border-radius: var(--r-card-sm); opacity: .85; }
.inv-empty h3 { font-size: 19px; margin-bottom: 5px; }
.inv-empty p { font-size: 12px; color: var(--ink-2); margin-bottom: 16px; }

.inv-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--line);
  font-size: 10px; color: var(--ink-3);
}
.fab { display: none; }
.inv-bottom-add { display: none; }

/* ============================================================
   二、食材详情页
   ============================================================ */
.detail-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--olive); padding: 6px 2px; }
.back-link:hover { text-decoration: underline; }

.detail-hero {
  display: grid; grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px 26px; padding: 24px 28px;
  background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--r-card); box-shadow: var(--shadow);
  margin-bottom: 26px; position: relative; overflow: hidden;
}
.detail-hero::after {
  content: ""; position: absolute; right: -70px; top: -90px;
  width: 260px; height: 260px; border-radius: var(--r-round);
  background: radial-gradient(circle, rgba(233,239,216,.5), transparent 68%); pointer-events: none;
}
.detail-hero__art img { width: 190px; height: 190px; object-fit: cover; border: 1px solid var(--line-soft); }
.detail-hero__main { position: relative; z-index: 1; }
.detail-hero__main h1 { font-size: 30px; margin: 6px 0 10px; }
.detail-hero__tags { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.detail-hero__qty { font-family: var(--serif); font-size: 34px; font-weight: 700; color: var(--olive-deep); line-height: 1.2; }
.detail-hero__sub { font-size: 11px; color: var(--ink-2); margin-top: 3px; }
.detail-hero__actions { grid-column: 1 / -1; display: flex; gap: 9px; flex-wrap: wrap; position: relative; z-index: 1; padding-top: 14px; border-top: 1px dashed var(--line); }

.detail-section { margin-bottom: 26px; }
.detail-info { padding: 20px 24px; }
.detail-info > dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; }
.kv { min-width: 0; }
.kv dt { font-size: 10px; color: var(--ink-3); letter-spacing: .3px; }
.kv dd { margin: 3px 0 0; font-size: 13px; color: var(--ink); word-break: break-word; }
.detail-info__note {
  display: flex; align-items: flex-start; gap: 9px;
  margin-top: 18px; padding: 12px 14px;
  background: var(--honey-pale); border-radius: var(--r-chip);
  font-size: 11px; line-height: 1.7; color: var(--warm-deep);
}
.detail-info__note svg { flex: none; margin-top: 2px; }

.batch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.batch-card {
  padding: 16px 18px 14px;
  background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--r-card-sm); box-shadow: var(--shadow);
}
.batch-card.is-used { opacity: .6; background: var(--cream-deep); }
.batch-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.batch-card__no { font-size: 10px; letter-spacing: .6px; color: var(--ink-3); }
.batch-card__qty { font-family: var(--serif); font-size: 27px; font-weight: 700; color: var(--ink); margin: 8px 0 10px; }
.batch-card__qty small { font-family: var(--sans); font-size: 11px; color: var(--ink-3); margin-left: 4px; }
.batch-card__meta { margin: 0; padding: 10px 0; border-top: 1px dashed var(--line); display: grid; gap: 7px; }
.batch-card__note { font-size: 10px; color: var(--ink-2); margin: 8px 0; line-height: 1.6; }
.batch-card__actions { display: flex; gap: 8px; margin-top: 12px; }
.mini-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 34px; padding: 5px 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--sage-wash); color: var(--olive-deep); font-size: 11px;
}
.mini-btn:hover { border-color: var(--sage); }
.mini-btn--danger { background: var(--paper-warm); color: var(--clay); }
.mini-btn--danger:hover { border-color: var(--clay); }

.log-list { padding: 8px 22px; }
.log-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line-soft); }
.log-row:last-child { border-bottom: 0; }
.log-row__dot { width: 9px; height: 9px; border-radius: var(--r-round); flex: none; margin-top: 6px; background: var(--sage); }
.log-row__dot--warm { background: var(--honey); }
.log-row__dot--clay { background: var(--clay); }
.log-row__body { flex: 1; min-width: 0; }
.log-row__title { font-size: 12px; font-weight: 600; color: var(--ink); }
.log-row__meta { font-size: 10px; color: var(--ink-3); line-height: 1.6; margin-top: 2px; }
.log-row time { font-size: 10px; color: var(--ink-3); white-space: nowrap; }

/* R4 合并来源：折叠在父入库流水下方（只在详情页出现） */
.log-src { margin: -4px 0 10px 21px; }
.log-src__sum {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--ink-3); cursor: pointer;
  list-style: none; padding: 3px 0;
}
.log-src__sum::-webkit-details-marker { display: none; }
.log-src__sum::before {
  content: '\25B8'; font-size: 9px; color: var(--sage);
  display: inline-block; transition: transform .18s ease;
}
.log-src[open] > .log-src__sum::before { transform: rotate(90deg); }
.log-src__list { list-style: none; margin: 4px 0 0; padding: 6px 0 6px 10px; border-left: 2px solid var(--line-soft); max-width: 620px; }
.log-src__row {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 2px 8px; font-size: 10px; color: var(--ink-3); line-height: 1.7;
}
.log-src__idx { flex: none; min-width: 26px; color: var(--sage); font-weight: 600; }
.log-src__name { color: var(--ink-2); font-weight: 600; }
.log-src__qty { flex: none; color: var(--ink-2); }
.log-src__ai { flex: 0 1 auto; margin-left: auto; color: var(--ink-3); text-align: right; }
@media (max-width: 480px) {
  .log-src { margin-left: 14px; }
  .log-src__ai { font-size: 9px; }
}

/* ============================================================
   三、添加 / 编辑表单页
   ============================================================ */
.form-page { max-width: 880px; margin: 0 auto; }
.form-hero { margin: 8px 0 22px; }
.form-hero h1 { font-size: 30px; margin: 6px 0 8px; }
.form-hero p { font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.form-notice {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; margin-bottom: 16px;
  background: var(--honey-pale); border: 1px solid var(--line-soft);
  border-radius: var(--r-card-sm);
  font-size: 11px; line-height: 1.75; color: var(--warm-deep);
}
.form-notice svg { flex: none; margin-top: 2px; }
.form-card {
  padding: 8px 28px 26px;
  background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--r-card); box-shadow: var(--shadow);
}
.form-card__group { padding: 20px 0 22px; border-bottom: 1px dashed var(--line); }
.form-card__group:last-of-type { border-bottom: 0; }
.form-card__label {
  display: flex; align-items: baseline; gap: 9px;
  font-family: var(--serif); font-size: 16px; font-weight: 700;
  margin-bottom: 16px;
}
.form-card__label > span { font-family: var(--sans); font-size: 10px; letter-spacing: 1.5px; color: var(--sage); font-weight: 600; }
.form-card__label em { font-family: var(--sans); font-size: 10px; font-style: normal; color: var(--ink-3); font-weight: 400; }
.form-card .field-row { margin-top: 14px; }
.form-card .field-row:first-of-type { margin-top: 0; }
.form-card__note { font-size: 10px; line-height: 1.7; color: var(--ink-3); margin-top: 10px; }
.form-card__actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 20px; }
.form-foot { text-align: center; font-size: 10px; color: var(--ink-3); margin-top: 16px; line-height: 1.7; }
.form-error {
  margin-top: 16px; padding: 12px 16px;
  background: var(--clay-pale); border-radius: var(--r-chip);
  color: var(--clay); font-size: 11px; line-height: 1.8;
}
.form-error[hidden] { display: none; }
.shelf-hint {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 11px 14px;
  background: var(--sage-wash); border: 1px solid var(--line-soft);
  border-radius: var(--r-chip);
  font-size: 11px; line-height: 1.6; color: var(--olive-deep);
}
.shelf-hint svg { flex: none; color: var(--sage); }
.shelf-hint > span { flex: 1; min-width: 0; }
.shelf-hint__btn {
  flex: none; font-size: 10px; color: var(--olive-deep);
  border-bottom: 1px solid var(--olive); padding: 2px 0;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1200px) {
  .inv-grid, .batch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-info > dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inv-head { grid-template-columns: minmax(0, 1fr) 130px; padding: 22px 24px; }
  .inv-head__art img { width: 130px; height: 108px; }
}

@media (max-width: 900px) {
  .inv-head { grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; padding: 18px 18px 16px; margin-bottom: 16px; }
  .inv-head__text h1 { font-size: 23px; }
  .inv-head__text p { font-size: 11px; line-height: 1.6; }
  .inv-head__art img { width: 96px; height: 84px; }
  .inv-head__actions { flex-wrap: nowrap; }
  .inv-head__actions .btn { flex: 1; padding: 9px 10px; font-size: 12px; }

  .inv-stats {
    display: flex; overflow-x: auto; gap: 10px;
    margin: 0 -16px 18px; padding: 2px 16px 8px;
    /* 与上一处同理：吸附基线要跟内边距一致，否则首张统计卡被顶到屏幕外沿 */
    scroll-padding: 0 16px;
    scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .inv-stats::-webkit-scrollbar { display: none; }
  .inv-stat { flex: 0 0 138px; scroll-snap-align: start; padding: 12px 13px; }
  .inv-stat__value { font-size: 23px; }
  .inv-stat__foot { font-size: 9px; }

  .inv-toolbar { flex-direction: column; align-items: stretch; gap: 9px; }
  /* P0-1：column 主轴下 .search-box 的 flex:1（flex-basis:0%）会把 height:46px
     压缩成 25.4px。固定 flex-basis，保证 44–46px 的输入区与点击热区。 */
  .search-box { flex: 0 0 46px; }
  .sort-box { width: 100%; }
  .sort-box select { flex: 1; }
  .inv-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 6px; scrollbar-width: none; }
  .inv-chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .inv-result-head { font-size: 10px; }

  .inv-grid, .batch-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .food-card { padding: 14px 16px 12px; }
  .food-card__img { width: 64px; height: 64px; }
  .food-card__name { font-size: 17px; margin-top: 10px; }
  .food-card__qty { font-size: 21px; }
  .food-card__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .inv-bottom-add {
    display: flex !important; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: var(--tap); margin: 6px 0 18px;
    background: var(--sage-wash); color: var(--olive-deep);
    border: 1px dashed var(--sage); border-radius: var(--r-pill);
    font-size: 13px; font-weight: 600;
  }
  .inv-foot { flex-direction: column; align-items: flex-start; gap: 8px; line-height: 1.6; }

  .detail-hero { grid-template-columns: 100px minmax(0, 1fr); gap: 10px 16px; padding: 18px; }
  .detail-hero__art img { width: 100px; height: 100px; }
  .detail-hero__main h1 { font-size: 23px; }
  .detail-hero__qty { font-size: 26px; }
  .detail-hero__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .detail-hero__actions .btn { width: 100%; padding: 9px 8px; font-size: 12px; }
  .detail-info { padding: 16px 18px; }
  .detail-info > dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .log-list { padding: 6px 16px; }
  .log-row time { font-size: 9px; }

  .form-hero h1 { font-size: 24px; }
  .form-card { padding: 4px 18px 22px; }
  .form-card__actions { flex-direction: column-reverse; }
  .form-card__actions .btn { width: 100%; }
  .modal-card--wide { max-height: 86vh; }
  .confirm__actions { flex-direction: column-reverse; }
  .confirm__actions .btn { width: 100%; }
  .form__actions { flex-direction: column-reverse; }
  .form__actions .btn { width: 100%; }
}

@media (max-width: 480px) {
  /* 与 layout.css 的 .view padding 14px 对齐，避免横滑容器多出 2px 造成页面横向滚动 */
  .inv-stats { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; scroll-padding: 0 14px; }
  .inv-chips { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .inv-head__text p { display: none; }
  .detail-hero__actions { grid-template-columns: minmax(0, 1fr); }
  .detail-hero__actions .btn { width: 100%; }
  .form-card .field-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .shelf-hint { flex-wrap: wrap; }
  .shelf-hint > span { flex-basis: 100%; order: 2; }
}
