/* 商店页 —— 独立样式，不依赖 style.css */
* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.shop {
  min-height: 100vh;
  background-color: #FBF6EC;
  background-image:
    radial-gradient(rgba(107, 79, 58, 0.035) 1px, transparent 1.2px),
    repeating-linear-gradient(0deg, rgba(107, 79, 58, 0.018) 0 1px, transparent 1px 6px);
  background-size: 14px 14px, 100% 100%;
  color: #6B4F3A;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.shop-page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 24px 44px;
}

/* ---------- 顶部软标题栏 ---------- */
.shop-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 8px 130px;
  border-radius: 26px;
  background: #FFFDF7;
  box-shadow: 0 6px 18px rgba(160, 138, 118, 0.14);
}

.shop-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: #6B4F3A;
  line-height: 1.2;
}

.coin-pill {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px 0 9px;
  border-radius: 999px;
  background: #F7E7C1;
  color: #6B4F3A;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.coin-pill svg { width: 24px; height: 24px; display: block; }

/* ---------- 分类胶囊 ---------- */
.shop-cats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 18px 0 22px;
}

.cat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  height: 58px;
  padding: 0 30px;
  border: none;
  border-radius: 999px;
  background: #F7E7C1;
  color: #6B4F3A;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(160, 138, 118, 0.14);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.cat-btn svg { width: 34px; height: 34px; display: block; }

.cat-btn:hover { transform: translateY(-1px); }
.cat-btn:active { transform: translateY(1px) scale(0.99); }

.cat-btn.is-active {
  background: #E8AEB4;
  color: #FFFFFF;
}

.cat-btn:focus-visible,
.buy-btn:focus-visible {
  outline: 3px solid #BFDDD2;
  outline-offset: 3px;
}

/* ---------- 商品网格 ---------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 14px 14px 16px;
  border-radius: 26px;
  background: #FFFDF7;
  box-shadow: 0 6px 18px rgba(160, 138, 118, 0.14);
}

.shop-card[hidden] { display: none; }

.card-art {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  border-radius: 20px;
  background: #FBF6EC;
  overflow: hidden;
}

.card-art svg {
  width: 108px;
  height: 108px;
  display: block;
}

.card-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: #6B4F3A;
}

/* 厚购买按钮：整条充满卡片 */
.buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: none;
  border-radius: 20px;
  background: #E8AEB4;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 5px 0 #D89AA1, 0 6px 18px rgba(160, 138, 118, 0.14);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.buy-btn svg { width: 26px; height: 26px; display: block; }

.buy-btn:hover { filter: brightness(1.04); }
.buy-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #D89AA1, 0 4px 12px rgba(160, 138, 118, 0.12);
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  right: 24px;
  bottom: 26px;
  z-index: 80;
  max-width: calc(100vw - 48px);
  padding: 13px 22px;
  border-radius: 18px;
  background: #6B4F3A;
  color: #FFFDF7;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(160, 138, 118, 0.24);
}

.toast.is-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-head { padding: 8px 120px; }
}

@media (max-width: 560px) {
  .shop-page { padding: 14px 16px 36px; }
  .shop-head { min-height: 58px; padding: 6px 90px; border-radius: 22px; }
  .shop-title { font-size: 22px; }
  .coin-pill { right: 12px; height: 36px; font-size: 16px; padding: 0 13px 0 8px; }
  .coin-pill svg { width: 21px; height: 21px; }

  .shop-cats { gap: 10px; margin: 14px 0 18px; }
  .cat-btn { flex: 1 1 0; min-width: 0; height: 56px; padding: 0 12px; }

  .shop-grid { grid-template-columns: 1fr; gap: 20px; }
  .card-art { height: 150px; }
  .card-art svg { width: 104px; height: 104px; }
  .toast { right: 16px; bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .cat-btn, .buy-btn, .toast { transition: none; }
}

/* ---------- 已拥有态（金币系统接入 2026-10-23） ---------- */
.buy-btn.is-owned,
.buy-btn.is-owned:disabled {
  background: #BFDDD2;
  color: #6B4F3A;
  font-size: 17px;
  letter-spacing: 0.08em;
  box-shadow: none;
  cursor: default;
  transform: none;
}

.buy-btn.is-owned:hover,
.buy-btn.is-owned:active {
  filter: none;
  box-shadow: none;
  transform: none;
}

.buy-btn.is-owned svg { display: none; }

/* ---------- 家具摆出 / 取下（2026-10-23） ---------- */
.place-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 16px;
  background: #F7E7C1;
  color: #6B4F3A;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 3px 0 #E3CFA4;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.place-btn:hover { filter: brightness(1.03); }

.place-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #E3CFA4;
}

.place-btn:focus-visible {
  outline: 3px solid #BFDDD2;
  outline-offset: 3px;
}

/* 未摆出：同一套配色，压淡一点，文案是「摆回」 */
.place-btn.is-out {
  background: #FFFDF7;
  color: #A08A76;
  box-shadow: 0 0 0 2px #E3CFA4 inset;
}

@media (prefers-reduced-motion: reduce) {
  .place-btn { transition: none; }
}

/* ---------- 特效分类（2026-10-23） ---------- */
.fx-card { position: relative; }

.fx-art {
  background: radial-gradient(circle at 50% 45%, #2A2E42 0%, #14161F 72%);
}

.fx-art .fx-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.fx-trigger-note {
  margin: -2px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #A08A76;
}

.fx-buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: none;
  border-radius: 20px;
  background: #E8AEB4;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  box-shadow: 0 5px 0 #D89AA1, 0 6px 18px rgba(160, 138, 118, 0.14);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.fx-buy-btn[hidden] { display: none; }

.fx-buy-btn svg { width: 24px; height: 24px; display: block; }

.fx-buy-btn:hover { filter: brightness(1.04); }

.fx-buy-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #D89AA1, 0 4px 12px rgba(160, 138, 118, 0.12);
}

/* 金币不足：置灰但可点（点了给提示，不扣币） */
.fx-buy-btn.is-poor {
  background: #DCCFC6;
  color: #8A7566;
  box-shadow: 0 5px 0 #C6B7AD;
  filter: grayscale(0.35);
}

.fx-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 18px;
  background: #F7E7C1;
  color: #6B4F3A;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 3px 0 #E3CFA4;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.18s ease, color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.fx-toggle[hidden] { display: none; }

.fx-toggle:hover { filter: brightness(1.03); }

.fx-toggle:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #E3CFA4;
}

.fx-toggle.is-active {
  background: #6B4F3A;
  color: #FFFDF7;
  box-shadow: 0 3px 0 #4E3826;
}

.fx-card.is-active {
  box-shadow: 0 0 0 3px #E8AEB4 inset, 0 6px 18px rgba(160, 138, 118, 0.18);
}

.fx-edit {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #FFFDF7;
  color: #6B4F3A;
  font-size: 17px;
  line-height: 34px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(60, 44, 32, 0.18);
  -webkit-tap-highlight-color: transparent;
}

.fx-edit:hover { background: #F7E7C1; }

/* 自定义面板（木质） */
.fx-panel-mask {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(60, 44, 32, 0.34);
}

.fx-panel-mask[hidden] { display: none; }

.fx-panel {
  width: min(360px, 100%);
  padding: 18px 18px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFFDF7 0%, #F7E7C1 100%);
  box-shadow: 0 14px 40px rgba(60, 44, 32, 0.32);
  color: #6B4F3A;
}

.fx-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.fx-panel-field { display: block; margin-bottom: 12px; }

.fx-panel-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #8A6E58;
}

.fx-name-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 2px solid #E3CFA4;
  border-radius: 12px;
  background: #FFFDF7;
  color: #6B4F3A;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
}

.fx-name-input:focus { outline: none; border-color: #E8AEB4; }

.fx-trigger-opts { display: flex; flex-direction: column; gap: 8px; }

.fx-trigger-opts label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  background: #FFFDF7;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.fx-trigger-opts input { accent-color: #E8AEB4; width: 17px; height: 17px; }

.fx-panel-actions { display: flex; gap: 10px; margin-top: 14px; }

.fx-panel-actions button {
  flex: 1 1 0;
  height: 44px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.fx-panel-cancel { background: #FFFDF7; color: #8A6E58; box-shadow: 0 0 0 2px #E3CFA4 inset; }
.fx-panel-save { background: #E8AEB4; color: #FFFFFF; box-shadow: 0 3px 0 #D89AA1; }

@media (prefers-reduced-motion: reduce) {
  .fx-buy-btn, .fx-toggle { transition: none; }
}
