/* ============================================================
   商店模块 v5 视觉系统（2026-10-31）— sp- 前缀
   「清晨渔港市集」暖色日间风：奶油纸底 + 湖水青 + 市集橙 + 遮阳棚条纹
   （与星贝秘铺的深紫夜空梦幻风刻意区分：一个白天赶集，一个夜晚寻宝）
   无 @media，流式自适应；无 color-mix，兼容旧 webview
   ============================================================ */

/* ---------- 市集容器（暖纸底 + 青边 + 顶部橙白遮阳棚） ---------- */
/* 移动端：#panel 是 flex 纵向容器且自身不滚（main.css 699），sp-wrap 需自占满并成为滚动容器，
   否则 flex 压高度 + overflow:hidden 会把溢出内容裁死（表现=页面下拉不动，2026-10-31 修） */
.sp-wrap {
  position: relative; overflow: hidden auto; text-align: left;
  flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
  border-radius: 18px; padding: 18px 13px 13px;
  background: linear-gradient(168deg, #fffaf0 0%, #fdf1da 52%, #f8e7c6 100%);
  border: 3px solid #2f9e97;
  box-shadow: 0 6px 22px rgba(122,86,40,.22), 0 0 0 5px rgba(255,255,255,.55), inset 0 0 30px rgba(255,214,140,.35);
}
/* 顶部遮阳棚条纹（市集摊位标志） */
.sp-wrap::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 9px;
  background: repeating-linear-gradient(90deg, #ff8a4c 0 16px, #fff7ea 16px 32px);
  border-bottom: 2px solid #e07a3a;
  box-shadow: 0 2px 5px rgba(180,100,40,.25);
}
/* 日光洒金光斑（替代秘铺的星空，慢呼吸） */
.sp-stars { position: absolute; inset: 0; pointer-events: none; opacity: .8;
  background: radial-gradient(7px 7px at 12% 15%, rgba(255,196,90,.30) 45%, transparent 50%),
    radial-gradient(10px 10px at 80% 10%, rgba(120,210,200,.28) 45%, transparent 52%),
    radial-gradient(6px 6px at 90% 55%, rgba(255,170,80,.26) 45%, transparent 50%),
    radial-gradient(9px 9px at 25% 72%, rgba(255,210,120,.24) 45%, transparent 52%),
    radial-gradient(6px 6px at 58% 30%, rgba(140,215,205,.26) 45%, transparent 50%),
    radial-gradient(8px 8px at 45% 88%, rgba(255,190,95,.22) 45%, transparent 52%),
    radial-gradient(5px 5px at 68% 62%, rgba(255,200,110,.24) 45%, transparent 50%);
  opacity: .55; }
/* 子项禁收缩（flex 纵向滚动容器中默认 shrink 会把导航/卡片压变形） */
.sp-wrap > * { position: relative; flex: 0 0 auto; }

/* ---------- 招牌：NPC + 渐变标题 ---------- */
.sp-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.sp-npc { width: 58px; height: 74px; object-fit: cover; border-radius: 12px; flex: 0 0 auto;
  border: 2.5px solid #ff9d4d; box-shadow: 0 0 0 2.5px #fff7e8, 0 4px 10px rgba(160,90,30,.35); }
.sp-head-miss { width: 58px; height: 74px; border-radius: 12px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: #fff6e2; border: 2.5px solid #ff9d4d; }
.sp-title { margin: 0 0 4px; font-size: 18px; font-weight: bold; letter-spacing: 3px;
  background: linear-gradient(90deg, #ff7a35 15%, #e8560f 45%, #12867f 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1.5px 1px rgba(140,80,20,.35)); }
.sp-quote { font-size: 12px; color: #8a6f4b; }
.sp-chipbtn {
  border: 1.5px solid #2f9e97; background: #ffffff; color: #0e7a74;
  border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: bold;
  cursor: pointer; white-space: nowrap; transition: all .15s;
  box-shadow: 0 2px 5px rgba(120,90,40,.15);
}
.sp-chipbtn:active { background: #e6f5f3; transform: scale(.95); }

/* ---------- 子导航（暖木轨 + 湖青高亮） ---------- */
.sp-nav { display: flex; gap: 6px; padding: 5px; margin-bottom: 11px;
  background: rgba(122,86,40,.10); border: 1.5px solid #e5cfa0; border-radius: 14px;
  box-shadow: inset 0 2px 5px rgba(140,100,40,.14); }
.sp-tab {
  flex: 1; border: none; cursor: pointer; border-radius: 10px; padding: 9px 0 8px;
  background: transparent; color: #9b7f52; font-size: 13px; font-weight: bold; letter-spacing: 2px;
  display: flex; align-items: center; justify-content: center; gap: 5px; transition: all .18s;
}
.sp-tab .sp-ti { font-size: 15px; line-height: 1; filter: grayscale(.55) opacity(.65); transition: all .18s; }
.sp-tab:active { transform: scale(.95); }
.sp-tab.on { background: linear-gradient(135deg, #2cb3a5, #12867f); color: #fff;
  box-shadow: 0 3px 9px rgba(30,140,130,.42); }
.sp-tab.on .sp-ti { filter: none; }

/* ---------- 分区标签 ---------- */
.sp-sec { display: flex; align-items: center; gap: 8px; margin: 13px 2px 7px; }
.sp-sec-ic { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: #ffffff; border: 1.5px solid #2f9e97; box-shadow: 0 2px 4px rgba(120,90,40,.12); }
.sp-sec-tt { flex: 0 0 auto; font-size: 12.5px; font-weight: bold; color: #5f4a2a; letter-spacing: 1px; }
.sp-sec-note { flex: 0 0 auto; font-size: 10px; color: #a8906a; }
.sp-sec-line { flex: 1; height: 1.5px; min-width: 16px;
  background: linear-gradient(90deg, rgba(47,158,151,.55), rgba(255,150,70,.28), transparent); }

/* ---------- 商品卡（白纸卡 + 固定行高防挤压） ---------- */
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 9px; }
.sp-item {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  border: 1.5px solid #edd7ab; border-radius: 14px; padding: 10px 7px 9px;
  background: linear-gradient(175deg, #fffdf6, #fdf5e0);
  box-shadow: 0 2px 6px rgba(150,105,45,.13);
  transition: transform .12s; position: relative;
}
.sp-item:hover { transform: translateY(-2px); }
.sp-hold { position: absolute; top: -8px; right: -5px; font-style: normal; font-size: 10px; font-weight: bold;
  color: #fff; background: linear-gradient(90deg, #2cb3a5, #12867f); border-radius: 999px;
  padding: 1.5px 8px; box-shadow: 0 2px 5px rgba(25,130,120,.45); white-space: nowrap;
  border: 1.5px solid rgba(255,255,255,.55); }
.sp-hold.ltd { background: linear-gradient(90deg, #ff8a4c, #e8531f); box-shadow: 0 2px 5px rgba(220,90,35,.45); }
.sp-rico { height: 44px; display: flex; align-items: center; justify-content: center; margin: 4px 0 4px; }
.sp-rico img { max-width: 88%; max-height: 44px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(150,100,40,.3)); }
.sp-rico span { font-size: 30px; filter: drop-shadow(0 2px 3px rgba(150,100,40,.3)); }
.sp-rname { font-size: 11.5px; color: #55401f; font-weight: bold; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-rsub { font-size: 10px; color: #ab9265; margin: 2px 0 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 13px; }
.sp-price { display: inline-flex; align-items: center; gap: 4px; margin: 5px 0 6px; padding: 2px 10px;
  border-radius: 999px; background: #fff3d2; border: 1px solid #f2c96e;
  font-size: 12px; font-weight: bold; color: #b06e00; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(180,130,40,.18); }
.sp-price img { width: 15px; height: 15px; object-fit: contain; }
.sp-sec-note img, .sp-rc-sub img, .sp-sum-tx img { width: 15px; height: 15px; object-fit: contain; vertical-align: -2px; }
/* 确认弹窗由商店发起时，行内道具图（如星星贝壳 it30b.png）限小尺寸，防大图撑爆文案行 */
#game-confirm img { width: 18px; height: 18px; object-fit: contain; vertical-align: -3px; }

/* ---------- 统一步进器（一体式药丸：− 数量 ＋；长按连点，点数字可直接键入） ---------- */
.sp-step { display: flex; align-items: center; margin-bottom: 7px;
  background: #f2faf8; border: 1.5px solid #bfe0db; border-radius: 10px; overflow: hidden; }
.sp-st { width: 30px; height: 28px; border: none; cursor: pointer; font-size: 15px; font-weight: bold;
  color: #0e7a74; background: transparent; display: flex; align-items: center; justify-content: center;
  line-height: 1; transition: background .12s; padding: 0; user-select: none; -webkit-user-select: none; touch-action: none; }
.sp-st:active { background: #d8efeb; }
.sp-nin { width: 46px; border: none; background: transparent; text-align: center;
  font-size: 12.5px; font-weight: bold; color: #b06e00; padding: 5px 0;
  -webkit-appearance: none; appearance: none; }
.sp-nin:focus { outline: none; background: #fff; }
.sp-nin::-webkit-outer-spin-button, .sp-nin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sp-na { border: 1.5px dashed #9fd4ce; border-radius: 9px; height: 28px; padding: 0 9px;
  font-size: 10.5px; font-weight: bold; color: #0e7a74; background: #ffffff; cursor: pointer; }
.sp-na:active { background: #e2f3f1; }

/* ---------- 统一主按钮（全场唯一一种主按钮：湖水青扁平款，防长价格溢出） ---------- */
.sp-btn { border: none; cursor: pointer; border-radius: 10px; padding: 7px 5px; width: 100%;
  font-size: 11.5px; font-weight: bold; color: #fff; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(180deg, #38b5a9, #14887f);
  box-shadow: 0 2px 5px rgba(25,130,120,.35), inset 0 1px 0 rgba(255,255,255,.28); transition: all .12s; }
.sp-btn:active { transform: scale(.96); filter: brightness(.94); }
.sp-btn:disabled { filter: grayscale(.85) brightness(.88); cursor: not-allowed; box-shadow: none; }

/* ---------- 回收行 ---------- */
.sp-rcrow {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border: 1.5px solid #edd7ab; border-radius: 14px;
  background: linear-gradient(175deg, #fffdf6, #fdf5e0);
  box-shadow: 0 2px 6px rgba(150,105,45,.13);
  transition: all .15s; position: relative;
}
.sp-rcrow.sp-on { border-color: #2f9e97;
  box-shadow: 0 0 0 2.5px rgba(47,158,151,.30), 0 3px 9px rgba(30,140,130,.25); }
.sp-rcrow.sp-no { opacity: .5; }
.sp-rc-art { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: #fff6e2; border: 1.5px solid #e8d2a4; }
.sp-rc-art img { max-width: 40px; max-height: 40px; object-fit: contain; }
.sp-rc-tx { flex: 1; min-width: 0; }
.sp-rc-nm { font-size: 13px; font-weight: bold; color: #55401f;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-rc-sub { font-size: 11px; color: #a08a60; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-rc-sub b { color: #b06e00; }
.sp-rc-no { flex: 0 0 auto; font-size: 10.5px; color: #9b857f; font-weight: bold;
  background: #f3ece0; border: 1px solid #ddcdb4;
  border-radius: 999px; padding: 4px 11px; }

/* ---------- 结算条（琥珀收购单 + 橙色大按钮） ---------- */
.sp-sumbar { position: sticky; bottom: 8px; z-index: 5; margin-top: 12px;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 14px; background: linear-gradient(135deg, #fff6dd, #ffe9bd);
  border: 1.5px solid #f2b95c; box-shadow: 0 5px 16px rgba(170,110,35,.32), 0 0 0 3px rgba(255,255,255,.5); }
.sp-sum-tx { flex: 1; min-width: 0; font-size: 12px; color: #7a6238; }
.sp-sum-tx b { color: #c96a00; font-size: 14.5px; }
.sp-sum-go { flex: 0 0 auto; border: none; cursor: pointer; border-radius: 11px; padding: 11px 22px;
  font-size: 13px; font-weight: bold; letter-spacing: 2px; color: #fff;
  background: linear-gradient(180deg, #38b5a9, #14887f);
  box-shadow: 0 3px 8px rgba(25,130,120,.4), inset 0 1px 0 rgba(255,255,255,.28); transition: all .12s; }
.sp-sum-go:active { transform: scale(.96); filter: brightness(.94); }
.sp-sum-go:disabled { filter: grayscale(.85) brightness(.88); cursor: not-allowed; box-shadow: none; }

/* ---------- 强化页 ---------- */
.sp-fcard { width: 100%; padding: 13px 14px; border-radius: 14px;
  border: 1.5px solid #d9e8d2; background: linear-gradient(175deg, #fdfef6, #f4f8ea);
  box-shadow: 0 2px 6px rgba(150,105,45,.13); }
.sp-fcard.rod { border-color: #f0cf90; background: linear-gradient(175deg, #fffdf3, #fdf2d8); }
.sp-fcard-ic { font-size: 34px; flex: 0 0 auto; filter: drop-shadow(0 2px 3px rgba(150,100,40,.3)); }
.sp-fcard-tt { font-size: 14px; font-weight: bold; color: #55401f; }
.sp-fcard-tag { display: inline-flex; align-items: center; font-size: 10px; font-weight: bold;
  border-radius: 999px; padding: 2px 9px; margin-left: 6px; vertical-align: 1px;
  background: #fff3d2; border: 1px solid #f2c96e; color: #b06e00; }
.sp-fcard-tag.grn { background: #ecf7e2; border-color: #a5cf8e; color: #3f7d2c; }
.sp-fcard-row { display: flex; align-items: flex-start; gap: 13px; }
.sp-fcard-sub { font-size: 11.5px; color: #8a7350; margin-top: 5px; line-height: 1.75; }
.sp-fcard-sub b { color: #b06e00; }
.sp-lvbar { position: relative; height: 14px; border-radius: 999px; margin-top: 9px; overflow: hidden;
  background: #f1e6c9; border: 1.5px solid #e2cda0; }
.sp-lvbar-in { height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #7ecb58, #3f9e3a 70%, #2c8746);
  box-shadow: 0 0 7px rgba(100,180,80,.55); }
.sp-lvbar-tx { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: bold; color: #fff; text-shadow: 0 1px 2px rgba(60,90,30,.75); letter-spacing: 1px; }
.sp-empty-hero { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 20px 12px; text-align: center; }
.sp-empty-hero .big { font-size: 36px; filter: drop-shadow(0 3px 4px rgba(150,100,40,.3)); }
.sp-empty-hero .tt { font-size: 13.5px; font-weight: bold; color: #55401f; letter-spacing: 1px; }
.sp-empty-hero .sub { font-size: 11px; color: #a8906a; }
.sp-foot-note { margin-top: 11px; text-align: center; font-size: 10.5px; color: #b09a72; letter-spacing: .5px; }

/* ---------- 窄屏（手机竖屏）微调：标题字距收窄防逐字断行成两列 ----------
   宽度型媒体查询在横屏旋转态（body.lm-rot）下视口宽度与竖屏一致，行为相同，无需反制 */
@media (max-width: 480px) {
  .sp-title { font-size: 15px; letter-spacing: 2px; white-space: nowrap; }
  .sp-quote { font-size: 11px; }
  .sp-npc, .sp-head-miss { width: 50px; height: 66px; }
  .sp-chipbtn { padding: 5px 10px; font-size: 11.5px; }
  .sp-wrap { padding: 15px 10px 11px; }
  /* 回收行窄屏收紧：步进器/全部键缩窄，给名称与持有行腾出文字宽度（minmax(0,1fr) 修复溢出后文字偏挤） */
  .sp-rcrow { gap: 8px; padding: 10px; }
  .sp-rc-sub { white-space: normal; line-height: 1.5; } /* 窄屏持有行允许换两行，保住回收价格不被截 */
  .sp-rcrow .sp-step { border-radius: 9px; }
  .sp-rcrow .sp-st { width: 26px; height: 27px; }
  .sp-nin { width: 36px; }
  .sp-na { padding: 0 7px; }
}
