/* 选单系统 · 移动端优先样式（VCloud 蓝 #1f6bff 主调） */
:root {
  --blue: #1f6bff; --blue-d: #1554d1; --blue-bg: #eef4ff;
  --bg: #f5f7fa; --card: #fff; --line: #e8ecf2;
  --t1: #1a2233; --t2: #5c6b85; --t3: #98a4bb;
  --ok: #0aa870; --warn: #f59e0b; --bad: #e5484d; --gold: #d97706;
  --r: 12px; --shadow: 0 2px 10px rgba(26,34,51,.06);
  --nav-h: 56px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--t1); font-size: 15px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.topbar .logo { font-weight: 700; color: var(--blue); font-size: 17px; white-space: nowrap; }
.topbar .search { flex: 1; display: flex; }
.topbar input { flex: 1; border: 1px solid var(--line); border-radius: 20px; padding: 8px 14px; background: var(--bg); outline: none; }
.topbar .btn-login { border: 1px solid var(--blue); color: var(--blue); background: none; border-radius: 18px; padding: 6px 14px; }

/* 分类 chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 6px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); color: var(--t2); font-size: 14px; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* 产品卡片：单列，桌面双列 */
.plist { padding: 4px 14px calc(var(--nav-h) + 24px); display: grid; gap: 12px; }
.pcard { display: flex; gap: 12px; background: var(--card); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); }
.pcard .thumb { width: 96px; height: 96px; border-radius: 8px; object-fit: cover; background: var(--blue-bg); flex-shrink: 0; }
.pcard .thumb-empty { width: 96px; height: 96px; border-radius: 8px; background: var(--blue-bg); color: var(--blue);
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; font-size: 20px; }
.pcard .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pcard .name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .sum { color: var(--t2); font-size: 13px; margin: 2px 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .price-row { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.price { color: var(--bad); font-weight: 700; }
.price::before { content: "¥"; font-size: .78em; }
.price-old { color: var(--t3); text-decoration: line-through; font-size: 12px; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 4px; }
.tag-gold { background: #fdf3e3; color: var(--gold); }

/* 底部导航（移动端优先） */
.navbar { position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-h); background: var(--card);
  border-top: 1px solid var(--line); display: flex; z-index: 60; }
.navbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--t3); font-size: 11px; gap: 2px; position: relative; }
.navbar a.on { color: var(--blue); }
.navbar .ico { font-size: 20px; line-height: 1; }
.navbar .badge { position: absolute; top: 6px; right: calc(50% - 20px); background: var(--bad); color: #fff;
  font-size: 10px; border-radius: 9px; min-width: 16px; height: 16px; line-height: 16px; text-align: center; padding: 0 4px; }

/* 详情页 */
.detail { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.detail .gallery { background: var(--card); }
.detail .gallery img { width: 100%; max-height: 380px; object-fit: contain; }
.detail .head { background: var(--card); padding: 14px; margin-bottom: 10px; }
.detail .head .price-row { margin: 8px 0 4px; }
.detail .desc { background: var(--card); padding: 14px; margin-bottom: 10px; min-height: 120px; }
.detail .desc img { margin: 8px 0; }
.detail .sec-title { font-weight: 600; margin-bottom: 8px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table td { border: 1px solid var(--line); padding: 6px 10px; }
.spec-table td:first-child { background: var(--bg); color: var(--t2); width: 90px; }
.actionbar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; z-index: 60; }
.actionbar .btn { flex: 1; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 10px;
  padding: 11px 18px; font-size: 15px; font-weight: 500; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:active { background: var(--blue-d); }
.btn-ghost { background: var(--blue-bg); color: var(--blue); }
.btn-danger { background: #fdecec; color: var(--bad); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 清单/表单 */
.page { padding: 14px 14px calc(var(--nav-h) + 30px); }
.card { background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: none; }
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; font-size: 16px; }
.stepper input { width: 44px; height: 30px; text-align: center; border: 1px solid var(--line); border-radius: 8px; }
.form-item { margin-bottom: 12px; }
.form-item label { display: block; font-size: 13px; color: var(--t2); margin-bottom: 5px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; background: var(--card); outline: none; }
.form-item input:focus, .form-item textarea:focus { border-color: var(--blue); }
.hint { color: var(--t3); font-size: 12px; margin-top: 4px; }

/* 状态徽 */
.badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 5px; }
.b-wait { background: #fdf3e3; color: var(--warn); }
.b-ok { background: #e3f7ef; color: var(--ok); }
.b-bad { background: #fdecec; color: var(--bad); }
.b-blue { background: var(--blue-bg); color: var(--blue); }

/* 空态 */
.empty { text-align: center; color: var(--t3); padding: 60px 0; }
.empty .ico { font-size: 42px; margin-bottom: 10px; }

/* toast */
#toast { position: fixed; top: 18%; left: 50%; transform: translateX(-50%); background: rgba(26,34,51,.88); color: #fff;
  padding: 10px 20px; border-radius: 10px; font-size: 14px; z-index: 999; display: none; max-width: 80vw; }

/* 登录/注册 */
.auth-wrap { max-width: 400px; margin: 8vh auto; padding: 0 20px; }
.auth-card { background: var(--card); border-radius: 16px; padding: 28px 22px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .sub { color: var(--t2); font-size: 13px; margin-bottom: 20px; }

/* ============ 桌面端适配 ============ */
@media (min-width: 760px) {
  .plist { grid-template-columns: 1fr 1fr; }
  .detail .inner, .page { max-width: 860px; margin: 0 auto; }
  .auth-wrap { margin-top: 12vh; }
}
@media (min-width: 1080px) {
  .plist { grid-template-columns: repeat(3, 1fr); max-width: 1200px; margin: 0 auto; }
  .navbar { max-width: 640px; left: 50%; transform: translateX(-50%); border-radius: 14px 14px 0 0; border: 1px solid var(--line); border-bottom: none; }
}

/* ============ 管理后台（桌面优先，兼容平板） ============ */
.adm { display: flex; min-height: 100vh; }
.adm-side { width: 190px; background: #16213a; color: #c6d0e2; flex-shrink: 0; display: flex; flex-direction: column; }
.adm-side .brand { padding: 18px 16px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.adm-side a { padding: 13px 18px; color: #c6d0e2; font-size: 14px; border-left: 3px solid transparent; }
.adm-side a.on { background: rgba(31,107,255,.18); color: #fff; border-left-color: var(--blue); }
.adm-main { flex: 1; padding: 20px; min-width: 0; }
.adm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.adm-head h2 { font-size: 18px; }
.tbl { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); font-size: 13px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { background: #f8fafd; color: var(--t2); font-weight: 500; white-space: nowrap; }
.tbl td.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.modal-mask { position: fixed; inset: 0; background: rgba(10,16,28,.5); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow: auto; }
.modal { background: var(--card); border-radius: 14px; padding: 20px; width: 100%; max-width: 640px; max-height: 90vh; overflow: auto; }
.modal h3 { margin-bottom: 14px; }
.modal .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 760px) {
  .adm { flex-direction: column; }
  .adm-side { width: 100%; flex-direction: row; overflow-x: auto; }
  .adm-side .brand { display: none; }
  .adm-side a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .adm-side a.on { border-bottom-color: var(--blue); }
  .tbl { display: block; overflow-x: auto; }
}
