/* 阶段2：商品/分类/后台管理 样式补充（叠加在 theme.css / layout.css 之上） */

/* 图片卡片 */
.prod .thumb {
  height: 120px;
  background: #f4f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #b9bec7;
  font-size: 13px;
}
.prod .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.prod .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

/* 商品详情图 */
.pd-hero-box { background: #f4f5f7; border-radius: 12px; overflow: hidden; min-height: 180px; display: flex; align-items: center; justify-content: center; }
.pd-img { width: 100%; max-height: 360px; object-fit: cover; display: block; }
.pd-detail { margin-top: 10px; }
.pd-detail-img { width: 100%; border-radius: 10px; }

/* 徽标 */
.badge-gold { background: #FBF3DA; color: #9a6b00; border: 1px solid #EAD28A; padding: 1px 7px; border-radius: 10px; font-size: 12px; }
.badge-soft { background: #eef1f5; color: #5a6472; padding: 1px 7px; border-radius: 10px; font-size: 12px; }

/* 分类树 */
.cat-row { padding: 10px 0; border-bottom: 1px dashed #ececf0; }
.cat-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat-name { font-weight: 700; }
.cat-subs { margin: 6px 0 6px 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.cat-add2 { margin-left: 14px; display: flex; gap: 6px; align-items: center; }
.chip.sm { display: inline-flex; align-items: center; gap: 4px; }

/* 表单与输入 */
.inp { width: 100%; padding: 9px 10px; border: 1px solid #dfe3ea; border-radius: 8px; font-size: 14px; box-sizing: border-box; background: #fff; }
.inp.sm { width: auto; padding: 5px 8px; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn { display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid #d9dde4; background: #fff; color: #333; cursor: pointer; font-size: 14px; text-decoration: none; }
.btn:hover { background: #f5f6f8; }
.btn-primary { background: var(--brand, #C8102E); color: #fff; border-color: transparent; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.mini { padding: 4px 9px; border-radius: 6px; border: 1px solid #d9dde4; background: #fff; cursor: pointer; font-size: 12px; }
.mini.del { color: #c0392b; border-color: #f0c5c0; }
.mini:hover { background: #f5f6f8; }

/* 后台布局 */
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.admin-head h2 { margin: 0; }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 2px solid #ececf0; padding-bottom: 6px; }
.admin-tabs button { padding: 8px 14px; border: none; background: #f1f3f6; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 14px; color: #555; }
.admin-tabs button.active { background: var(--brand, #C8102E); color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.stat-card { background: #fff; border: 1px solid #ececf0; border-radius: 10px; padding: 14px; text-align: center; }
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--brand, #C8102E); }
.stat-card .lbl { color: #6b7280; font-size: 13px; margin-top: 4px; }

/* 表格 */
.table-wrap { overflow-x: auto; border: 1px solid #ececf0; border-radius: 10px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.admin-table th, .admin-table td { padding: 9px 10px; border-bottom: 1px solid #f0f1f4; text-align: left; white-space: nowrap; }
.admin-table th { background: #f7f8fa; color: #555; position: sticky; top: 0; }
.admin-table tbody tr:hover { background: #fafbfc; }
.admin-table .ops { display: flex; gap: 4px; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 620px; max-height: 90vh; overflow: auto; padding: 18px; }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #555; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* 顶栏管理入口（PC 端显示） */
.admin-link { font-weight: 700; color: var(--brand, #C8102E); }
@media (max-width: 768px) {
  .admin-link { font-size: 13px; }
  .form-grid { grid-template-columns: 1fr; }
}
