/* ========== 好物展示 Web · 全局样式（移动端优先，移植自小程序） ========== */
:root {
  --red: #e1251b;
  --red-deep: #b71c1c;
  --red-light: #ff5a4e;
  --grad: linear-gradient(135deg, #ff6b5e 0%, #e1251b 60%, #c4141c 100%);
  --grad-soft: linear-gradient(135deg, #fff5f4 0%, #ffe9e7 100%);
  --text: #262626;
  --text-light: #999999;
  --price: #e1251b;
  --bg: #f5f5f5;
  --card: #ffffff;
  --shadow: 0 12px 40px rgba(225, 37, 27, 0.1);
  --shadow-sm: 0 6px 20px rgba(225, 37, 27, 0.06);
  --radius-lg: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  font-size: 14px;
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ===== 按压动效 ===== */
.press { transform: scale(0.95); }
[data-press] { transition: transform 0.18s ease; }

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  margin: 10px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.glass {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ===== 价格 ===== */
.price { color: var(--price); font-weight: 800; }
.price::before { content: '¥'; font-size: 0.8em; margin-right: 1px; }
.price.big { font-size: 26px; }

/* ===== 按钮 ===== */
.btn-primary {
  display: block;
  background: var(--grad);
  color: #fff;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 0;
  text-align: center;
  box-shadow: 0 10px 26px rgba(225, 37, 27, 0.35);
  transition: transform 0.18s ease;
  cursor: pointer;
  border: none;
  width: 100%;
}
.btn-primary:active { transform: scale(0.95); }
.btn-disabled { background: #d9d9d9; box-shadow: none; }

/* ===== 空状态 ===== */
.empty { text-align: center; color: var(--text-light); padding: 60px 0; font-size: 14px; }
.empty::before { content: '🛍️'; display: block; font-size: 40px; margin-bottom: 10px; }

/* ===== 工具类 ===== */
.flex { display: flex; align-items: center; }
.flex-1 { flex: 1; }
.text-ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ===== 顶部导航栏 ===== */
.nav-bar {
  background: var(--grad);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  width: 32px; height: 32px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0; background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.nav-logo img { width: 100%; height: 100%; object-fit: cover; }
.nav-title { flex: 1; text-align: left; padding-left: 12px; font-size: 17px; font-weight: 800; letter-spacing: 1px; }
.nav-back { color: #fff; font-size: 20px; cursor: pointer; padding: 0 8px; text-decoration: none; }

/* ===== 底部 Tab ===== */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px; margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid #eee;
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1; text-align: center; padding: 8px 0 6px;
  color: #999; font-size: 11px; text-decoration: none;
}
.tab-item .tab-icon { font-size: 20px; display: block; margin-bottom: 2px; }
.tab-item.active { color: var(--red); font-weight: 700; }

.page-wrap { padding-bottom: 70px; }

/* ===== 弹窗 ===== */
.mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  width: 80%;
  max-width: 340px;
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
}
.modal-title { font-size: 18px; font-weight: 800; }
.modal-sub { font-size: 13px; color: var(--text-light); margin-top: 6px; margin-bottom: 18px; }
.modal-save {
  margin-top: 16px; background: var(--grad); color: #fff;
  font-size: 15px; font-weight: 700; padding: 12px 0; border-radius: 24px;
  box-shadow: 0 10px 26px rgba(225, 37, 27, 0.35); cursor: pointer;
}
.modal-save.disabled { opacity: 0.6; }
.modal-skip { margin-top: 14px; font-size: 13px; color: var(--text-light); padding: 6px; cursor: pointer; }

/* ===== 表单 ===== */
.field {
  background: #f5f5f5; border-radius: 8px; padding: 0 12px;
  font-size: 14px; margin-bottom: 10px; width: 100%;
  box-sizing: border-box; height: 46px; border: none; outline: none;
}
textarea.field { height: auto; padding: 12px; line-height: 1.6; }
.area-lg { min-height: 200px; }
.row2 { display: flex; gap: 10px; }
.row2 .field { flex: 1; }
.picker { display: flex; align-items: center; justify-content: space-between; color: #333; cursor: pointer; }

/* ===== 列表项 ===== */
.p-item {
  display: flex; background: #fff; border-radius: 12px; padding: 10px;
  margin-bottom: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  align-items: center; cursor: pointer;
}
.p-img { width: 60px; height: 60px; border-radius: 8px; background: #f5f5f5; flex-shrink: 0; object-fit: cover; }
.p-info { flex: 1; margin-left: 10px; min-width: 0; }
.p-name { font-weight: 700; font-size: 14px; }
.p-meta { font-size: 12px; color: #999; margin-top: 4px; }
.p-status { font-size: 11px; margin-top: 4px; }
.p-status.on { color: #1a8f4c; }
.p-status.off { color: #bbb; }
.p-actions { display: flex; flex-direction: column; gap: 6px; margin-left: 8px; }
.act {
  font-size: 11px; color: #e1251b; border: 1px solid #ffd9d5;
  border-radius: 6px; padding: 4px 10px; text-align: center; cursor: pointer;
}
.act.danger { color: #c0392b; border-color: #f0c4c0; }

/* ===== Toast ===== */
#toast {
  position: fixed; top: 45%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75); color: #fff; padding: 10px 18px;
  border-radius: 8px; font-size: 14px; z-index: 2000;
  display: none; max-width: 70%; text-align: center;
}

/* ===== 加载 ===== */
#loading {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.6); z-index: 1500;
  display: none; align-items: center; justify-content: center;
  font-size: 14px; color: #666;
}
